westpa.oldtools.aframe package
westpa.oldtools.aframe
WEST Analyis framework – an unholy mess of classes exploiting each other
- class westpa.oldtools.aframe.AnalysisMixin
Bases:
object
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- exception westpa.oldtools.aframe.ArgumentError(*args, **kwargs)
Bases:
RuntimeError
- class westpa.oldtools.aframe.WESTAnalysisTool
Bases:
object
- add_args(parser, upcall=True)
Add arguments to a parser common to all analyses of this type.
- process_args(args, upcall=True)
- open_analysis_backing()
- close_analysis_backing()
- require_analysis_group(groupname, replace=False)
- class westpa.oldtools.aframe.IterRangeMixin
Bases:
AnalysisMixin
A mixin for limiting the range of data considered for a given analysis. This should go after DataManagerMixin
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- check_iter_range()
- iter_block_iter()
Return an iterable of (block_first,block_last+1) over the blocks of iterations selected by –first/–last/–step. NOTE WELL that the second of the pair follows Python iterator conventions and returns one past the last element of the block.
- n_iter_blocks()
Return the number of blocks of iterations (as returned by
iter_block_iter
) selected by –first/–last/–step.
- record_data_iter_range(h5object, first_iter=None, last_iter=None)
Store attributes
first_iter
andlast_iter
on the given HDF5 object (group/dataset)
- record_data_iter_step(h5object, iter_step=None)
Store attribute
iter_step
on the given HDF5 object (group/dataset).
- check_data_iter_range_least(h5object, first_iter=None, last_iter=None)
Check that the given HDF5 object contains (as denoted by its
first_iter
/last_iter
attributes) at least the data range specified.
- check_data_iter_range_equal(h5object, first_iter=None, last_iter=None)
Check that the given HDF5 object contains per-iteration data for exactly the specified iterations (as denoted by the object’s
first_iter
andlast_iter
attributes
- check_data_iter_step_conformant(h5object, iter_step=None)
Check that the given HDF5 object contains per-iteration data at an iteration stride suitable for extracting data with the given stride. (In other words, is the given
iter_step
a multiple of the stride with which data was recorded.)
- check_data_iter_step_equal(h5object, iter_step=None)
Check that the given HDF5 object contains per-iteration data at an iteration stride the same as that specified.
- slice_per_iter_data(dataset, first_iter=None, last_iter=None, iter_step=None, axis=0)
Return the subset of the given dataset corresponding to the given iteration range and stride. Unless otherwise specified, the first dimension of the dataset is the one sliced.
- iter_range(first_iter=None, last_iter=None, iter_step=None)
- class westpa.oldtools.aframe.WESTDataReaderMixin
Bases:
AnalysisMixin
A mixin for analysis requiring access to the HDF5 files generated during a WEST run.
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- clear_run_cache()
- property cache_pcoords
Whether or not to cache progress coordinate data. While caching this data can significantly speed up some analysis operations, this requires copious RAM.
Setting this to False when it was formerly True will release any cached data.
- get_summary_table()
- get_iter_group(n_iter)
Return the HDF5 group corresponding to
n_iter
- get_segments(n_iter, include_pcoords=True)
Return all segments present in iteration n_iter
- get_segments_by_id(n_iter, seg_ids, include_pcoords=True)
Get segments from the data manager, employing caching where possible
- get_children(segment, include_pcoords=True)
- get_seg_index(n_iter)
- get_wtg_parent_array(n_iter)
- get_parent_array(n_iter)
- get_pcoord_array(n_iter)
- get_pcoord_dataset(n_iter)
- get_pcoords(n_iter, seg_ids)
- get_seg_ids(n_iter, bool_array=None)
- get_created_seg_ids(n_iter)
Return a list of seg_ids corresponding to segments which were created for the given iteration (are not continuations).
- max_iter_segs_in_range(first_iter, last_iter)
Return the maximum number of segments present in any iteration in the range selected
- total_segs_in_range(first_iter, last_iter)
Return the total number of segments present in all iterations in the range selected
- get_pcoord_len(n_iter)
Get the length of the progress coordinate array for the given iteration.
- get_total_time(first_iter=None, last_iter=None, dt=None)
Return the total amount of simulation time spanned between first_iter and last_iter (inclusive).
- class westpa.oldtools.aframe.ExtDataReaderMixin
Bases:
AnalysisMixin
An external data reader, primarily designed for reading brute force data, but also suitable for any auxiliary datasets required for analysis.
- default_chunksize = 8192
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- is_npy(filename)
- load_npy_or_text(filename)
Load an array from an existing .npy file, or read a text file and convert to a NumPy array. In either case, return a NumPy array. If a pickled NumPy dataset is found, memory-map it read-only. If the specified file does not contain a pickled NumPy array, attempt to read the file using numpy.loadtxt(filename).
- text_to_h5dataset(fileobj, group, dsname, dtype=<class 'numpy.float64'>, skiprows=0, usecols=None, chunksize=None)
Read text-format data from the given filename or file-like object
fileobj
and write to a newly-created dataset calleddsname
in the HDF5 groupgroup
. The data is stored as typedtype
. By default, the shape is taken as (number of lines, number of columns); columns can be omitted by specifying a list forusecols
, and lines can be skipped by usingskiprows
. Data is read in chunks ofchunksize
rows.
- npy_to_h5dataset(array, group, dsname, usecols=None, chunksize=None)
Store the given array into a newly-created dataset named
dsname
in the HDF5 groupgroup
, optionally only storing a subset of columns. Data is writtenchunksize
rows at a time, allowing very large memory-mapped arrays to be copied.
- class westpa.oldtools.aframe.BFDataManager
Bases:
AnalysisMixin
A class to manage brute force trajectory data. The primary purpose is to read in and manage brute force progress coordinate data for one or more trajectories. The trajectories need not be the same length, but they do need to have the same time spacing for progress coordinate values.
- traj_index_dtype = dtype([('pcoord_len', '<u8'), ('source_data', 'O')])
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- update_traj_index(traj_id, pcoord_len, source_data)
- get_traj_group(traj_id)
- create_traj_group()
- get_n_trajs()
- get_traj_len(traj_id)
- get_max_traj_len()
- get_pcoord_array(traj_id)
- get_pcoord_dataset(traj_id)
- require_bf_h5file()
- close_bf_h5file()
- class westpa.oldtools.aframe.BinningMixin
Bases:
AnalysisMixin
A mixin for performing binning on WEST data.
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- mapper_from_expr(expr)
- write_bin_labels(dest, header='# bin labels:\n', format='# bin {bin_index:{max_iwidth}d} -- {label!s}\n')
Print labels for all bins in
self.mapper
todest
. If provided,header
is printed before any labels. Theformat
string specifies how bin labels are to be printed. Valid entries are:bin_index
– the zero-based index of the binlabel
– the label, as obtained bybin.label
max_iwidth
– the maximum width (in characters) of the bin index, for pretty alignment
- require_binning_group()
- delete_binning_group()
- record_data_binhash(h5object)
Record the identity hash for self.mapper as an attribute on the given HDF5 object (group or dataset)
- check_data_binhash(h5object)
Check whether the recorded bin identity hash on the given HDF5 object matches the identity hash for self.mapper
- assign_to_bins()
Assign WEST segment data to bins. Requires the DataReader mixin to be in the inheritance tree
- require_bin_assignments()
- get_bin_assignments(first_iter=None, last_iter=None)
- get_bin_populations(first_iter=None, last_iter=None)
- class westpa.oldtools.aframe.MCBSMixin
Bases:
AnalysisMixin
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- calc_mcbs_nsets(alpha=None)
- calc_ci_bound_indices(n_sets=None, alpha=None)
- class westpa.oldtools.aframe.TrajWalker(data_reader, history_chunksize=100)
Bases:
object
A class to perform analysis by walking the trajectory tree. A stack is used rather than recursion, or else the highest number of iterations capable of being considered would be the same as the Python recursion limit.
- trace_to_root(n_iter, seg_id)
Trace the given segment back to its starting point, returning a list of Segment objects describing the entire trajectory.
- get_trajectory_roots(first_iter, last_iter, include_pcoords=True)
Get segments which start new trajectories. If min_iter or max_iter is specified, restrict the set of iterations within which the search is conducted.
- get_initial_nodes(first_iter, last_iter, include_pcoords=True)
Get segments with which to begin a tree walk – those alive or created within [first_iter,last_iter].
- trace_trajectories(first_iter, last_iter, callable, include_pcoords=True, cargs=None, ckwargs=None, get_state=None, set_state=None)
- Walk the trajectory tree depth-first, calling
callable(segment, children, history, *cargs, **ckwargs)
for each segment
visited.
segment
is the segment being visited,children
is that segment’s children,history
is the chain of segments leading tosegment
(not includingsegment
). get_state and set_state are used to record and reset, respectively, any state specific tocallable
when a new branch is traversed.
- class westpa.oldtools.aframe.TransitionAnalysisMixin
Bases:
AnalysisMixin
- require_transitions_group()
- delete_transitions_group()
- get_transitions_ds()
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- require_transitions()
- find_transitions()
- class westpa.oldtools.aframe.TransitionEventAccumulator(n_bins, output_group, calc_fpts=True)
Bases:
object
- index_dtype
alias of
uint64
- count_dtype
alias of
uint64
- weight_dtype
alias of
float64
- output_tdat_chunksize = 4096
- tdat_buffersize = 524288
- max_acc = 32768
- clear()
- clear_state()
- get_state()
- set_state(state_dict)
- record_transition_data(tdat)
Update running statistics and write transition data to HDF5 (with buffering)
- flush_transition_data()
Flush any unwritten output that may be present
- start_accumulation(assignments, weights, bin_pops, traj=0, n_iter=0)
- continue_accumulation(assignments, weights, bin_pops, traj=0, n_iter=0)
- class westpa.oldtools.aframe.BFTransitionAnalysisMixin
Bases:
TransitionAnalysisMixin
- require_transitions()
- find_transitions(chunksize=65536)
- class westpa.oldtools.aframe.KineticsAnalysisMixin
Bases:
AnalysisMixin
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- parse_bin_range(range_string)
- check_bin_selection(n_bins=None)
Check to see that the bin ranges selected by the user conform to the available bins (i.e., bin indices are within the permissible range). Also assigns the complete bin range if the user has not explicitly limited the bins to be considered.
- property selected_bin_pair_iter
- class westpa.oldtools.aframe.CommonOutputMixin
Bases:
AnalysisMixin
- add_common_output_args(parser_or_group)
- process_common_output_args(args)
- class westpa.oldtools.aframe.PlottingMixin
Bases:
AnalysisMixin
- require_matplotlib()
westpa.oldtools.aframe.atool module
westpa.oldtools.aframe.base_mixin module
- exception westpa.oldtools.aframe.base_mixin.ArgumentError(*args, **kwargs)
Bases:
RuntimeError
westpa.oldtools.aframe.binning module
- class westpa.oldtools.aframe.binning.AnalysisMixin
Bases:
object
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- class westpa.oldtools.aframe.binning.BinningMixin
Bases:
AnalysisMixin
A mixin for performing binning on WEST data.
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- mapper_from_expr(expr)
- write_bin_labels(dest, header='# bin labels:\n', format='# bin {bin_index:{max_iwidth}d} -- {label!s}\n')
Print labels for all bins in
self.mapper
todest
. If provided,header
is printed before any labels. Theformat
string specifies how bin labels are to be printed. Valid entries are:bin_index
– the zero-based index of the binlabel
– the label, as obtained bybin.label
max_iwidth
– the maximum width (in characters) of the bin index, for pretty alignment
- require_binning_group()
- delete_binning_group()
- record_data_binhash(h5object)
Record the identity hash for self.mapper as an attribute on the given HDF5 object (group or dataset)
- check_data_binhash(h5object)
Check whether the recorded bin identity hash on the given HDF5 object matches the identity hash for self.mapper
- assign_to_bins()
Assign WEST segment data to bins. Requires the DataReader mixin to be in the inheritance tree
- require_bin_assignments()
- get_bin_assignments(first_iter=None, last_iter=None)
- get_bin_populations(first_iter=None, last_iter=None)
westpa.oldtools.aframe.data_reader module
- class westpa.oldtools.aframe.data_reader.Segment(n_iter=None, seg_id=None, weight=None, endpoint_type=None, parent_id=None, wtg_parent_ids=None, pcoord=None, status=None, walltime=None, cputime=None, data=None)
Bases:
object
A class wrapping segment data that must be passed through the work manager or data manager. Most fields are self-explanatory. One item worth noting is that a negative parent ID means that the segment starts from the initial state with ID -(segment.parent_id+1)
- SEG_STATUS_UNSET = 0
- SEG_STATUS_PREPARED = 1
- SEG_STATUS_COMPLETE = 2
- SEG_STATUS_FAILED = 3
- SEG_INITPOINT_UNSET = 0
- SEG_INITPOINT_CONTINUES = 1
- SEG_INITPOINT_NEWTRAJ = 2
- SEG_ENDPOINT_UNSET = 0
- SEG_ENDPOINT_CONTINUES = 1
- SEG_ENDPOINT_MERGED = 2
- SEG_ENDPOINT_RECYCLED = 3
- statuses = {'SEG_STATUS_COMPLETE': 2, 'SEG_STATUS_FAILED': 3, 'SEG_STATUS_PREPARED': 1, 'SEG_STATUS_UNSET': 0}
- initpoint_types = {'SEG_INITPOINT_CONTINUES': 1, 'SEG_INITPOINT_NEWTRAJ': 2, 'SEG_INITPOINT_UNSET': 0}
- endpoint_types = {'SEG_ENDPOINT_CONTINUES': 1, 'SEG_ENDPOINT_MERGED': 2, 'SEG_ENDPOINT_RECYCLED': 3, 'SEG_ENDPOINT_UNSET': 0}
- status_names = {0: 'SEG_STATUS_UNSET', 1: 'SEG_STATUS_PREPARED', 2: 'SEG_STATUS_COMPLETE', 3: 'SEG_STATUS_FAILED'}
- initpoint_type_names = {0: 'SEG_INITPOINT_UNSET', 1: 'SEG_INITPOINT_CONTINUES', 2: 'SEG_INITPOINT_NEWTRAJ'}
- endpoint_type_names = {0: 'SEG_ENDPOINT_UNSET', 1: 'SEG_ENDPOINT_CONTINUES', 2: 'SEG_ENDPOINT_MERGED', 3: 'SEG_ENDPOINT_RECYCLED'}
- static initial_pcoord(segment)
Return the initial progress coordinate point of this segment.
- static final_pcoord(segment)
Return the final progress coordinate point of this segment.
- property initpoint_type
- property initial_state_id
- property status_text
- property endpoint_type_text
- class westpa.oldtools.aframe.data_reader.AnalysisMixin
Bases:
object
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- westpa.oldtools.aframe.data_reader.parse_int_list(list_string)
Parse a simple list consisting of integers or ranges of integers separated by commas. Ranges are specified as min:max, and include the maximum value (unlike Python’s
range
). Duplicate values are ignored. Returns the result as a sorted list. Raises ValueError if the list cannot be parsed.
- class westpa.oldtools.aframe.data_reader.WESTDataReaderMixin
Bases:
AnalysisMixin
A mixin for analysis requiring access to the HDF5 files generated during a WEST run.
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- clear_run_cache()
- property cache_pcoords
Whether or not to cache progress coordinate data. While caching this data can significantly speed up some analysis operations, this requires copious RAM.
Setting this to False when it was formerly True will release any cached data.
- get_summary_table()
- get_iter_group(n_iter)
Return the HDF5 group corresponding to
n_iter
- get_segments(n_iter, include_pcoords=True)
Return all segments present in iteration n_iter
- get_segments_by_id(n_iter, seg_ids, include_pcoords=True)
Get segments from the data manager, employing caching where possible
- get_children(segment, include_pcoords=True)
- get_seg_index(n_iter)
- get_wtg_parent_array(n_iter)
- get_parent_array(n_iter)
- get_pcoord_array(n_iter)
- get_pcoord_dataset(n_iter)
- get_pcoords(n_iter, seg_ids)
- get_seg_ids(n_iter, bool_array=None)
- get_created_seg_ids(n_iter)
Return a list of seg_ids corresponding to segments which were created for the given iteration (are not continuations).
- max_iter_segs_in_range(first_iter, last_iter)
Return the maximum number of segments present in any iteration in the range selected
- total_segs_in_range(first_iter, last_iter)
Return the total number of segments present in all iterations in the range selected
- get_pcoord_len(n_iter)
Get the length of the progress coordinate array for the given iteration.
- get_total_time(first_iter=None, last_iter=None, dt=None)
Return the total amount of simulation time spanned between first_iter and last_iter (inclusive).
- class westpa.oldtools.aframe.data_reader.ExtDataReaderMixin
Bases:
AnalysisMixin
An external data reader, primarily designed for reading brute force data, but also suitable for any auxiliary datasets required for analysis.
- default_chunksize = 8192
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- is_npy(filename)
- load_npy_or_text(filename)
Load an array from an existing .npy file, or read a text file and convert to a NumPy array. In either case, return a NumPy array. If a pickled NumPy dataset is found, memory-map it read-only. If the specified file does not contain a pickled NumPy array, attempt to read the file using numpy.loadtxt(filename).
- text_to_h5dataset(fileobj, group, dsname, dtype=<class 'numpy.float64'>, skiprows=0, usecols=None, chunksize=None)
Read text-format data from the given filename or file-like object
fileobj
and write to a newly-created dataset calleddsname
in the HDF5 groupgroup
. The data is stored as typedtype
. By default, the shape is taken as (number of lines, number of columns); columns can be omitted by specifying a list forusecols
, and lines can be skipped by usingskiprows
. Data is read in chunks ofchunksize
rows.
- npy_to_h5dataset(array, group, dsname, usecols=None, chunksize=None)
Store the given array into a newly-created dataset named
dsname
in the HDF5 groupgroup
, optionally only storing a subset of columns. Data is writtenchunksize
rows at a time, allowing very large memory-mapped arrays to be copied.
- class westpa.oldtools.aframe.data_reader.BFDataManager
Bases:
AnalysisMixin
A class to manage brute force trajectory data. The primary purpose is to read in and manage brute force progress coordinate data for one or more trajectories. The trajectories need not be the same length, but they do need to have the same time spacing for progress coordinate values.
- traj_index_dtype = dtype([('pcoord_len', '<u8'), ('source_data', 'O')])
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- update_traj_index(traj_id, pcoord_len, source_data)
- get_traj_group(traj_id)
- create_traj_group()
- get_n_trajs()
- get_traj_len(traj_id)
- get_max_traj_len()
- get_pcoord_array(traj_id)
- get_pcoord_dataset(traj_id)
- require_bf_h5file()
- close_bf_h5file()
westpa.oldtools.aframe.iter_range module
- class westpa.oldtools.aframe.iter_range.AnalysisMixin
Bases:
object
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- exception westpa.oldtools.aframe.iter_range.ArgumentError(*args, **kwargs)
Bases:
RuntimeError
- class westpa.oldtools.aframe.iter_range.IterRangeMixin
Bases:
AnalysisMixin
A mixin for limiting the range of data considered for a given analysis. This should go after DataManagerMixin
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- check_iter_range()
- iter_block_iter()
Return an iterable of (block_first,block_last+1) over the blocks of iterations selected by –first/–last/–step. NOTE WELL that the second of the pair follows Python iterator conventions and returns one past the last element of the block.
- n_iter_blocks()
Return the number of blocks of iterations (as returned by
iter_block_iter
) selected by –first/–last/–step.
- record_data_iter_range(h5object, first_iter=None, last_iter=None)
Store attributes
first_iter
andlast_iter
on the given HDF5 object (group/dataset)
- record_data_iter_step(h5object, iter_step=None)
Store attribute
iter_step
on the given HDF5 object (group/dataset).
- check_data_iter_range_least(h5object, first_iter=None, last_iter=None)
Check that the given HDF5 object contains (as denoted by its
first_iter
/last_iter
attributes) at least the data range specified.
- check_data_iter_range_equal(h5object, first_iter=None, last_iter=None)
Check that the given HDF5 object contains per-iteration data for exactly the specified iterations (as denoted by the object’s
first_iter
andlast_iter
attributes
- check_data_iter_step_conformant(h5object, iter_step=None)
Check that the given HDF5 object contains per-iteration data at an iteration stride suitable for extracting data with the given stride. (In other words, is the given
iter_step
a multiple of the stride with which data was recorded.)
- check_data_iter_step_equal(h5object, iter_step=None)
Check that the given HDF5 object contains per-iteration data at an iteration stride the same as that specified.
- slice_per_iter_data(dataset, first_iter=None, last_iter=None, iter_step=None, axis=0)
Return the subset of the given dataset corresponding to the given iteration range and stride. Unless otherwise specified, the first dimension of the dataset is the one sliced.
- iter_range(first_iter=None, last_iter=None, iter_step=None)
westpa.oldtools.aframe.kinetics module
- class westpa.oldtools.aframe.kinetics.AnalysisMixin
Bases:
object
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- class westpa.oldtools.aframe.kinetics.KineticsAnalysisMixin
Bases:
AnalysisMixin
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- parse_bin_range(range_string)
- check_bin_selection(n_bins=None)
Check to see that the bin ranges selected by the user conform to the available bins (i.e., bin indices are within the permissible range). Also assigns the complete bin range if the user has not explicitly limited the bins to be considered.
- property selected_bin_pair_iter
westpa.oldtools.aframe.mcbs module
Tools for Monte Carlo bootstrap error analysis
- class westpa.oldtools.aframe.mcbs.AnalysisMixin
Bases:
object
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- class westpa.oldtools.aframe.mcbs.MCBSMixin
Bases:
AnalysisMixin
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- calc_mcbs_nsets(alpha=None)
- calc_ci_bound_indices(n_sets=None, alpha=None)
- westpa.oldtools.aframe.mcbs.calc_mcbs_nsets(alpha)
Return a bootstrap data set size appropriate for the given confidence level.
- westpa.oldtools.aframe.mcbs.calc_ci_bound_indices(n_sets, alpha)
- westpa.oldtools.aframe.mcbs.bootstrap_ci_ll(estimator, data, alpha, n_sets, storage, sort, eargs=(), ekwargs={}, fhat=None)
Low-level routine for calculating bootstrap error estimates. Arguments and return values are as those for
bootstrap_ci
, except that no argument is optional except additional arguments for the estimator (eargs
,ekwargs
).data
must be an array (or subclass), and an additional arraystorage
must be provided, which must be appropriately shaped and typed to holdn_sets
results fromestimator
. Further, if the valuefhat
of the estimator must be pre-calculated to allocatestorage
, then its value may be passed; otherwise,estimator(data,*eargs,**kwargs)
will be called to calculate it.
- westpa.oldtools.aframe.mcbs.bootstrap_ci(estimator, data, alpha, n_sets=None, sort=<function msort>, eargs=(), ekwargs={})
Perform a Monte Carlo bootstrap of a (1-alpha) confidence interval for the given
estimator
. Returns (fhat, ci_lower, ci_upper), where fhat is the result ofestimator(data, *eargs, **ekwargs)
, andci_lower
andci_upper
are the lower and upper bounds of the surrounding confidence interval, calculated by callingestimator(syndata, *eargs, **ekwargs)
on each synthetic data setsyndata
. Ifn_sets
is provided, that is the number of synthetic data sets generated, otherwise an appropriate size is selected automatically (seecalc_mcbs_nsets()
).sort
, if given, is applied to sort the results of callingestimator
on each synthetic data set prior to obtaining the confidence interval. This function must sort on the last index.Individual entries in synthetic data sets are selected by the first index of
data
, allowing this function to be used on arrays of multidimensional data.Returns (fhat, lb, ub, ub-lb, abs((ub-lb)/fhat), and max(ub-fhat,fhat-lb)) (that is, the estimated value, the lower and upper bounds of the confidence interval, the width of the confidence interval, the relative width of the confidence interval, and the symmetrized error bar of the confidence interval).
westpa.oldtools.aframe.output module
- class westpa.oldtools.aframe.output.AnalysisMixin
Bases:
object
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- class westpa.oldtools.aframe.output.CommonOutputMixin
Bases:
AnalysisMixin
- add_common_output_args(parser_or_group)
- process_common_output_args(args)
westpa.oldtools.aframe.plotting module
- class westpa.oldtools.aframe.plotting.AnalysisMixin
Bases:
object
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- class westpa.oldtools.aframe.plotting.PlottingMixin
Bases:
AnalysisMixin
- require_matplotlib()
westpa.oldtools.aframe.trajwalker module
- class westpa.oldtools.aframe.trajwalker.TrajWalker(data_reader, history_chunksize=100)
Bases:
object
A class to perform analysis by walking the trajectory tree. A stack is used rather than recursion, or else the highest number of iterations capable of being considered would be the same as the Python recursion limit.
- trace_to_root(n_iter, seg_id)
Trace the given segment back to its starting point, returning a list of Segment objects describing the entire trajectory.
- get_trajectory_roots(first_iter, last_iter, include_pcoords=True)
Get segments which start new trajectories. If min_iter or max_iter is specified, restrict the set of iterations within which the search is conducted.
- get_initial_nodes(first_iter, last_iter, include_pcoords=True)
Get segments with which to begin a tree walk – those alive or created within [first_iter,last_iter].
- trace_trajectories(first_iter, last_iter, callable, include_pcoords=True, cargs=None, ckwargs=None, get_state=None, set_state=None)
- Walk the trajectory tree depth-first, calling
callable(segment, children, history, *cargs, **ckwargs)
for each segment
visited.
segment
is the segment being visited,children
is that segment’s children,history
is the chain of segments leading tosegment
(not includingsegment
). get_state and set_state are used to record and reset, respectively, any state specific tocallable
when a new branch is traversed.
westpa.oldtools.aframe.transitions module
- class westpa.oldtools.aframe.transitions.AnalysisMixin
Bases:
object
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- class westpa.oldtools.aframe.transitions.TrajWalker(data_reader, history_chunksize=100)
Bases:
object
A class to perform analysis by walking the trajectory tree. A stack is used rather than recursion, or else the highest number of iterations capable of being considered would be the same as the Python recursion limit.
- trace_to_root(n_iter, seg_id)
Trace the given segment back to its starting point, returning a list of Segment objects describing the entire trajectory.
- get_trajectory_roots(first_iter, last_iter, include_pcoords=True)
Get segments which start new trajectories. If min_iter or max_iter is specified, restrict the set of iterations within which the search is conducted.
- get_initial_nodes(first_iter, last_iter, include_pcoords=True)
Get segments with which to begin a tree walk – those alive or created within [first_iter,last_iter].
- trace_trajectories(first_iter, last_iter, callable, include_pcoords=True, cargs=None, ckwargs=None, get_state=None, set_state=None)
- Walk the trajectory tree depth-first, calling
callable(segment, children, history, *cargs, **ckwargs)
for each segment
visited.
segment
is the segment being visited,children
is that segment’s children,history
is the chain of segments leading tosegment
(not includingsegment
). get_state and set_state are used to record and reset, respectively, any state specific tocallable
when a new branch is traversed.
- class westpa.oldtools.aframe.transitions.TransitionEventAccumulator(n_bins, output_group, calc_fpts=True)
Bases:
object
- index_dtype
alias of
uint64
- count_dtype
alias of
uint64
- weight_dtype
alias of
float64
- output_tdat_chunksize = 4096
- tdat_buffersize = 524288
- max_acc = 32768
- clear()
- clear_state()
- get_state()
- set_state(state_dict)
- record_transition_data(tdat)
Update running statistics and write transition data to HDF5 (with buffering)
- flush_transition_data()
Flush any unwritten output that may be present
- start_accumulation(assignments, weights, bin_pops, traj=0, n_iter=0)
- continue_accumulation(assignments, weights, bin_pops, traj=0, n_iter=0)
- class westpa.oldtools.aframe.transitions.TransitionAnalysisMixin
Bases:
AnalysisMixin
- require_transitions_group()
- delete_transitions_group()
- get_transitions_ds()
- add_args(parser, upcall=True)
- process_args(args, upcall=True)
- require_transitions()
- find_transitions()
- class westpa.oldtools.aframe.transitions.BFTransitionAnalysisMixin
Bases:
TransitionAnalysisMixin
- require_transitions()
- find_transitions(chunksize=65536)