├── setup.cfg ├── msmsandbox ├── __init__.py └── msmsandbox.py ├── MANIFEST.in ├── README.md ├── LICENSE ├── setup.yaml ├── .gitignore └── setup.py /setup.cfg: -------------------------------------------------------------------------------- 1 | [easy_install] 2 | 3 | -------------------------------------------------------------------------------- /msmsandbox/__init__.py: -------------------------------------------------------------------------------- 1 | from msmsandbox import * 2 | -------------------------------------------------------------------------------- /msmsandbox/msmsandbox.py: -------------------------------------------------------------------------------- 1 | def first_fnc(x): 2 | print(x) 3 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | # include visualization .css files 2 | graft openpathsampling 3 | include openpathsampling/resources/*.css -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # msm-theory-sandbox 2 | A playground for examples and tools to explore the theory of MSMs and related models. 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Markov model 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /setup.yaml: -------------------------------------------------------------------------------- 1 | name: msm-theory-sandbox 2 | version: 0.0.1 3 | 4 | authors: 5 | - Hao Wu 6 | - Feliks Nueske 7 | - Josh Fass 8 | - Jan-Hendrik Prinz 9 | - Fabian Paul 10 | - Frank Noe 11 | 12 | emails: 13 | - jan.prinz@gmx.de, 14 | - josh.fass@choderalab.org 15 | 16 | description: 'A collection of examples and tools for the exploration of MSM theory.' 17 | 18 | long_description: | 19 | A collection of examples and tools for the exploration of MSM theory. 20 | 21 | classifiers: | 22 | Development Status :: 3 - Alpha 23 | Intended Audience :: Science/Research 24 | Intended Audience :: Developers 25 | License :: OSI Approved :: GNU Lesser General 26 | Public License v2.1 or later (LGPLv2.1+) 27 | Programming Language :: C 28 | Programming Language :: Python 29 | Programming Language :: Python :: 2 30 | Topic :: Scientific/Engineering :: Bio-Informatics 31 | Topic :: Scientific/Engineering :: Chemistry 32 | Operating System :: Microsoft :: Windows 33 | Operating System :: POSIX 34 | Operating System :: Unix 35 | Operating System :: MacOS 36 | 37 | download_url: http://github.com/markovmodel/msm-theory-sandbox 38 | url: http://github.com/markovmodel/msm-theory-sandbox 39 | 40 | packages: 41 | - msmsandbox 42 | 43 | platforms: 44 | - Linux 45 | - Mac OS X 46 | - Windows 47 | 48 | released: false 49 | 50 | requires: 51 | - python 52 | - numpy 53 | - scipy 54 | - pandas 55 | - openmm 56 | - openmmtools 57 | - pymbar 58 | - docopt 59 | - pyyaml 60 | - mdtraj 61 | - svgwrite 62 | - matplotlib 63 | - ujson 64 | - pyemma 65 | - msmtools 66 | 67 | license: LGPL 2.1 or later 68 | license_file: LICENSE 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### PyCharm ### 4 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 5 | 6 | /*.iml 7 | *.nc 8 | 9 | ## Directory-based project format: 10 | .idea/ 11 | # if you remove the above rule, at least ignore the following: 12 | 13 | # User-specific stuff: 14 | # .idea/workspace.xml 15 | # .idea/tasks.xml 16 | # .idea/dictionaries 17 | 18 | # Sensitive or high-churn files: 19 | # .idea/dataSources.ids 20 | # .idea/dataSources.xml 21 | # .idea/sqlDataSources.xml 22 | # .idea/dynamic.xml 23 | # .idea/uiDesigner.xml 24 | 25 | # Gradle: 26 | # .idea/gradle.xml 27 | # .idea/libraries 28 | 29 | # Mongo Explorer plugin: 30 | # .idea/mongoSettings.xml 31 | 32 | ## File-based project format: 33 | *.ipr 34 | *.iws 35 | 36 | ## Plugin-specific files: 37 | 38 | # IntelliJ 39 | out/ 40 | 41 | # mpeltonen/sbt-idea plugin 42 | .idea_modules/ 43 | 44 | # JIRA plugin 45 | atlassian-ide-plugin.xml 46 | 47 | # Crashlytics plugin (for Android Studio and IntelliJ) 48 | com_crashlytics_export_strings.xml 49 | 50 | 51 | ### Python ### 52 | # Byte-compiled / optimized / DLL files 53 | __pycache__/ 54 | *.py[cod] 55 | 56 | # C extensions 57 | *.so 58 | 59 | # Distribution / packaging 60 | .Python 61 | env/ 62 | build/ 63 | develop-eggs/ 64 | dist/ 65 | downloads/ 66 | eggs/ 67 | lib/ 68 | lib64/ 69 | parts/ 70 | sdist/ 71 | var/ 72 | *.egg-info/ 73 | .installed.cfg 74 | *.egg 75 | 76 | # PyInstaller 77 | # Usually these files are written by a python script from a template 78 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 79 | *.manifest 80 | *.spec 81 | 82 | # Installer logs 83 | pip-log.txt 84 | pip-delete-this-directory.txt 85 | 86 | # Unit test / coverage reports 87 | htmlcov/ 88 | .tox/ 89 | .coverage 90 | .cache 91 | nosetests.xml 92 | coverage.xml 93 | 94 | # Translations 95 | *.mo 96 | *.pot 97 | 98 | # Django stuff: 99 | *.log 100 | 101 | # Sphinx documentation 102 | docs/_build/ 103 | 104 | # PyBuilder 105 | target/ 106 | 107 | # IPython 108 | .ipynb_checkpoints -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | import sys 3 | import os 4 | import subprocess 5 | 6 | # experimental yaml support to read the settings 7 | import yaml 8 | 9 | sys.path.insert(0, '.') 10 | 11 | 12 | def trunc_lines(s): 13 | parts = s.split('\n') 14 | while len(parts[0]) == 0: 15 | parts = parts[1:] 16 | 17 | while len(parts[-1]) == 0: 18 | parts = parts[:-1] 19 | 20 | parts = [part for part in parts if len(part) > 0] 21 | 22 | return ''.join(parts) 23 | 24 | 25 | # +----------------------------------------------------------------------------- 26 | # | GET GIT VERSION 27 | # +----------------------------------------------------------------------------- 28 | 29 | def get_git_version(): 30 | # Return the git revision as a string 31 | # copied from numpy setup.py 32 | def _minimal_ext_cmd(cmd): 33 | # construct minimal environment 34 | env = {} 35 | for k in ['SYSTEMROOT', 'PATH']: 36 | v = os.environ.get(k) 37 | if v is not None: 38 | env[k] = v 39 | 40 | # LANGUAGE is used on win32 41 | env['LANGUAGE'] = 'C' 42 | env['LANG'] = 'C' 43 | env['LC_ALL'] = 'C' 44 | output = subprocess.Popen( 45 | cmd, stdout=subprocess.PIPE, env=env).communicate()[0] 46 | return output 47 | 48 | try: 49 | out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) 50 | git_revision = out.strip().decode('ascii') 51 | except OSError: 52 | git_revision = 'Unknown' 53 | 54 | return git_revision 55 | 56 | 57 | # +----------------------------------------------------------------------------- 58 | # | WRITE version.py FILE 59 | # +----------------------------------------------------------------------------- 60 | 61 | def write_version_py( 62 | prefs, 63 | filename='msmsandbox/version.py', 64 | ): 65 | cnt = """ 66 | # This file is automatically generated by setup.py 67 | short_version = '%(version)s' 68 | version = '%(version)s' 69 | full_version = '%(full_version)s' 70 | git_revision = '%(git_revision)s' 71 | release = %(isrelease)s 72 | 73 | if not release: 74 | version = full_version 75 | """ 76 | 77 | # Adding the git rev number needs to be done inside write_version_py(), 78 | # otherwise the import of numpy.version messes up the build under Python 3. 79 | if os.path.exists('.git'): 80 | git_version = get_git_version() 81 | else: 82 | git_version = 'Unknown' 83 | 84 | full_version = prefs['version'] 85 | if not preferences['released']: 86 | full_version += '.dev-' + git_version[:7] 87 | 88 | print('writing version file at %s' % filename) 89 | 90 | a = open(filename, 'w') 91 | try: 92 | a.write(cnt % { 93 | 'version': prefs['version'], 94 | 'short_version': prefs['version'], 95 | 'full_version': full_version, 96 | 'git_revision': git_version, 97 | 'isrelease': str(prefs['released']) 98 | }) 99 | finally: 100 | a.close() 101 | 102 | 103 | # +----------------------------------------------------------------------------- 104 | # | CONSTRUCT PARAMETERS FOR setuptools 105 | # +----------------------------------------------------------------------------- 106 | 107 | def build_keyword_dictionary(prefs): 108 | keywords = {} 109 | 110 | for key in [ 111 | 'name', 'version', 'license', 'url', 'download_url', 'packages', 112 | 'package_dir', 'platforms', 'description', 'requires', 113 | 'long_description', 'package_data', 'include_package_data' 114 | ]: 115 | if key in prefs: 116 | keywords[key] = prefs[key] 117 | 118 | keywords['author'] = \ 119 | ', '.join(prefs['authors'][:-1]) + ' and ' + \ 120 | prefs['authors'][-1] 121 | 122 | keywords['author_email'] = \ 123 | ', '.join(prefs['emails']) 124 | 125 | keywords["package_dir"] = \ 126 | {package: '/'.join(package.split('.')) for package in prefs['packages']} 127 | 128 | keywords['long_description'] = \ 129 | trunc_lines(keywords['long_description']) 130 | 131 | output = "" 132 | first_tab = 40 133 | second_tab = 60 134 | for key in sorted(keywords): 135 | value = keywords[key] 136 | output += key.rjust(first_tab) + str(value).rjust(second_tab) + "" 137 | 138 | return keywords 139 | 140 | 141 | # load settings from setup.py, easier to maintain, but not fully supported yet 142 | with open('setup.yaml') as f: 143 | yaml_string = ''.join(f.readlines()) 144 | preferences = yaml.load(yaml_string) 145 | 146 | setup_keywords = build_keyword_dictionary(preferences) 147 | 148 | 149 | def main(): 150 | write_version_py(preferences) 151 | setup(**setup_keywords) 152 | pass 153 | 154 | 155 | if __name__ == '__main__': 156 | main() 157 | --------------------------------------------------------------------------------