westpa 2022.5__cp38-cp38-macosx_10_9_x86_64.whl → 2022.6__cp38-cp38-macosx_10_9_x86_64.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.
Potentially problematic release.
This version of westpa might be problematic. Click here for more details.
- westpa/_version.py +3 -3
- westpa/cli/core/w_fork.py +1 -1
- westpa/cli/core/w_init.py +0 -1
- westpa/cli/core/w_run.py +0 -1
- westpa/cli/core/w_states.py +0 -2
- westpa/cli/core/w_succ.py +1 -1
- westpa/cli/tools/w_assign.py +0 -1
- westpa/cli/tools/w_bins.py +0 -1
- westpa/cli/tools/w_dumpsegs.py +1 -1
- westpa/cli/tools/w_eddist.py +0 -4
- westpa/cli/tools/w_ipa.py +0 -1
- westpa/cli/tools/w_multi_west.py +1 -1
- westpa/cli/tools/w_pdist.py +0 -1
- westpa/cli/tools/w_red.py +0 -1
- westpa/core/_rc.py +0 -1
- westpa/core/binning/_assign.cpython-38-darwin.so +0 -0
- westpa/core/binning/assign.py +2 -2
- westpa/core/binning/binless_driver.py +1 -1
- westpa/core/binning/binless_manager.py +25 -2
- westpa/core/binning/mab.py +23 -7
- westpa/core/binning/mab_driver.py +1 -1
- westpa/core/binning/mab_manager.py +25 -2
- westpa/core/data_manager.py +5 -6
- westpa/core/h5io.py +1 -5
- westpa/core/kinetics/_kinetics.cpython-38-darwin.so +0 -0
- westpa/core/propagators/__init__.py +0 -1
- westpa/core/propagators/executable.py +1 -3
- westpa/core/reweight/_reweight.cpython-38-darwin.so +0 -0
- westpa/core/sim_manager.py +3 -4
- westpa/core/trajectory.py +9 -1
- westpa/core/we_driver.py +7 -7
- westpa/fasthist/_fasthist.cpython-38-darwin.so +0 -0
- westpa/mclib/_mclib.cpython-38-darwin.so +0 -0
- westpa/oldtools/aframe/binning.py +2 -2
- westpa/oldtools/aframe/data_reader.py +3 -4
- westpa/oldtools/aframe/kinetics.py +0 -1
- westpa/oldtools/aframe/trajwalker.py +1 -1
- westpa/oldtools/aframe/transitions.py +1 -3
- westpa/oldtools/cmds/w_ttimes.py +2 -4
- westpa/tools/binning.py +1 -4
- westpa/tools/kinetics_tool.py +0 -3
- westpa/tools/selected_segs.py +0 -1
- westpa/trajtree/_trajtree.cpython-38-darwin.so +0 -0
- westpa/trajtree/trajtree.py +0 -2
- westpa/westext/adaptvoronoi/adaptVor_driver.py +0 -2
- westpa/westext/hamsm_restarting/example_overrides.py +0 -1
- westpa/westext/hamsm_restarting/restart_driver.py +1 -18
- westpa/westext/stringmethod/string_driver.py +0 -1
- westpa/westext/stringmethod/string_method.py +0 -2
- westpa/westext/weed/weed_driver.py +2 -2
- westpa/westext/wess/ProbAdjust.py +0 -1
- westpa/westext/wess/wess_driver.py +2 -2
- westpa/work_managers/environment.py +0 -1
- westpa/work_managers/mpi.py +0 -7
- westpa/work_managers/zeromq/core.py +1 -5
- westpa/work_managers/zeromq/work_manager.py +1 -2
- westpa/work_managers/zeromq/worker.py +0 -1
- {westpa-2022.5.dist-info → westpa-2022.6.dist-info}/METADATA +9 -6
- {westpa-2022.5.dist-info → westpa-2022.6.dist-info}/RECORD +64 -64
- {westpa-2022.5.dist-info → westpa-2022.6.dist-info}/WHEEL +1 -1
- {westpa-2022.5.dist-info → westpa-2022.6.dist-info}/AUTHORS +0 -0
- {westpa-2022.5.dist-info → westpa-2022.6.dist-info}/LICENSE +0 -0
- {westpa-2022.5.dist-info → westpa-2022.6.dist-info}/entry_points.txt +0 -0
- {westpa-2022.5.dist-info → westpa-2022.6.dist-info}/top_level.txt +0 -0
westpa/_version.py
CHANGED
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2023-
|
|
11
|
+
"date": "2023-10-20T12:52:31-0400",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "2022.
|
|
14
|
+
"full-revisionid": "ef5fbd3e0aeb4d08160fc56ee39cca6ba75e3217",
|
|
15
|
+
"version": "2022.06"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
westpa/cli/core/w_fork.py
CHANGED
|
@@ -101,7 +101,7 @@ def entry_point():
|
|
|
101
101
|
state_map = np.empty((n_segments,), dtype=state_map_dtype)
|
|
102
102
|
state_map['old_n_iter'] = n_iter
|
|
103
103
|
|
|
104
|
-
for
|
|
104
|
+
for iseg, (index_row, pcoord) in enumerate(zip(old_index, old_final_pcoords)):
|
|
105
105
|
istate = istates[iseg]
|
|
106
106
|
istate.iter_created = 0
|
|
107
107
|
istate.iter_used = 1
|
westpa/cli/core/w_init.py
CHANGED
westpa/cli/core/w_run.py
CHANGED
westpa/cli/core/w_states.py
CHANGED
|
@@ -102,7 +102,6 @@ def entry_point():
|
|
|
102
102
|
|
|
103
103
|
# TODO: This would benefit from a refactor to set default args to None, and replace some of those "if <argument>" clauses
|
|
104
104
|
def initialize(mode, bstates, _bstate_file, tstates, _tstate_file):
|
|
105
|
-
|
|
106
105
|
work_manager = make_work_manager()
|
|
107
106
|
|
|
108
107
|
system = westpa.rc.get_system_driver()
|
|
@@ -116,7 +115,6 @@ def initialize(mode, bstates, _bstate_file, tstates, _tstate_file):
|
|
|
116
115
|
|
|
117
116
|
assert mode in ('show', 'replace', 'append')
|
|
118
117
|
if mode == 'show':
|
|
119
|
-
|
|
120
118
|
basis_states = data_manager.get_basis_states(n_iter)
|
|
121
119
|
if basis_states:
|
|
122
120
|
bstate_file = sys.stdout if not _bstate_file else open(_bstate_file, 'wt')
|
westpa/cli/core/w_succ.py
CHANGED
|
@@ -57,7 +57,7 @@ class WSucc(CommonOutputMixin, WESTDataReaderMixin, WESTAnalysisTool):
|
|
|
57
57
|
# The above HDF5 selection always returns a vector; we want a 2-d array
|
|
58
58
|
final_pcoords.shape = (len(recycled_seg_ids), pcoord_ndim)
|
|
59
59
|
|
|
60
|
-
for
|
|
60
|
+
for ipc, seg_id in enumerate(recycled_seg_ids):
|
|
61
61
|
self.output_file.write('%8d %8d %20.14g' % (n_iter, seg_id, seg_index[seg_id]['weight']))
|
|
62
62
|
fields = ['']
|
|
63
63
|
for field in final_pcoords[ipc]:
|
westpa/cli/tools/w_assign.py
CHANGED
|
@@ -33,7 +33,6 @@ def parse_pcoord_value(pc_str):
|
|
|
33
33
|
def _assign_label_pop(
|
|
34
34
|
n_iter, lb, ub, mapper, nstates, state_map, last_labels, parent_id_dsspec, weight_dsspec, pcoord_dsspec, subsample
|
|
35
35
|
):
|
|
36
|
-
|
|
37
36
|
nbins = len(state_map) - 1
|
|
38
37
|
parent_ids = parent_id_dsspec.get_iter_data(n_iter, index_exp[lb:ub])
|
|
39
38
|
weights = weight_dsspec.get_iter_data(n_iter, index_exp[lb:ub])
|
westpa/cli/tools/w_bins.py
CHANGED
|
@@ -68,7 +68,6 @@ modify the binning for the current iteration of a WEST simulation.
|
|
|
68
68
|
rebin_parser.set_defaults(func=self.cmd_rebin)
|
|
69
69
|
|
|
70
70
|
def process_args(self, args):
|
|
71
|
-
|
|
72
71
|
self.data_reader.process_args(args)
|
|
73
72
|
self.data_reader.open(mode='r+')
|
|
74
73
|
self.n_iter = getattr(args, 'n_iter', None) or self.data_reader.current_iteration
|
westpa/cli/tools/w_dumpsegs.py
CHANGED
|
@@ -64,7 +64,7 @@ significant analysis tasks).
|
|
|
64
64
|
+ '\n'
|
|
65
65
|
)
|
|
66
66
|
pcoord_lines = ' pcoord[0] = {init_pcoord}\n pcoord[-1] = {final_pcoord}' + '\n'
|
|
67
|
-
for
|
|
67
|
+
for _seg_id, segment in enumerate(segments):
|
|
68
68
|
parents_str = '[' + ', '.join(map(str, sorted(segment.wtg_parent_ids))) + ']'
|
|
69
69
|
init_pcoord_str = '[' + ', '.join('{pcval:<12.6g}'.format(pcval=float(pce)) for pce in segment.pcoord[0]) + ']'
|
|
70
70
|
final_pcoord_str = '[' + ', '.join('{pcval:<12.6g}'.format(pcval=float(pce)) for pce in segment.pcoord[-1]) + ']'
|
westpa/cli/tools/w_eddist.py
CHANGED
|
@@ -68,7 +68,6 @@ def _remote_min_max(ndim, dset_dtype, n_iter, dsspec):
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
def _remote_bin_iter(iiter, n_iter, dsspec, wt_dsspec, initpoint, binbounds, ignore_out_of_range):
|
|
71
|
-
|
|
72
71
|
iter_hist_shape = tuple(len(bounds) - 1 for bounds in binbounds)
|
|
73
72
|
iter_hist = np.zeros(iter_hist_shape, dtype=np.float64)
|
|
74
73
|
|
|
@@ -220,7 +219,6 @@ Command-line options
|
|
|
220
219
|
self.compress_output = False
|
|
221
220
|
|
|
222
221
|
def add_args(self, parser):
|
|
223
|
-
|
|
224
222
|
parser.add_argument(
|
|
225
223
|
'-b',
|
|
226
224
|
'--bins',
|
|
@@ -300,7 +298,6 @@ Command-line options
|
|
|
300
298
|
self.compress_output = args.compress or False
|
|
301
299
|
|
|
302
300
|
def go(self):
|
|
303
|
-
|
|
304
301
|
pi = self.progress.indicator
|
|
305
302
|
pi.operation = 'Initializing'
|
|
306
303
|
with pi:
|
|
@@ -334,7 +331,6 @@ Command-line options
|
|
|
334
331
|
|
|
335
332
|
@staticmethod
|
|
336
333
|
def parse_binspec(binspec):
|
|
337
|
-
|
|
338
334
|
namespace = {'numpy': np, 'np': np, 'inf': float('inf')}
|
|
339
335
|
|
|
340
336
|
try:
|
westpa/cli/tools/w_ipa.py
CHANGED
westpa/cli/tools/w_multi_west.py
CHANGED
|
@@ -156,7 +156,7 @@ Command-line options
|
|
|
156
156
|
# Sometimes, we're smaller or larger by one. Hm.
|
|
157
157
|
try:
|
|
158
158
|
self.total_walkers[:] += west['summary'][:-1]['n_particles']
|
|
159
|
-
except
|
|
159
|
+
except ValueError:
|
|
160
160
|
self.total_walkers[:] += west['summary'][:-1]['n_particles'][: len(self.total_walkers)]
|
|
161
161
|
|
|
162
162
|
class Segment:
|
westpa/cli/tools/w_pdist.py
CHANGED
|
@@ -51,7 +51,6 @@ def _remote_min_max(ndim, dset_dtype, n_iter, dsspec):
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
def _remote_bin_iter(iiter, n_iter, dsspec, wt_dsspec, initpoint, binbounds, ignore_out_of_range):
|
|
54
|
-
|
|
55
54
|
iter_hist_shape = tuple(len(bounds) - 1 for bounds in binbounds)
|
|
56
55
|
iter_hist = np.zeros(iter_hist_shape, dtype=np.float64)
|
|
57
56
|
|
westpa/cli/tools/w_red.py
CHANGED
westpa/core/_rc.py
CHANGED
|
Binary file
|
westpa/core/binning/assign.py
CHANGED
|
@@ -429,7 +429,7 @@ class RecursiveBinMapper(BinMapper):
|
|
|
429
429
|
# Which coordinates do we need to reassign, because they landed in
|
|
430
430
|
# bins with embedded mappers?
|
|
431
431
|
rmasks = {}
|
|
432
|
-
for
|
|
432
|
+
for rindex, mapper in self._recursion_targets.items():
|
|
433
433
|
omask = output == rindex
|
|
434
434
|
mmask |= omask
|
|
435
435
|
rmasks[rindex] = omask
|
|
@@ -441,7 +441,7 @@ class RecursiveBinMapper(BinMapper):
|
|
|
441
441
|
output_map(output, omap, mask & ~mmask)
|
|
442
442
|
|
|
443
443
|
# do any recursive assignments necessary
|
|
444
|
-
for
|
|
444
|
+
for rindex, mapper in self._recursion_targets.items():
|
|
445
445
|
mapper.assign(coords, mask & rmasks[rindex], output)
|
|
446
446
|
|
|
447
447
|
return output
|
|
@@ -33,7 +33,7 @@ class BinlessDriver(WEDriver):
|
|
|
33
33
|
final_binning = self.final_binning
|
|
34
34
|
flux_matrix = self.flux_matrix
|
|
35
35
|
transition_matrix = self.transition_matrix
|
|
36
|
-
for
|
|
36
|
+
for segment, iidx, fidx in zip(segments, initial_assignments, final_assignments):
|
|
37
37
|
initial_binning[iidx].add(segment)
|
|
38
38
|
final_binning[fidx].add(segment)
|
|
39
39
|
flux_matrix[iidx, fidx] += segment.weight
|
|
@@ -75,8 +75,31 @@ class BinlessSimManager(WESimManager):
|
|
|
75
75
|
log.error('unknown future {!r} received from work manager'.format(future))
|
|
76
76
|
raise AssertionError('untracked future {!r}'.format(future))
|
|
77
77
|
|
|
78
|
+
# Collectively assign all segments to their bins...
|
|
78
79
|
self.we_driver.assign(self.segments.values())
|
|
79
|
-
|
|
80
|
+
|
|
81
|
+
# For cases where we need even more istates for recycled trajectories
|
|
82
|
+
# futures should be empty at this point.
|
|
83
|
+
istate_gen_futures = self.get_istate_futures()
|
|
84
|
+
futures.update(istate_gen_futures)
|
|
85
|
+
|
|
86
|
+
# Wait for istate_gen_futures and catch untracked futures.
|
|
87
|
+
while futures:
|
|
88
|
+
future = self.work_manager.wait_any(futures)
|
|
89
|
+
futures.remove(future)
|
|
90
|
+
|
|
91
|
+
if future in istate_gen_futures:
|
|
92
|
+
istate_gen_futures.remove(future)
|
|
93
|
+
_basis_state, initial_state = future.get_result()
|
|
94
|
+
log.debug('received newly-prepared initial state {!r}'.format(initial_state))
|
|
95
|
+
initial_state.istate_status = InitialState.ISTATE_STATUS_PREPARED
|
|
96
|
+
with self.data_manager.expiring_flushing_lock():
|
|
97
|
+
self.data_manager.update_initial_states([initial_state], n_iter=self.n_iter + 1)
|
|
98
|
+
self.we_driver.avail_initial_states[initial_state.state_id] = initial_state
|
|
99
|
+
else:
|
|
100
|
+
log.error('unknown future {!r} received from work manager'.format(future))
|
|
101
|
+
raise AssertionError('untracked future {!r}'.format(future))
|
|
102
|
+
|
|
80
103
|
log.debug('done with propagation')
|
|
81
104
|
self.save_bin_data()
|
|
82
105
|
self.data_manager.flush_backing()
|
|
@@ -132,7 +155,7 @@ class BinlessSimManager(WESimManager):
|
|
|
132
155
|
for iseg, segment in enumerate(segments.values()):
|
|
133
156
|
initial_pcoords[iseg] = segment.pcoord[0]
|
|
134
157
|
initial_assignments = self.system.bin_mapper.assign(initial_pcoords)
|
|
135
|
-
for
|
|
158
|
+
for segment, assignment in zip(iter(segments.values()), initial_assignments):
|
|
136
159
|
initial_binning[assignment].add(segment)
|
|
137
160
|
self.report_bin_statistics(initial_binning, [], save_summary=True)
|
|
138
161
|
del initial_pcoords, initial_binning
|
westpa/core/binning/mab.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
from westpa.core.binning import FuncBinMapper
|
|
3
1
|
import logging
|
|
2
|
+
import numpy as np
|
|
4
3
|
import westpa
|
|
4
|
+
from westpa.core.binning import FuncBinMapper
|
|
5
|
+
from os.path import expandvars
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
log = logging.getLogger(__name__)
|
|
7
9
|
|
|
@@ -19,6 +21,7 @@ def map_mab(coords, mask, output, *args, **kwargs):
|
|
|
19
21
|
skip = kwargs.get("skip")
|
|
20
22
|
nbins_per_dim = kwargs.get("nbins_per_dim")
|
|
21
23
|
mab_log = kwargs.get("mab_log")
|
|
24
|
+
bin_log = kwargs.get("bin_log")
|
|
22
25
|
ndim = len(nbins_per_dim)
|
|
23
26
|
|
|
24
27
|
if not np.any(mask):
|
|
@@ -212,7 +215,6 @@ def map_mab(coords, mask, output, *args, **kwargs):
|
|
|
212
215
|
# the following are for the "linear" portion
|
|
213
216
|
if not special:
|
|
214
217
|
for n in range(ndim):
|
|
215
|
-
|
|
216
218
|
# if skipped, it's added to the same bin as the special walkers above
|
|
217
219
|
if skip[n] != 0:
|
|
218
220
|
holder = boundary_base + n
|
|
@@ -244,6 +246,18 @@ def map_mab(coords, mask, output, *args, **kwargs):
|
|
|
244
246
|
# output is the main list that, for each segment, holds the bin assignment
|
|
245
247
|
output[i] = holder
|
|
246
248
|
|
|
249
|
+
if bin_log and report:
|
|
250
|
+
if westpa.rc.sim_manager.n_iter:
|
|
251
|
+
with open(expandvars("$WEST_SIM_ROOT/binbounds.log"), 'a') as bb_file:
|
|
252
|
+
bb_file.write(f'{westpa.rc.sim_manager.n_iter}\n') # Iteration Number
|
|
253
|
+
for n in range(ndim):
|
|
254
|
+
bb_file.write(f'{np.linspace(minlist[n], maxlist[n], nbins_per_dim[n] + 1)}\t') # Write binbounds per dim
|
|
255
|
+
bb_file.write(f'\n{minlist} {maxlist}\n') # Min/Max pcoord
|
|
256
|
+
if bottleneck_base > boundary_base:
|
|
257
|
+
bb_file.write(f'{flipdifflist} {difflist}\n\n') # Bottlenecks
|
|
258
|
+
else:
|
|
259
|
+
bb_file.write('\n')
|
|
260
|
+
|
|
247
261
|
return output
|
|
248
262
|
|
|
249
263
|
|
|
@@ -252,7 +266,7 @@ class MABBinMapper(FuncBinMapper):
|
|
|
252
266
|
the progress coordinte. Extrema and bottleneck segments are assigned
|
|
253
267
|
to their own bins.'''
|
|
254
268
|
|
|
255
|
-
def __init__(self, nbins, direction=None, skip=None, bottleneck=True, pca=False, mab_log=False):
|
|
269
|
+
def __init__(self, nbins, direction=None, skip=None, bottleneck=True, pca=False, mab_log=False, bin_log=False):
|
|
256
270
|
# Verifying parameters
|
|
257
271
|
if nbins is None:
|
|
258
272
|
raise ValueError("nbins_per_dim is missing")
|
|
@@ -262,15 +276,17 @@ class MABBinMapper(FuncBinMapper):
|
|
|
262
276
|
direction = [0] * ndim
|
|
263
277
|
elif len(direction) != ndim:
|
|
264
278
|
direction = [0] * ndim
|
|
265
|
-
log.
|
|
279
|
+
log.warning("Direction list is not the correct dimensions, setting to defaults.")
|
|
266
280
|
|
|
267
281
|
if skip is None:
|
|
268
282
|
skip = [0] * ndim
|
|
269
283
|
elif len(skip) != ndim:
|
|
270
284
|
skip = [0] * ndim
|
|
271
|
-
log.
|
|
285
|
+
log.warning("Skip list is not the correct dimensions, setting to defaults.")
|
|
272
286
|
|
|
273
|
-
kwargs = dict(
|
|
287
|
+
kwargs = dict(
|
|
288
|
+
nbins_per_dim=nbins, direction=direction, skip=skip, bottleneck=bottleneck, pca=pca, mab_log=mab_log, bin_log=bin_log
|
|
289
|
+
)
|
|
274
290
|
# the following is neccessary because functional bin mappers need to "reserve"
|
|
275
291
|
# bins and tell the sim manager how many bins they will need to use, this is
|
|
276
292
|
# determined by taking all direction/skipping info into account
|
|
@@ -33,7 +33,7 @@ class MABDriver(WEDriver):
|
|
|
33
33
|
final_binning = self.final_binning
|
|
34
34
|
flux_matrix = self.flux_matrix
|
|
35
35
|
transition_matrix = self.transition_matrix
|
|
36
|
-
for
|
|
36
|
+
for segment, iidx, fidx in zip(segments, initial_assignments, final_assignments):
|
|
37
37
|
initial_binning[iidx].add(segment)
|
|
38
38
|
final_binning[fidx].add(segment)
|
|
39
39
|
flux_matrix[iidx, fidx] += segment.weight
|
|
@@ -75,8 +75,31 @@ class MABSimManager(WESimManager):
|
|
|
75
75
|
log.error('unknown future {!r} received from work manager'.format(future))
|
|
76
76
|
raise AssertionError('untracked future {!r}'.format(future))
|
|
77
77
|
|
|
78
|
+
# Collectively assign all segments to their bins...
|
|
78
79
|
self.we_driver.assign(self.segments.values())
|
|
79
|
-
|
|
80
|
+
|
|
81
|
+
# For cases where we need even more istates for recycled trajectories
|
|
82
|
+
# futures should be empty at this point.
|
|
83
|
+
istate_gen_futures = self.get_istate_futures()
|
|
84
|
+
futures.update(istate_gen_futures)
|
|
85
|
+
|
|
86
|
+
# Wait for istate_gen_futures and catch untracked futures.
|
|
87
|
+
while futures:
|
|
88
|
+
future = self.work_manager.wait_any(futures)
|
|
89
|
+
futures.remove(future)
|
|
90
|
+
|
|
91
|
+
if future in istate_gen_futures:
|
|
92
|
+
istate_gen_futures.remove(future)
|
|
93
|
+
_basis_state, initial_state = future.get_result()
|
|
94
|
+
log.debug('received newly-prepared initial state {!r}'.format(initial_state))
|
|
95
|
+
initial_state.istate_status = InitialState.ISTATE_STATUS_PREPARED
|
|
96
|
+
with self.data_manager.expiring_flushing_lock():
|
|
97
|
+
self.data_manager.update_initial_states([initial_state], n_iter=self.n_iter + 1)
|
|
98
|
+
self.we_driver.avail_initial_states[initial_state.state_id] = initial_state
|
|
99
|
+
else:
|
|
100
|
+
log.error('unknown future {!r} received from work manager'.format(future))
|
|
101
|
+
raise AssertionError('untracked future {!r}'.format(future))
|
|
102
|
+
|
|
80
103
|
log.debug('done with propagation')
|
|
81
104
|
self.save_bin_data()
|
|
82
105
|
self.data_manager.flush_backing()
|
|
@@ -135,7 +158,7 @@ class MABSimManager(WESimManager):
|
|
|
135
158
|
# Assign this iteration's segments' initial points to bins and report on bin population
|
|
136
159
|
initial_binning = self.system.bin_mapper.construct_bins()
|
|
137
160
|
initial_assignments = self.system.bin_mapper.assign(pcoords_with_weights)
|
|
138
|
-
for
|
|
161
|
+
for segment, assignment in zip(iter(segments.values()), initial_assignments):
|
|
139
162
|
initial_binning[assignment].add(segment)
|
|
140
163
|
self.report_bin_statistics(initial_binning, [], save_summary=True)
|
|
141
164
|
del pcoords_with_weights, initial_binning
|
westpa/core/data_manager.py
CHANGED
|
@@ -231,7 +231,7 @@ class WESTDataManager:
|
|
|
231
231
|
def process_config(self):
|
|
232
232
|
config = self.rc.config
|
|
233
233
|
|
|
234
|
-
for
|
|
234
|
+
for entry, type_ in [('iter_prec', int)]:
|
|
235
235
|
config.require_type_if_present(['west', 'data', entry], type_)
|
|
236
236
|
|
|
237
237
|
self.we_h5filename = config.get_path(['west', 'data', 'west_data_file'], default=self.default_we_h5filename)
|
|
@@ -263,7 +263,6 @@ class WESTDataManager:
|
|
|
263
263
|
raise ValueError('cannot override pcoord storage location')
|
|
264
264
|
|
|
265
265
|
def __init__(self, rc=None):
|
|
266
|
-
|
|
267
266
|
self.rc = rc or westpa.rc
|
|
268
267
|
|
|
269
268
|
self.we_h5filename = self.default_we_h5filename
|
|
@@ -854,7 +853,7 @@ class WESTDataManager:
|
|
|
854
853
|
pcoord = np.empty((n_particles, pcoord_len, pcoord_ndim), pcoord_dtype)
|
|
855
854
|
|
|
856
855
|
total_parents = 0
|
|
857
|
-
for
|
|
856
|
+
for seg_id, segment in enumerate(segments):
|
|
858
857
|
if segment.seg_id is not None:
|
|
859
858
|
assert segment.seg_id == seg_id
|
|
860
859
|
else:
|
|
@@ -895,7 +894,7 @@ class WESTDataManager:
|
|
|
895
894
|
wtgraph_ds = iter_group.create_dataset('wtgraph', (total_parents,), seg_id_dtype, compression='gzip', shuffle=True)
|
|
896
895
|
parents = np.empty((total_parents,), seg_id_dtype)
|
|
897
896
|
|
|
898
|
-
for
|
|
897
|
+
for seg_id, segment in enumerate(segments):
|
|
899
898
|
offset = seg_index_table[seg_id]['wtg_offset']
|
|
900
899
|
extent = seg_index_table[seg_id]['wtg_n_parents']
|
|
901
900
|
parent_list = list(segment.wtg_parent_ids)
|
|
@@ -986,7 +985,7 @@ class WESTDataManager:
|
|
|
986
985
|
# read summary data so that we have valud parent and weight transfer information
|
|
987
986
|
si_dsid.read(si_msel, si_fsel, seg_index_entries)
|
|
988
987
|
|
|
989
|
-
for
|
|
988
|
+
for iseg, (segment, ientry) in enumerate(zip(segments, seg_index_entries)):
|
|
990
989
|
ientry['status'] = segment.status
|
|
991
990
|
ientry['endpoint_type'] = segment.endpoint_type or Segment.SEG_ENDPOINT_UNSET
|
|
992
991
|
ientry['cputime'] = segment.cputime
|
|
@@ -1021,7 +1020,7 @@ class WESTDataManager:
|
|
|
1021
1020
|
|
|
1022
1021
|
# Then we iterate over data sets and store data
|
|
1023
1022
|
if dsets:
|
|
1024
|
-
for
|
|
1023
|
+
for dsname, (shape, dtype) in dsets.items():
|
|
1025
1024
|
# dset = self._require_aux_dataset(iter_group, dsname, n_total_segments, shape, dtype)
|
|
1026
1025
|
try:
|
|
1027
1026
|
dsopts = self.dataset_options[dsname]
|
westpa/core/h5io.py
CHANGED
|
@@ -101,7 +101,6 @@ def tostr(b):
|
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
def is_within_directory(directory, target):
|
|
104
|
-
|
|
105
104
|
abs_directory = os.path.abspath(directory)
|
|
106
105
|
abs_target = os.path.abspath(target)
|
|
107
106
|
|
|
@@ -111,7 +110,6 @@ def is_within_directory(directory, target):
|
|
|
111
110
|
|
|
112
111
|
|
|
113
112
|
def safe_extract(tar, path=".", members=None, *, numeric_owner=False):
|
|
114
|
-
|
|
115
113
|
for member in tar.getmembers():
|
|
116
114
|
member_path = os.path.join(path, member.name)
|
|
117
115
|
if not is_within_directory(path, member_path):
|
|
@@ -220,7 +218,7 @@ def load_west(filename):
|
|
|
220
218
|
|
|
221
219
|
raw_pcoord = iter_group['pcoord'][:]
|
|
222
220
|
if raw_pcoord.ndim != 3:
|
|
223
|
-
log.
|
|
221
|
+
log.warning('pcoord is expected to be a 3-d ndarray instead of {}-d'.format(raw_pcoord.ndim))
|
|
224
222
|
continue
|
|
225
223
|
# ignore the first frame of each segment
|
|
226
224
|
if raw_pcoord.shape[1] == traj.n_frames + 1:
|
|
@@ -374,7 +372,6 @@ class WESTPAH5File(h5py.File):
|
|
|
374
372
|
_this_fileformat_version = 8
|
|
375
373
|
|
|
376
374
|
def __init__(self, *args, **kwargs):
|
|
377
|
-
|
|
378
375
|
# These values are used for creating files or reading files where this
|
|
379
376
|
# data is not stored. Otherwise, values stored as attributes on the root
|
|
380
377
|
# group are used instead.
|
|
@@ -919,7 +916,6 @@ class MultiDSSpec(DSSpec):
|
|
|
919
916
|
class IterBlockedDataset:
|
|
920
917
|
@classmethod
|
|
921
918
|
def empty_like(cls, blocked_dataset):
|
|
922
|
-
|
|
923
919
|
source = blocked_dataset.data if blocked_dataset.data is not None else blocked_dataset.dataset
|
|
924
920
|
|
|
925
921
|
newbds = cls(
|
|
Binary file
|
|
@@ -10,7 +10,6 @@ def blocked_iter(blocksize, iterable, fillvalue=None):
|
|
|
10
10
|
|
|
11
11
|
class WESTPropagator:
|
|
12
12
|
def __init__(self, rc=None):
|
|
13
|
-
|
|
14
13
|
# For maximum flexibility, the basis states and initial states valid
|
|
15
14
|
# at the point in the simulation when the propgator is used must be
|
|
16
15
|
# available in several routines, and it is inconvenient to pass them
|
|
@@ -372,7 +372,7 @@ class ExecutablePropagator(WESTPropagator):
|
|
|
372
372
|
return (rc, rusage)
|
|
373
373
|
|
|
374
374
|
def exec_child_from_child_info(self, child_info, template_args, environ):
|
|
375
|
-
for
|
|
375
|
+
for key, value in child_info.get('environ', {}).items():
|
|
376
376
|
environ[key] = self.makepath(value)
|
|
377
377
|
return self.exec_child(
|
|
378
378
|
executable=self.makepath(child_info['executable'], template_args),
|
|
@@ -443,7 +443,6 @@ class ExecutablePropagator(WESTPropagator):
|
|
|
443
443
|
initial_state = self.initial_states[segment.initial_state_id]
|
|
444
444
|
|
|
445
445
|
if initial_state.istate_type == InitialState.ISTATE_TYPE_START:
|
|
446
|
-
|
|
447
446
|
basis_state = BasisState(
|
|
448
447
|
label=f"sstate_{initial_state.state_id}", pcoord=initial_state.pcoord, probability=0.0, auxref=""
|
|
449
448
|
)
|
|
@@ -465,7 +464,6 @@ class ExecutablePropagator(WESTPropagator):
|
|
|
465
464
|
environ[self.ENV_PARENT_DATA_REF] = environ[self.ENV_BSTATE_DATA_REF]
|
|
466
465
|
|
|
467
466
|
elif initial_state.istate_type == InitialState.ISTATE_TYPE_START:
|
|
468
|
-
|
|
469
467
|
# This points to the start-state PDB
|
|
470
468
|
environ[self.ENV_PARENT_DATA_REF] = environ[self.ENV_BSTATE_DATA_REF] + '/' + initial_state.basis_auxref
|
|
471
469
|
else: # initial_state.type == InitialState.ISTATE_TYPE_GENERATED
|
|
Binary file
|
westpa/core/sim_manager.py
CHANGED
|
@@ -37,7 +37,7 @@ class PropagationError(RuntimeError):
|
|
|
37
37
|
class WESimManager:
|
|
38
38
|
def process_config(self):
|
|
39
39
|
config = self.rc.config
|
|
40
|
-
for
|
|
40
|
+
for entry, type_ in [('gen_istates', bool), ('block_size', int), ('save_transition_matrices', bool)]:
|
|
41
41
|
config.require_type_if_present(['west', 'propagation', entry], type_)
|
|
42
42
|
|
|
43
43
|
self.do_gen_istates = config.get(['west', 'propagation', 'gen_istates'], False)
|
|
@@ -136,7 +136,7 @@ class WESimManager:
|
|
|
136
136
|
def invoke_callbacks(self, hook, *args, **kwargs):
|
|
137
137
|
callbacks = self._callback_table.get(hook, [])
|
|
138
138
|
sorted_callbacks = sorted(callbacks)
|
|
139
|
-
for
|
|
139
|
+
for priority, name, fn in sorted_callbacks:
|
|
140
140
|
log.debug('invoking callback {!r} for hook {!r}'.format(fn, hook))
|
|
141
141
|
fn(*args, **kwargs)
|
|
142
142
|
|
|
@@ -478,7 +478,7 @@ class WESimManager:
|
|
|
478
478
|
for iseg, segment in enumerate(segments.values()):
|
|
479
479
|
initial_pcoords[iseg] = segment.pcoord[0]
|
|
480
480
|
initial_assignments = self.system.bin_mapper.assign(initial_pcoords)
|
|
481
|
-
for
|
|
481
|
+
for segment, assignment in zip(iter(segments.values()), initial_assignments):
|
|
482
482
|
initial_binning[assignment].add(segment)
|
|
483
483
|
self.report_bin_statistics(initial_binning, [], save_summary=True)
|
|
484
484
|
del initial_pcoords, initial_binning
|
|
@@ -733,7 +733,6 @@ class WESimManager:
|
|
|
733
733
|
|
|
734
734
|
iter_elapsed = 0
|
|
735
735
|
while self.n_iter <= max_iter:
|
|
736
|
-
|
|
737
736
|
if max_walltime and time.time() + 1.1 * iter_elapsed >= run_killtime:
|
|
738
737
|
self.rc.pstatus('Iteration {:d} would require more than the allotted time. Ending run.'.format(self.n_iter))
|
|
739
738
|
return
|
westpa/core/trajectory.py
CHANGED
|
@@ -293,12 +293,20 @@ def load_trajectory(folder):
|
|
|
293
293
|
trajectory file contains topology data (e.g., HDF5 format).
|
|
294
294
|
'''
|
|
295
295
|
traj_file = top_file = None
|
|
296
|
-
for
|
|
296
|
+
file_list = [f_name for f_name in os.listdir(folder) if not f_name.startswith('.')]
|
|
297
|
+
for filename in file_list:
|
|
297
298
|
filepath = os.path.join(folder, filename)
|
|
298
299
|
if not os.path.isfile(filepath):
|
|
299
300
|
continue
|
|
300
301
|
|
|
301
302
|
ext = get_extension(filename).lower()
|
|
303
|
+
# Catching trajectory formats that can be topology and trajectories at the same time.
|
|
304
|
+
# Only activates when there is a single file.
|
|
305
|
+
if len(file_list) < 2 and ext in TOPOLOGY_EXTS and ext in TRAJECTORY_EXTS:
|
|
306
|
+
top_file = filename
|
|
307
|
+
traj_file = filename
|
|
308
|
+
|
|
309
|
+
# Assuming topology file is copied first.
|
|
302
310
|
if ext in TOPOLOGY_EXTS and top_file is None:
|
|
303
311
|
top_file = filename
|
|
304
312
|
elif ext in TRAJECTORY_EXTS and traj_file is None:
|
westpa/core/we_driver.py
CHANGED
|
@@ -189,7 +189,7 @@ class WEDriver:
|
|
|
189
189
|
def recycling_segments(self):
|
|
190
190
|
'''Segments designated for recycling'''
|
|
191
191
|
if len(self.target_states):
|
|
192
|
-
for
|
|
192
|
+
for ibin, tstate in self.target_states.items():
|
|
193
193
|
for segment in self.final_binning[ibin]:
|
|
194
194
|
yield segment
|
|
195
195
|
else:
|
|
@@ -298,14 +298,14 @@ class WEDriver:
|
|
|
298
298
|
init_pcoords = np.empty((len(new_weights), self.system.pcoord_ndim), dtype=self.system.pcoord_dtype)
|
|
299
299
|
prev_init_pcoords = np.empty((len(new_weights), self.system.pcoord_ndim), dtype=self.system.pcoord_dtype)
|
|
300
300
|
|
|
301
|
-
for
|
|
301
|
+
for ientry, entry in enumerate(new_weights):
|
|
302
302
|
init_pcoords[ientry] = entry.new_init_pcoord
|
|
303
303
|
prev_init_pcoords[ientry] = entry.prev_init_pcoord
|
|
304
304
|
|
|
305
305
|
init_assignments = self.bin_mapper.assign(init_pcoords)
|
|
306
306
|
prev_init_assignments = self.bin_mapper.assign(prev_init_pcoords)
|
|
307
307
|
|
|
308
|
-
for
|
|
308
|
+
for entry, i, j in zip(new_weights, prev_init_assignments, init_assignments):
|
|
309
309
|
flux_matrix[i, j] += entry.weight
|
|
310
310
|
transition_matrix[i, j] += 1
|
|
311
311
|
|
|
@@ -351,7 +351,7 @@ class WEDriver:
|
|
|
351
351
|
final_binning = self.final_binning
|
|
352
352
|
flux_matrix = self.flux_matrix
|
|
353
353
|
transition_matrix = self.transition_matrix
|
|
354
|
-
for
|
|
354
|
+
for segment, iidx, fidx in zip(segments, initial_assignments, final_assignments):
|
|
355
355
|
initial_binning[iidx].add(segment)
|
|
356
356
|
final_binning[fidx].add(segment)
|
|
357
357
|
flux_matrix[iidx, fidx] += segment.weight
|
|
@@ -391,7 +391,7 @@ class WEDriver:
|
|
|
391
391
|
|
|
392
392
|
used_istate_ids = set()
|
|
393
393
|
istateiter = iter(self.avail_initial_states.values())
|
|
394
|
-
for
|
|
394
|
+
for ibin, target_state in self.target_states.items():
|
|
395
395
|
target_bin = self.next_iter_binning[ibin]
|
|
396
396
|
for segment in set(target_bin):
|
|
397
397
|
initial_state = next(istateiter)
|
|
@@ -657,7 +657,7 @@ class WEDriver:
|
|
|
657
657
|
# Then and only then adjust for correct particle count
|
|
658
658
|
total_number_of_subgroups = 0
|
|
659
659
|
total_number_of_particles = 0
|
|
660
|
-
for
|
|
660
|
+
for ibin, bin in enumerate(self.next_iter_binning):
|
|
661
661
|
if len(bin) == 0:
|
|
662
662
|
continue
|
|
663
663
|
|
|
@@ -740,7 +740,7 @@ class WEDriver:
|
|
|
740
740
|
|
|
741
741
|
# Create dummy segments
|
|
742
742
|
segments = []
|
|
743
|
-
for
|
|
743
|
+
for seg_id, (initial_state, weight) in enumerate(zip(initial_states, weights)):
|
|
744
744
|
dummy_segment = Segment(
|
|
745
745
|
n_iter=0,
|
|
746
746
|
seg_id=seg_id,
|
|
Binary file
|
|
Binary file
|