Skip to content

Commit

Permalink
Merge pull request #23 from jchodera/fix-conda-recipe
Browse files Browse the repository at this point in the history
Fix conda recipe
  • Loading branch information
jchodera committed May 6, 2015
2 parents 0f26483 + 579b0a0 commit 1a6cfbd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion bhmm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@

# other stuff
from bhmm.util import config
from bhmm.util import testsystems
from bhmm.util import testsystems
11 changes: 6 additions & 5 deletions bhmm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import numpy as _np

from bhmm.util import types as _types
from bhmm.hmm.generic_hmm import HMM as _HMM
from bhmm.estimators.maximum_likelihood import MaximumLikelihoodEstimator as _MaximumLikelihoodEstimator
from bhmm.estimators.bayesian_sampling import BayesianHMMSampler as _BHMM

def _guess_model_type(observations):
from bhmm.util import types as _types

o1 = _np.array(observations[0])

# CASE: vector of int? Then we want a discrete HMM
Expand Down Expand Up @@ -109,6 +106,7 @@ def gaussian_hmm(P, means, sigmas, pi=None, stationary=True, reversible=True):
# initialize output model
output_model = GaussianOutputModel(nstates, means, sigmas)
# initialize general HMM
from bhmm.hmm.generic_hmm import HMM as _HMM
ghmm = _HMM(P, output_model, Pi=pi, stationary=stationary, reversible=reversible)
# turn it into a Gaussian HMM
ghmm = GaussianHMM(ghmm)
Expand Down Expand Up @@ -136,6 +134,7 @@ def discrete_hmm(P, pout, pi=None, stationary=True, reversible=True):
# initialize output model
output_model = DiscreteOutputModel(pout)
# initialize general HMM
from bhmm.hmm.generic_hmm import HMM as _HMM
dhmm = _HMM(P, output_model, Pi=pi, stationary=stationary, reversible=reversible)
# turn it into a Gaussian HMM
dhmm = DiscreteHMM(dhmm)
Expand Down Expand Up @@ -191,6 +190,7 @@ def estimate_hmm(observations, nstates, lag=1, initial_model=None, type=None,
observations = _lag_observations(observations, lag)

# construct estimator
from bhmm.estimators.maximum_likelihood import MaximumLikelihoodEstimator as _MaximumLikelihoodEstimator
est = _MaximumLikelihoodEstimator(observations, nstates, initial_model=initial_model, type=type,
reversible=reversible, stationary=stationary, p=p, accuracy=accuracy, maxit=maxit)
# run
Expand Down Expand Up @@ -222,6 +222,7 @@ def bayesian_hmm(observations, estimated_hmm, nsample=100, store_hidden=False):
"""
# construct estimator
from bhmm.estimators.bayesian_sampling import BayesianHMMSampler as _BHMM
sampler = _BHMM(observations, estimated_hmm.nstates, initial_model=estimated_hmm,
reversible=estimated_hmm.is_reversible, transition_matrix_sampling_steps=1000,
type=estimated_hmm.output_model.model_type)
Expand Down
26 changes: 9 additions & 17 deletions devtools/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,24 @@ build:
requirements:
build:
- python
- setuptools
- cython
- numpy
- scipy
- setuptools
- docopt
- jinja2
- pyemma >=1.2
- scikit-learn
- matplotlib
- seaborn
- pyemma >=1.1.2
# - matplotlib
# - seaborn

run:
- python
- cython
- numpy
- scipy
- cython
- docopt
- pyyaml
- jinja2
- pyemma >=1.2
- scikit-learn
- matplotlib
- seaborn
- pyemma >=1.1.2
# - matplotlib
# - seaborn

test:
requires:
Expand All @@ -44,7 +39,4 @@ test:
about:
home: https://github.com/choderalab/bhmm
license: GNU Lesser General Public License v3 or later (LGPLv3+)




summary: Bayesian hidden Markov models for analysis of single-molecule trajectory data
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
DOCLINES = __doc__.split("\n")

########################
VERSION = "0.1.0"
VERSION = "0.2.0"
ISRELEASED = False
__version__ = VERSION
########################
Expand Down Expand Up @@ -136,6 +136,7 @@ def find_package_data(data_root, package_root):
include_dirs = [numpy.get_include()])]

write_version_py()

setup(
name='bhmm',
author='John Chodera and Frank Noe',
Expand All @@ -149,18 +150,16 @@ def find_package_data(data_root, package_root):
classifiers=CLASSIFIERS.splitlines(),
package_dir={'bhmm': 'bhmm'},
#packages=['bhmm', "bhmm.tests"] + ['bhmm.%s' % package for package in find_packages('bhmm')],
packages=['bhmm', 'bhmm.tests', 'bhmm.msm', 'bhmm.hidden', 'bhmm.init', 'bhmm.msm', 'bhmm.output_models', 'bhmm.output_models.impl_c', 'bhmm.util', 'bhmm.hidden.impl_python', 'bhmm.hidden.impl_c'],
packages=['bhmm', 'bhmm.tests', 'bhmm.hmm', 'bhmm.estimators', 'bhmm.msm', 'bhmm.hidden', 'bhmm.init', 'bhmm.msm', 'bhmm.output_models', 'bhmm.output_models.impl_c', 'bhmm.util', 'bhmm.hidden.impl_python', 'bhmm.hidden.impl_c'],
# + ['bhmm.%s' % package for package in find_packages('bhmm')],
package_data={'bhmm': find_package_data('examples', 'bhmm')}, # NOTE: examples installs to bhmm.egg/examples/, NOT bhmm.egg/bhmm/examples/. You need to do utils.get_data_filename("../examples/*/setup/").
package_data={'bhmm': find_package_data('examples', 'bhmm') + find_package_data('bhmm/tests/data', 'bhmm')}, # NOTE: examples installs to bhmm.egg/examples/, NOT bhmm.egg/bhmm/examples/. You need to do utils.get_data_filename("../examples/*/setup/").
zip_safe=False,
install_requires=[
'cython',
'numpy',
'scipy',
'pyemma>=1.2',
'scikit-learn',
'nose',
'docopt>=0.6.1',
],
ext_modules = cythonize(extensions)
)
Expand Down

0 comments on commit 1a6cfbd

Please sign in to comment.