diff --git a/bhmm/__init__.py b/bhmm/__init__.py index 80af677..f17452a 100644 --- a/bhmm/__init__.py +++ b/bhmm/__init__.py @@ -30,4 +30,4 @@ # other stuff from bhmm.util import config -from bhmm.util import testsystems \ No newline at end of file +from bhmm.util import testsystems diff --git a/bhmm/api.py b/bhmm/api.py index de48019..b0a5a4a 100644 --- a/bhmm/api.py +++ b/bhmm/api.py @@ -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 @@ -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) @@ -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) @@ -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 @@ -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) diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index c276c18..187194c 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -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: @@ -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 diff --git a/setup.py b/setup.py index 4ac05f8..8995369 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ DOCLINES = __doc__.split("\n") ######################## -VERSION = "0.1.0" +VERSION = "0.2.0" ISRELEASED = False __version__ = VERSION ######################## @@ -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', @@ -149,9 +150,9 @@ 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', @@ -159,8 +160,6 @@ def find_package_data(data_root, package_root): 'scipy', 'pyemma>=1.2', 'scikit-learn', - 'nose', - 'docopt>=0.6.1', ], ext_modules = cythonize(extensions) )