Skip to content

Commit

Permalink
make pymodelfit optional dependence
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed May 22, 2015
1 parent d39f943 commit bfd2393
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
10 changes: 7 additions & 3 deletions ccsgp_get_started/examples/gp_stack.py
Expand Up @@ -7,10 +7,15 @@
from ..ccsgp.ccsgp import make_plot
from ..ccsgp.utils import getOpts
from ..ccsgp.config import default_colors
from pymodelfit import LinearModel
from uncertainties import ufloat
from decimal import Decimal

try:
from pymodelfit import LinearModel
linmod = LinearModel()
except ImportError:
linmod = None

dataIMRfit_style = 'with lines lc %s lw 4 lt 1' % default_colors[-2]
cocktailIMRfit_style = 'with lines lc %s lw 4 lt 2' % default_colors[-2]
pseudo_point = np.array([ [-1,1e-7,0,0,1] ])
Expand Down Expand Up @@ -51,7 +56,6 @@ def gp_stack(version, energies, inclMed, inclFits):
data, cocktail, medium = OrderedDict(), OrderedDict(), OrderedDict()
dataIMRfit, cocktailIMRfit, dataTvsS = OrderedDict(), OrderedDict(), OrderedDict()
cocktailContribs, medOnly, qgpOnly = OrderedDict(), OrderedDict(), OrderedDict()
linmod = LinearModel()
rangeIMR = [1.15, 2.5]
nPtsMC = 1000 # number of MC points per data point
cRanges = map(Decimal, ['0.', '0.1'])
Expand Down Expand Up @@ -84,7 +88,7 @@ def gp_stack(version, energies, inclMed, inclFits):
) else np.loadtxt(open(file_url, 'rb'))
# fit IMR region with exp(-M/kT+C)
if (
inclFits and energies is None and
inclFits and energies is None and linmod is not None and
(data_type == 'data' or data_type == 'cocktail')
):
# data in IMR
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
@@ -1,5 +1,4 @@
numpy==1.9.2
http://sourceforge.net/projects/gnuplot-py/files/Gnuplot-py/1.8/gnuplot-py-1.8.tar.gz/download
Pint==0.5.1
PyModelFit==0.1.2
uncertainties==2.4.4
6 changes: 1 addition & 5 deletions setup.py
Expand Up @@ -17,11 +17,7 @@
dependency_links = [
'http://sourceforge.net/projects/gnuplot-py/files/Gnuplot-py/1.8/gnuplot-py-1.8.tar.gz/download'
],
setup_requires = [ 'numpy==1.9.2' ],
install_requires = [
'numpy==1.9.2', 'Pint==0.5.1',
'PyModelFit==0.1.2', 'uncertainties==2.4.4'
],
install_requires = [ 'numpy==1.9.2', 'Pint==0.5.1', 'uncertainties==2.4.4' ],
license = open('LICENSE').read(),
keywords = ['gnuplot', 'graph', 'plot', 'panel'],
)

0 comments on commit bfd2393

Please sign in to comment.