asyncmd 0.3.3__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,194 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: asyncmd
3
- Version: 0.3.3
4
- Summary: asyncmd is a library to write concurrent code to run and analyze molecular dynamics simulations using pythons async/await synthax.
5
- Author-email: Hendrik Jung <hendrik.jung@biophys.mpg.de>
6
- Maintainer-email: Hendrik Jung <hendrik.jung@biophys.mpg.de>
7
- Project-URL: Repository, https://github.com/bio-phys/asyncmd.git
8
- Project-URL: Issues, https://github.com/bio-phys/asyncmd/issues
9
- Keywords: molecular dynamics,molecular-dynamics,MD,high performance computing,HPC,slurm,SLURM,gromacs,GROMACS
10
- Classifier: Development Status :: 4 - Beta
11
- Classifier: Intended Audience :: Science/Research
12
- Classifier: Natural Language :: English
13
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
14
- Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Topic :: Scientific/Engineering
18
- Classifier: Topic :: Scientific/Engineering :: Chemistry
19
- Classifier: Topic :: Scientific/Engineering :: Physics
20
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
- Requires-Python: >=3.10
22
- Description-Content-Type: text/markdown
23
- License-File: LICENSE
24
- Requires-Dist: aiofiles
25
- Requires-Dist: mdanalysis
26
- Requires-Dist: numpy
27
- Requires-Dist: scipy
28
- Provides-Extra: docs
29
- Requires-Dist: sphinx; extra == "docs"
30
- Provides-Extra: tests
31
- Requires-Dist: pytest; extra == "tests"
32
- Requires-Dist: pytest-asyncio; extra == "tests"
33
- Provides-Extra: tests-all
34
- Requires-Dist: asyncmd[tests]; extra == "tests-all"
35
- Requires-Dist: h5py; extra == "tests-all"
36
- Requires-Dist: coverage; extra == "tests-all"
37
- Requires-Dist: pytest-cov; extra == "tests-all"
38
- Provides-Extra: dev
39
- Requires-Dist: asyncmd[docs,tests-all]; extra == "dev"
40
- Dynamic: license-file
41
-
42
- # asyncmd
43
-
44
- ## Synopsis
45
-
46
- asyncmd is a library to write **concurrent** code to run and analyze molecular dynamics simulations using pythons **async/await** synthax.
47
-
48
- ## Motivation
49
-
50
- Molecular dynamics simulations are fun and we can learn a lot about the simulated system. Running many molecular dynamics simulations of the same system concurrently is tedious, error-prone and boring but we can learn even more about the simulated system and are more efficient in doing so.
51
- This library addresses the tedious, error-prone and boring part of setting up many similar simulations, but it leaves you with the fun part of understanding the simulated system.
52
-
53
- ## Code Example
54
-
55
- Run `N` [GROMACS] engines concurently from configurations randomly picked up along a trajectory (`traj.trr`) for `n_steps` integration steps each, drawing random Maxwell-Boltzmann velocities for each configuration on the way. Finally turn the python function `func` (which acts on `Trajectory` objects) into an asyncronous and cached function by wrapping it and apply it on all generated trajectories concurrently:
56
-
57
- ```python
58
- import asyncio
59
- import numpy as np
60
- import asyncmd
61
- import asyncmd.gromacs as asyncgmx
62
-
63
- in_traj = asyncmd.Trajectory(trajectory_files="traj.trr", structure_file="conf.gro")
64
- # get a random number generator and draw N random frames (with replacement)
65
- rng = np.default_rng()
66
- frame_idxs = rng.choice(len(in_traj), size=N)
67
- # use the RandomVelocitiesFrameExtractor to directly get the frames with MB-vels
68
- extractor = asyncmd.trajectory.convert.RandomVelocitiesFrameExtractor(T=303)
69
- mdps = [asyncgmx.MDP("config.mdp") for _ in range(N)]
70
- # MDConfig objects (like MDP) behave like dictionaries and are easy to modify
71
- for i, mdp in enumerate(mdps):
72
- # here we just modify the output frequency for every engine separately
73
- # but you can set any mdp option like this
74
- # Note how the values are in the correct types? I.e. that they are ints?
75
- mdp["nstxout"] *= (i + 1)
76
- mdp["nstvout"] *= (i + 1)
77
- # create N gromacs engines
78
- engines = [asyncgmx.GmxEngine(mdp=mdp, gro_file="conf.gro", top_file="topol.top",
79
- # optional (can be omited or None), however naturally without an index file
80
- # you can not reference custom groups in the .mdp-file or MDP object
81
- ndx_file="index.ndx",
82
- )
83
- for mdp in mdps]
84
- # extract starting configurations with MB-vels and save them to current directory
85
- start_confs = await asyncio.gather(*(extractor.extract_async(
86
- outfile=f"start_conf{i}.trr",
87
- traj_in=in_traj, idx=idx)
88
- for i, idx in enumerate(frame_idxs)))
89
- # prepare the MD (for gromacs this is essentially a `grompp` call)
90
- await asyncio.gather(*(e.prepare(starting_configuration=conf,
91
- workdir=".", deffnm=f"engine{i}")
92
- for i, (conf, e) in enumerate(zip(start_confs, engines))
93
- )
94
- )
95
- # and run the molecular dynamics
96
- out_trajs = await asyncio.gather(*(e.run_steps(nsteps=n_steps) for e in engines))
97
- # wrapp `func` and apply it on all output trajectories concurrently
98
- wrapped_func = asyncmd.trajectory.PyTrajectoryFunctionWrapper(function=func)
99
- cv_vals = await asyncio.gather(*(wrapped_func(traj) for traj in out_trajs))
100
- ```
101
-
102
- Note that running via the [SLURM] queueing system is as easy as replacing the `GmxEngine` with a `SlurmGmxEngine` and the `PyTrajectoryFunctionWrapper` with a `SlurmTrajectoryFunctionWrapper` (and suppling them both with sbatch script skeletons).
103
-
104
- For an in-depth introduction see also the `examples` folder in this repository which contains jupyter notebooks on various topics.
105
-
106
- ## Installation
107
-
108
- ### pip install from PyPi
109
-
110
- asyncmd is published on [PyPi] (since v0.3.2), installing is as easy as:
111
-
112
- ```bash
113
- pip install asyncmd
114
- ```
115
-
116
- ### pip install directly from the repository
117
-
118
- Please note that you need to have [git-lfs] (an open source git extension) setup to get all input files needed to run the notebooks in the `examples` folder. However, no [git-lfs] is needed to get a working version of the library.
119
-
120
- ```bash
121
- git clone https://github.com/bio-phys/asyncmd.git
122
- cd asyncmd
123
- pip install .
124
- ```
125
-
126
- ## Documentation and API Reference
127
-
128
- The documentation can be build with [sphinx], use e.g. the following to build it in html format:
129
-
130
- ```bash
131
- cd asyncmd # Need to be at the top folder of the repository for the next line to work
132
- sphinx-build -b html docs/source docs/build/html
133
- ```
134
-
135
- Use ```pip install .\[docs\]``` to install the requirements needed to build the documentation.
136
-
137
- ## Tests
138
-
139
- Tests use [pytest]. To run them just install asycmd with the test requirements
140
-
141
- ```bash
142
- git clone https://github.com/bio-phys/asyncmd.git
143
- cd asyncmd
144
- pip install .\[tests\]
145
- # or use
146
- pip install .\[tests-all\]
147
- # to also install optional dependencies needed to run all tests
148
- ```
149
-
150
- And then run the tests (against the installed version) as
151
-
152
- ```bash
153
- pytest
154
- ```
155
-
156
- ## Contribute
157
-
158
- If you discover any issues or want to propose a new feature please feel free to open an [issue](https://github.com/bio-phys/asyncmd/issues) or a [pull request](https://github.com/bio-phys/asyncmd/pulls)!
159
-
160
- ### Developer install
161
-
162
- For the developer install I recommend:
163
-
164
- ```bash
165
- git clone https://github.com/bio-phys/asyncmd.git
166
- cd asyncmd
167
- pip install -e .\[dev\]
168
- ```
169
-
170
- This will in addition to the requirements to run the tests and to build the documentation install [coverage] and its [pytest-cov] plugin such that you have an idea of the test coverage for your newly added code. To get a nice html coverage report you can run the tests as
171
-
172
- ```bash
173
- pytest --cov=asyncmd --cov-report=html
174
- ```
175
-
176
- ### Contributors
177
-
178
- This project was originally conceived and started by Hendrik Jung in 2021/2022. For more check the `pyproject.toml` file. When you contribute code dont forget to add your name there to claim the credit for your work!
179
-
180
- ## License
181
-
182
- asyncmd is under the terms of the GNU general public license version 3 or later, i.e. SPDX identifier "GPL-3.0-or-later".
183
-
184
- ---
185
- <sub>This README.md is printed from 100% recycled electrons.</sub>
186
-
187
- [coverage]: https://pypi.org/project/coverage/
188
- [git-lfs]: https://git-lfs.com/
189
- [GROMACS]: https://www.gromacs.org/
190
- [PyPi]: https://pypi.org/project/asyncmd/
191
- [pytest]: https://docs.pytest.org/en/latest/
192
- [pytest-cov]: https://pypi.org/project/pytest-cov/
193
- [SLURM]: https://slurm.schedmd.com/documentation.html
194
- [sphinx]: https://www.sphinx-doc.org/en/master/index.html
@@ -1,23 +0,0 @@
1
- asyncmd/__init__.py,sha256=0xkOmcT5JP7emeGl9ixPSPsdHylHtiWqvZGnzDC2GqM,768
2
- asyncmd/_config.py,sha256=PpPYgsZyPmC5uybMc0pdAMj_6jUcm8AfME1hAvYy3DE,1140
3
- asyncmd/_version.py,sha256=14Lpt2lrPMrGonuCi12MdigFAFaEhXYlip7X18BJQwc,2981
4
- asyncmd/config.py,sha256=Jf_XTvXPkWdefuB9xVfCUzW4Fe3zGaUB-ZifC-oZ-yQ,7701
5
- asyncmd/mdconfig.py,sha256=rV1eaYakFnxP8aG4_86M1uv3vtFqvLwpd7YbN3bSSQc,17482
6
- asyncmd/mdengine.py,sha256=PPWphMBSkIoinbUpLHxbEn1yI02VHrCHGKzJlSOhYq4,4127
7
- asyncmd/slurm.py,sha256=fHXb3B4MR8c6J97T-X_t6p-4BnWG4kANfGu8HqhmPCA,60851
8
- asyncmd/tools.py,sha256=JS4Cn2Elm6miJmPf88ZDTaUIIFqb9bhHLlZKmJOOpC0,2554
9
- asyncmd/utils.py,sha256=cVWgZlAa3I4eE3EacIfz82HIBznldqoxyUZ7M36hMXs,5331
10
- asyncmd/gromacs/__init__.py,sha256=Rp_FQq_ftynX1561oD1X2Rby3Y4EBtXkgNgqa4jQk2o,726
11
- asyncmd/gromacs/mdconfig.py,sha256=6odhq8-xw6DRwQmiZIWCt5TwheyiC_7v5iUinG2T7J8,18225
12
- asyncmd/gromacs/mdengine.py,sha256=rV5-ugbaWtmDXiNHEq8dWlpBybMwE8zWESeikal2lHU,54276
13
- asyncmd/gromacs/utils.py,sha256=nmpP1ZS9sYPnrJGTVam6uDBb3CjKn-s0Nn3666ynnCo,6718
14
- asyncmd/trajectory/__init__.py,sha256=m2mP6YxMpXTpU_NQ-wID4UVEgZd7e0mkSaCCLLeo75Q,1195
15
- asyncmd/trajectory/convert.py,sha256=3DYpt7w_AIryShT59dTPM1s9s7ND3AMqgF5z8pfUViM,26036
16
- asyncmd/trajectory/functionwrapper.py,sha256=_atGGe2Dwu_EkyC6eNkONbc0KCDLegw0GqHfoc5MGLs,25788
17
- asyncmd/trajectory/propagate.py,sha256=LvO3vj9JHv5EiZkuNB9PTLpHuS6qy3nzZTxge5byW20,45344
18
- asyncmd/trajectory/trajectory.py,sha256=TouClq90m__q2qkBNNCZP2p59zWeqDa5TykdUpk7WPE,50700
19
- asyncmd-0.3.3.dist-info/licenses/LICENSE,sha256=tqi_Y64slbCqJW7ndGgNe9GPIfRX2nVGb3YQs7FqzE4,34670
20
- asyncmd-0.3.3.dist-info/METADATA,sha256=tQ0wPLn1GTRMOysb9cUQznSHeWCMQywbGB2aKerJmAo,8389
21
- asyncmd-0.3.3.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
22
- asyncmd-0.3.3.dist-info/top_level.txt,sha256=YG6cpLOyBjjelv7a8p2xYEHNVBgXSW8PvM8-9S9hMb8,8
23
- asyncmd-0.3.3.dist-info/RECORD,,