Skip to content

Commit

Permalink
Merge branch 'iss_39_40'
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeaw committed Apr 5, 2020
2 parents 85f0c3a + a24c9a5 commit 2bcd8c4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

![Python version badge](https://img.shields.io/badge/python-3.6-blue.svg)
[![license](https://img.shields.io/github/license/LoLab-VU/Gleipnir.svg)](LICENSE)
![version](https://img.shields.io/badge/version-0.26.0-orange.svg)
[![release](https://img.shields.io/github/release-pre/LoLab-VU/Gleipnir.svg)](https://github.com/LoLab-VU/Gleipnir/releases/tag/v0.26.0)
![version](https://img.shields.io/badge/version-0.26.1-orange.svg)
[![release](https://img.shields.io/github/release-pre/LoLab-VU/Gleipnir.svg)](https://github.com/LoLab-VU/Gleipnir/releases/tag/v0.26.1)
[![anaconda cloud](https://anaconda.org/blakeaw/gleipnir/badges/version.svg)](https://anaconda.org/blakeaw/gleipnir)
[![DOI](https://zenodo.org/badge/173688080.svg)](https://zenodo.org/badge/latestdoi/173688080)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e117a46ae8b241539742ab00f8cd1b38)](https://www.codacy.com/app/blakeaw1102/Gleipnir?utm_source=github.com&utm_medium=referral&utm_content=LoLab-VU/Gleipnir&utm_campaign=Badge_Grade)
Expand Down Expand Up @@ -83,7 +83,7 @@ pip install gleipnir-ns
```
or it can be directly sourced from the GitHub repo:
```
pip install -e git+https://github.com/LoLab-VU/Gleipnir@v0.26.0#egg=gleipnir
pip install -e git+https://github.com/LoLab-VU/Gleipnir@v0.26.1#egg=gleipnir
```
However, sourcing from the GitHub repo will not automatically install the core dependencies. You would have to do that separately:
```
Expand Down
2 changes: 1 addition & 1 deletion gleipnir/nsbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def posterior_moments(self):
marginal, edges, centers = post[parm]
width = edges[1] - edges[0]
# resample from the distribution
samples = np.random.choice(centers, size=10000, p=marginal/(marginal.sum())) + (width*(np.random.random(10000)-0.5))
samples = np.random.choice(centers, size=1000000, p=marginal/(marginal.sum())) + (width*(np.random.random(10000)-0.5))
mean = np.mean(samples)
var = np.var(samples)
skew = scipy.stats.skew(samples)
Expand Down
2 changes: 2 additions & 0 deletions gleipnir/pysb_utilities/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import warnings
import pysb
from pysb.simulator import ScipyOdeSimulator
from .nestedsample_it import NestedSampleIt, NestIt
try:
from .hyp_selector import HypSelector
Expand Down
16 changes: 8 additions & 8 deletions gleipnir/pysb_utilities/nestedsample_it.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import importlib
import os.path
import warnings
try:
import pysb
from pysb.simulator import ScipyOdeSimulator
except ImportError:
pass
from scipy.stats import norm, uniform

import numpy as np
from gleipnir.sampled_parameter import SampledParameter
import pysb
from pysb.simulator import ScipyOdeSimulator
from scipy.stats import norm, uniform

from ..sampled_parameter import SampledParameter

default_solver = ScipyOdeSimulator

def is_numbers(inputString):
return all(char.isdigit() for char in inputString)
Expand Down Expand Up @@ -222,7 +222,7 @@ class NestedSampleIt(object):
"""
def __init__(self, model, observable_data, timespan,
solver=pysb.simulator.ScipyOdeSimulator,
solver=default_solver,
solver_kwargs=None, nest_it=None, builder=None):
"""Inits the NestedSampleIt."""
if solver_kwargs is None:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from distutils.core import setup

setup(name='gleipnir',
version='0.26.0',
version='0.26.1',
description='Python toolkit for Nested Sampling.',
author='Blake A. Wilson',
author_email='blake.a.wilson@vanderbilt.edu',
Expand Down

0 comments on commit 2bcd8c4

Please sign in to comment.