westpa 2022.13__cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.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.
- westpa/__init__.py +14 -0
- westpa/_version.py +21 -0
- westpa/analysis/__init__.py +5 -0
- westpa/analysis/core.py +749 -0
- westpa/analysis/statistics.py +27 -0
- westpa/analysis/trajectories.py +369 -0
- westpa/cli/__init__.py +0 -0
- westpa/cli/core/__init__.py +0 -0
- westpa/cli/core/w_fork.py +152 -0
- westpa/cli/core/w_init.py +230 -0
- westpa/cli/core/w_run.py +77 -0
- westpa/cli/core/w_states.py +212 -0
- westpa/cli/core/w_succ.py +99 -0
- westpa/cli/core/w_truncate.py +68 -0
- westpa/cli/tools/__init__.py +0 -0
- westpa/cli/tools/ploterr.py +506 -0
- westpa/cli/tools/plothist.py +706 -0
- westpa/cli/tools/w_assign.py +597 -0
- westpa/cli/tools/w_bins.py +166 -0
- westpa/cli/tools/w_crawl.py +119 -0
- westpa/cli/tools/w_direct.py +557 -0
- westpa/cli/tools/w_dumpsegs.py +94 -0
- westpa/cli/tools/w_eddist.py +506 -0
- westpa/cli/tools/w_fluxanl.py +376 -0
- westpa/cli/tools/w_ipa.py +832 -0
- westpa/cli/tools/w_kinavg.py +127 -0
- westpa/cli/tools/w_kinetics.py +96 -0
- westpa/cli/tools/w_multi_west.py +414 -0
- westpa/cli/tools/w_ntop.py +213 -0
- westpa/cli/tools/w_pdist.py +515 -0
- westpa/cli/tools/w_postanalysis_matrix.py +82 -0
- westpa/cli/tools/w_postanalysis_reweight.py +53 -0
- westpa/cli/tools/w_red.py +491 -0
- westpa/cli/tools/w_reweight.py +780 -0
- westpa/cli/tools/w_select.py +226 -0
- westpa/cli/tools/w_stateprobs.py +111 -0
- westpa/cli/tools/w_timings.py +113 -0
- westpa/cli/tools/w_trace.py +599 -0
- westpa/core/__init__.py +0 -0
- westpa/core/_rc.py +673 -0
- westpa/core/binning/__init__.py +55 -0
- westpa/core/binning/_assign.c +36018 -0
- westpa/core/binning/_assign.cpython-312-aarch64-linux-gnu.so +0 -0
- westpa/core/binning/_assign.pyx +370 -0
- westpa/core/binning/assign.py +454 -0
- westpa/core/binning/binless.py +96 -0
- westpa/core/binning/binless_driver.py +54 -0
- westpa/core/binning/binless_manager.py +189 -0
- westpa/core/binning/bins.py +47 -0
- westpa/core/binning/mab.py +506 -0
- westpa/core/binning/mab_driver.py +54 -0
- westpa/core/binning/mab_manager.py +197 -0
- westpa/core/data_manager.py +1761 -0
- westpa/core/extloader.py +74 -0
- westpa/core/h5io.py +1079 -0
- westpa/core/kinetics/__init__.py +24 -0
- westpa/core/kinetics/_kinetics.c +45174 -0
- westpa/core/kinetics/_kinetics.cpython-312-aarch64-linux-gnu.so +0 -0
- westpa/core/kinetics/_kinetics.pyx +815 -0
- westpa/core/kinetics/events.py +147 -0
- westpa/core/kinetics/matrates.py +156 -0
- westpa/core/kinetics/rate_averaging.py +266 -0
- westpa/core/progress.py +218 -0
- westpa/core/propagators/__init__.py +54 -0
- westpa/core/propagators/executable.py +592 -0
- westpa/core/propagators/loaders.py +196 -0
- westpa/core/reweight/__init__.py +14 -0
- westpa/core/reweight/_reweight.c +36899 -0
- westpa/core/reweight/_reweight.cpython-312-aarch64-linux-gnu.so +0 -0
- westpa/core/reweight/_reweight.pyx +439 -0
- westpa/core/reweight/matrix.py +126 -0
- westpa/core/segment.py +119 -0
- westpa/core/sim_manager.py +839 -0
- westpa/core/states.py +359 -0
- westpa/core/systems.py +93 -0
- westpa/core/textio.py +74 -0
- westpa/core/trajectory.py +603 -0
- westpa/core/we_driver.py +910 -0
- westpa/core/wm_ops.py +43 -0
- westpa/core/yamlcfg.py +298 -0
- westpa/fasthist/__init__.py +34 -0
- westpa/fasthist/_fasthist.c +38755 -0
- westpa/fasthist/_fasthist.cpython-312-aarch64-linux-gnu.so +0 -0
- westpa/fasthist/_fasthist.pyx +222 -0
- westpa/mclib/__init__.py +271 -0
- westpa/mclib/__main__.py +28 -0
- westpa/mclib/_mclib.c +34610 -0
- westpa/mclib/_mclib.cpython-312-aarch64-linux-gnu.so +0 -0
- westpa/mclib/_mclib.pyx +226 -0
- westpa/oldtools/__init__.py +4 -0
- westpa/oldtools/aframe/__init__.py +35 -0
- westpa/oldtools/aframe/atool.py +75 -0
- westpa/oldtools/aframe/base_mixin.py +26 -0
- westpa/oldtools/aframe/binning.py +178 -0
- westpa/oldtools/aframe/data_reader.py +560 -0
- westpa/oldtools/aframe/iter_range.py +200 -0
- westpa/oldtools/aframe/kinetics.py +117 -0
- westpa/oldtools/aframe/mcbs.py +153 -0
- westpa/oldtools/aframe/output.py +39 -0
- westpa/oldtools/aframe/plotting.py +88 -0
- westpa/oldtools/aframe/trajwalker.py +126 -0
- westpa/oldtools/aframe/transitions.py +469 -0
- westpa/oldtools/cmds/__init__.py +0 -0
- westpa/oldtools/cmds/w_ttimes.py +361 -0
- westpa/oldtools/files.py +34 -0
- westpa/oldtools/miscfn.py +23 -0
- westpa/oldtools/stats/__init__.py +4 -0
- westpa/oldtools/stats/accumulator.py +35 -0
- westpa/oldtools/stats/edfs.py +129 -0
- westpa/oldtools/stats/mcbs.py +96 -0
- westpa/tools/__init__.py +33 -0
- westpa/tools/binning.py +472 -0
- westpa/tools/core.py +340 -0
- westpa/tools/data_reader.py +159 -0
- westpa/tools/dtypes.py +31 -0
- westpa/tools/iter_range.py +198 -0
- westpa/tools/kinetics_tool.py +343 -0
- westpa/tools/plot.py +283 -0
- westpa/tools/progress.py +17 -0
- westpa/tools/selected_segs.py +154 -0
- westpa/tools/wipi.py +751 -0
- westpa/trajtree/__init__.py +4 -0
- westpa/trajtree/_trajtree.c +17829 -0
- westpa/trajtree/_trajtree.cpython-312-aarch64-linux-gnu.so +0 -0
- westpa/trajtree/_trajtree.pyx +130 -0
- westpa/trajtree/trajtree.py +117 -0
- westpa/westext/__init__.py +0 -0
- westpa/westext/adaptvoronoi/__init__.py +3 -0
- westpa/westext/adaptvoronoi/adaptVor_driver.py +214 -0
- westpa/westext/hamsm_restarting/__init__.py +3 -0
- westpa/westext/hamsm_restarting/example_overrides.py +35 -0
- westpa/westext/hamsm_restarting/restart_driver.py +1165 -0
- westpa/westext/stringmethod/__init__.py +11 -0
- westpa/westext/stringmethod/fourier_fitting.py +69 -0
- westpa/westext/stringmethod/string_driver.py +253 -0
- westpa/westext/stringmethod/string_method.py +306 -0
- westpa/westext/weed/BinCluster.py +180 -0
- westpa/westext/weed/ProbAdjustEquil.py +100 -0
- westpa/westext/weed/UncertMath.py +247 -0
- westpa/westext/weed/__init__.py +10 -0
- westpa/westext/weed/weed_driver.py +192 -0
- westpa/westext/wess/ProbAdjust.py +101 -0
- westpa/westext/wess/__init__.py +6 -0
- westpa/westext/wess/wess_driver.py +217 -0
- westpa/work_managers/__init__.py +57 -0
- westpa/work_managers/core.py +396 -0
- westpa/work_managers/environment.py +134 -0
- westpa/work_managers/mpi.py +318 -0
- westpa/work_managers/processes.py +201 -0
- westpa/work_managers/serial.py +28 -0
- westpa/work_managers/threads.py +79 -0
- westpa/work_managers/zeromq/__init__.py +20 -0
- westpa/work_managers/zeromq/core.py +635 -0
- westpa/work_managers/zeromq/node.py +131 -0
- westpa/work_managers/zeromq/work_manager.py +526 -0
- westpa/work_managers/zeromq/worker.py +320 -0
- westpa-2022.13.dist-info/METADATA +179 -0
- westpa-2022.13.dist-info/RECORD +162 -0
- westpa-2022.13.dist-info/WHEEL +7 -0
- westpa-2022.13.dist-info/entry_points.txt +30 -0
- westpa-2022.13.dist-info/licenses/LICENSE +21 -0
- westpa-2022.13.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import numpy as np
|
|
3
|
+
import pickle
|
|
4
|
+
import tarfile
|
|
5
|
+
from io import BytesIO
|
|
6
|
+
|
|
7
|
+
import westpa
|
|
8
|
+
from westpa.core.trajectory import load_mdtraj, load_netcdf, load_mdanalysis
|
|
9
|
+
from westpa.core.h5io import safe_extract
|
|
10
|
+
|
|
11
|
+
log = logging.getLogger(__name__)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def pcoord_loader(fieldname, pcoord_return_filename, destobj, single_point):
|
|
15
|
+
"""Read progress coordinate data into the ``pcoord`` field on ``destobj``.
|
|
16
|
+
An exception will be raised if the data is malformed. If ``single_point`` is true,
|
|
17
|
+
then only one (N-dimensional) point will be read, otherwise system.pcoord_len points
|
|
18
|
+
will be read.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
system = westpa.rc.get_system_driver()
|
|
22
|
+
|
|
23
|
+
assert fieldname == 'pcoord'
|
|
24
|
+
|
|
25
|
+
pcoord = np.loadtxt(pcoord_return_filename, dtype=system.pcoord_dtype)
|
|
26
|
+
|
|
27
|
+
if single_point:
|
|
28
|
+
expected_shape = (system.pcoord_ndim,)
|
|
29
|
+
if pcoord.ndim == 0:
|
|
30
|
+
pcoord.shape = (1,)
|
|
31
|
+
else:
|
|
32
|
+
expected_shape = (system.pcoord_len, system.pcoord_ndim)
|
|
33
|
+
if pcoord.ndim < 2:
|
|
34
|
+
pcoord.shape = expected_shape
|
|
35
|
+
if pcoord.shape != expected_shape:
|
|
36
|
+
raise ValueError(
|
|
37
|
+
'progress coordinate data has incorrect shape {!r} [expected {!r}] Check pcoord.err or seg_logs for more '
|
|
38
|
+
'information.'.format(pcoord.shape, expected_shape)
|
|
39
|
+
)
|
|
40
|
+
destobj.pcoord = pcoord
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def aux_data_loader(fieldname, data_filename, segment, single_point):
|
|
44
|
+
data = np.loadtxt(data_filename)
|
|
45
|
+
segment.data[fieldname] = data
|
|
46
|
+
if data.nbytes == 0:
|
|
47
|
+
raise ValueError('could not read any data for {}'.format(fieldname))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def numpy_data_loader(fieldname, coord_file, segment, single_point):
|
|
51
|
+
log.debug('using numpy_data_loader')
|
|
52
|
+
data = np.load(coord_file, allow_pickle=True)
|
|
53
|
+
segment.data[fieldname] = data
|
|
54
|
+
if data.nbytes == 0:
|
|
55
|
+
raise ValueError('could not read any data for {}'.format(fieldname))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def pickle_data_loader(fieldname, coord_file, segment, single_point):
|
|
59
|
+
log.debug('using pickle_data_loader')
|
|
60
|
+
with open(coord_file, 'rb') as fo:
|
|
61
|
+
data = pickle.load(fo)
|
|
62
|
+
segment.data[fieldname] = data
|
|
63
|
+
if data.nbytes == 0:
|
|
64
|
+
raise ValueError('could not read any data for {}'.format(fieldname))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def mdtraj_trajectory_loader(fieldname, coord_folder, segment, single_point):
|
|
68
|
+
'''Load data from the trajectory return using MDTraj. ``coord_folder`` should be the path to a folder
|
|
69
|
+
containing trajectory files. ``segment`` is the ``Segment`` object that the data is associated with.
|
|
70
|
+
Please see ``load_mdtraj`` for more details. ``single_point`` is not used by this loader.'''
|
|
71
|
+
try:
|
|
72
|
+
data = load_mdtraj(coord_folder)
|
|
73
|
+
segment.data['iterh5/trajectory'] = data
|
|
74
|
+
except Exception as e:
|
|
75
|
+
log.warning('could not read any {} data for HDF5 Framework: {}'.format(fieldname, str(e)))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def netcdf_trajectory_loader(fieldname, coord_folder, segment, single_point):
|
|
79
|
+
'''Load Amber .nc data from the trajectory return. ``coord_folder`` should be the path to a folder
|
|
80
|
+
containing trajectory files. ``segment`` is the ``Segment`` object that the data is associated with.
|
|
81
|
+
Please see ``load_netcdf`` for more details. ``single_point`` is not used by this loader.'''
|
|
82
|
+
try:
|
|
83
|
+
data = load_netcdf(coord_folder)
|
|
84
|
+
segment.data['iterh5/trajectory'] = data
|
|
85
|
+
except Exception as e:
|
|
86
|
+
log.warning('Falling back to default loader for {}: {}'.format(fieldname, str(e)))
|
|
87
|
+
mdtraj_trajectory_loader(fieldname, coord_folder, segment, single_point)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def mdanalysis_trajectory_loader(fieldname, coord_folder, segment, single_point):
|
|
91
|
+
'''Load data from the trajectory return. ``coord_folder`` should be the path to a folder
|
|
92
|
+
containing trajectory files. ``segment`` is the ``Segment`` object that the data is associated with.
|
|
93
|
+
Please see ``load_mdanalysis`` for more details. ``single_point`` is not used by this loader.'''
|
|
94
|
+
try:
|
|
95
|
+
data = load_mdanalysis(coord_folder)
|
|
96
|
+
segment.data['iterh5/trajectory'] = data
|
|
97
|
+
except Exception as e:
|
|
98
|
+
log.warning('Falling back to default loader for {}: {}'.format(fieldname, str(e)))
|
|
99
|
+
mdtraj_trajectory_loader(fieldname, coord_folder, segment, single_point)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def restart_loader(fieldname, restart_folder, segment, single_point):
|
|
103
|
+
'''Load data from the restart return. The loader will tar all files in ``restart_folder``
|
|
104
|
+
and store it in the per-iteration HDF5 file. ``segment`` is the ``Segment`` object that
|
|
105
|
+
the data is associated with. ``single_point`` is not used by this loader.'''
|
|
106
|
+
try:
|
|
107
|
+
with BytesIO() as d:
|
|
108
|
+
with tarfile.open(mode='w:gz', fileobj=d) as t:
|
|
109
|
+
t.add(restart_folder, arcname='.')
|
|
110
|
+
|
|
111
|
+
segment.data['iterh5/restart'] = d.getvalue() + b'\x01' # add tail protection
|
|
112
|
+
except Exception as e:
|
|
113
|
+
log.warning('could not read any {} data for HDF5 Framework: {}'.format(fieldname, str(e)))
|
|
114
|
+
finally:
|
|
115
|
+
d.close()
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def restart_writer(path, segment):
|
|
119
|
+
'''Prepare the necessary files from the per-iteration HDF5 file to run ``segment``.'''
|
|
120
|
+
try:
|
|
121
|
+
restart = segment.data.pop('iterh5/restart', None)
|
|
122
|
+
# Making an exception for start states in iteration 1
|
|
123
|
+
if restart is None:
|
|
124
|
+
raise ValueError('restart data is not present')
|
|
125
|
+
|
|
126
|
+
with BytesIO(restart[:-1]) as d: # remove tail protection
|
|
127
|
+
with tarfile.open(fileobj=d, mode='r:gz') as t:
|
|
128
|
+
safe_extract(t, path=path)
|
|
129
|
+
except ValueError as e:
|
|
130
|
+
log.warning('could not write HDF5 Framework restart data for {}: {}'.format(str(segment), str(e)))
|
|
131
|
+
if segment.n_iter == 1:
|
|
132
|
+
log.warning(
|
|
133
|
+
'In iteration 1. Assuming this is a start state and proceeding to skip reading restart from per-iteration HDF5 file for {}'.format(
|
|
134
|
+
str(segment)
|
|
135
|
+
)
|
|
136
|
+
)
|
|
137
|
+
except Exception as e:
|
|
138
|
+
log.warning('could not write HDF5 Framework restart data for {}: {}'.format(str(segment), str(e)))
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def seglog_loader(fieldname, log_file, segment, single_point):
|
|
142
|
+
'''Load data from the log return. The loader will tar all files in ``log_file``
|
|
143
|
+
and store it in the per-iteration HDF5 file. ``segment`` is the ``Segment`` object that
|
|
144
|
+
the data is associated with. ``single_point`` is not used by this loader.'''
|
|
145
|
+
try:
|
|
146
|
+
with BytesIO() as d:
|
|
147
|
+
with tarfile.open(mode='w:gz', fileobj=d) as t:
|
|
148
|
+
t.add(log_file, arcname='seg.log')
|
|
149
|
+
|
|
150
|
+
segment.data['iterh5/log'] = d.getvalue() + b'\x01' # add tail protection
|
|
151
|
+
except Exception as e:
|
|
152
|
+
log.warning('could not read any data for {}: {}'.format(fieldname, str(e)))
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def seglog_writer(path, segment):
|
|
156
|
+
'''Untar the log file from segment.'''
|
|
157
|
+
try:
|
|
158
|
+
seglog = segment.data.pop('iterh5/log', None)
|
|
159
|
+
|
|
160
|
+
# Raising an exception for start states in iteration 1
|
|
161
|
+
if seglog is None:
|
|
162
|
+
raise ValueError('Log file is not present for segment: {}'.format(str(segment)))
|
|
163
|
+
|
|
164
|
+
with BytesIO(seglog[:-1]) as d: # remove tail protection
|
|
165
|
+
with tarfile.open(fileobj=d, mode='r:gz') as t:
|
|
166
|
+
safe_extract(t, path=path)
|
|
167
|
+
except Exception as e:
|
|
168
|
+
log.warning('could not extract HDF5 Framework log file for {}: {}'.format(str(segment), str(e)))
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
# Dictionary with all the possible aux dataset loaders
|
|
172
|
+
data_loaders = {
|
|
173
|
+
'default': aux_data_loader,
|
|
174
|
+
'auxdata_loader': aux_data_loader,
|
|
175
|
+
'aux_data_loader': aux_data_loader,
|
|
176
|
+
'numpy_loader': numpy_data_loader,
|
|
177
|
+
'npy_loader': numpy_data_loader,
|
|
178
|
+
'numpy_data_loader': numpy_data_loader,
|
|
179
|
+
'npy_data_loader': numpy_data_loader,
|
|
180
|
+
'pickle_loader': pickle_data_loader,
|
|
181
|
+
'pickle_data_loader': pickle_data_loader,
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
# Dictionary with all the possible trajectory loaders
|
|
186
|
+
trajectory_loaders = {
|
|
187
|
+
'default': mdtraj_trajectory_loader,
|
|
188
|
+
'trajectory_loader': mdtraj_trajectory_loader,
|
|
189
|
+
'MDTraj_trajectory_loader': mdtraj_trajectory_loader,
|
|
190
|
+
'mdtraj_trajectory_loader': mdtraj_trajectory_loader,
|
|
191
|
+
'amber_trajectory_loader': netcdf_trajectory_loader,
|
|
192
|
+
'netcdf_trajectory_loader': netcdf_trajectory_loader,
|
|
193
|
+
'mda_trajectory_loader': mdanalysis_trajectory_loader,
|
|
194
|
+
'MDAnalysis_trajectory_loader': mdanalysis_trajectory_loader,
|
|
195
|
+
'mdanalysis_trajectory_loader': mdanalysis_trajectory_loader,
|
|
196
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Function(s) for the postanalysis toolkit
|
|
3
|
+
'''
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
|
|
7
|
+
from . import _reweight
|
|
8
|
+
from ._reweight import stats_process, reweight_for_c
|
|
9
|
+
from .matrix import FluxMatrix
|
|
10
|
+
|
|
11
|
+
__all__ = ['_reweight', 'stats_process', 'reweight_for_c', 'FluxMatrix']
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
log = logging.getLogger(__name__)
|