westpa.westext.stringmethod package
Submodules
westpa.westext.stringmethod.fourier_fitting module
westpa.westext.stringmethod.string_driver module
- class westpa.westext.stringmethod.string_driver.VoronoiBinMapper(dfunc, centers, dfargs=None, dfkwargs=None)
Bases:
BinMapper
A one-dimensional mapper which assigns a multidimensional pcoord to the closest center based on a distance metric. Both the list of centers and the distance function must be supplied.
- assign(coords, mask=None, output=None)
- westpa.westext.stringmethod.string_driver.check_bool(value, action='warn')
Check that the given
value
is boolean in type. If not, either raise a warning (ifaction=='warn'
) or an exception (action=='raise'
).
- exception westpa.westext.stringmethod.string_driver.ConfigItemMissing(key, message=None)
Bases:
KeyError
- class westpa.westext.stringmethod.string_driver.WESTStringMethod(centers, **kwargs)
Bases:
object
- abstract property centers
Return the centers of all of the strings
- abstract property length
Return a list of the lengths of each string
- abstractmethod update_string_centers(avgcoords, binprob)
Given a set of average coordinates (avgcoords) in each bin and the individual probabilities for each bin (binprob), update the string centers
- class westpa.westext.stringmethod.string_driver.DefaultStringMethod(centers, slen=None, slabels=None, mpairs=None, dtau=0.1, kappa=0.1, sciflag=None, fixed_ends=True, fourierflag=False, fourier_P=2, fourier_maxiters=100, fourier_tol=1e-06, **kwargs)
Bases:
WESTStringMethod
Implementation of a method to evolve one or more pseudo-1D strings in a high dimensional progress coordinate space.
Parameters centers: A numpy array of size (number of total centers,pcoord dim) that stores
the positions of all of the string images
slen: An iterable containing the number of centers in each string slabels: An list containing the relative positions in each string of any state label
progress coordinates if present. These progress coordinates will be ignored in the calculation. None if no labels
- mpairs: A list of lists containing the indices of pairs of centers that should move together.
None if strings move independently
dtau: Parameter controlling the rate at which centers move toward the average value in the bin kappa: Parameter controlling the smoothing of the string fixed_ends: Boolean flag specifying whether to fix ends of the strings sciflag: Boolean flag specifying whether to attempt to use scipy methods which are
generally more efficient
fourierflag: Boolean flag specifying whether to user fourier fitting method fourier_P: Integer value specifying how many fourier modes to use in fitting fourier_maxiters: Maximum number of iterations of fourier fitting procedure fourier_tol: Tolerance for ending fourier fitting
- calculate_length(x)
- property centers
Return the centers of all of the strings
- finalize_init()
- property length
Return a list of the lengths of each string
- update_string_centers(avgcoords, binprob)
Update the position of all string centers Parameters avgcoords: Average position of replicas in each voronoi cell binprob: The total weight in each voronoi cell
- class westpa.westext.stringmethod.string_driver.StringDriver(sim_manager, plugin_config)
Bases:
object
- dfunc()
- get_avgpos(n_iter)
- get_dfunc_method(plugin_config)
- get_avgpos_method(plugin_config)
- get_string_method(plugin_config)
- get_initial_centers()
- update_bin_mapper()
Update the bin_mapper using the current string
- avgpos_cartesian(n_iter)
Get average position of replicas in each bin as of n_iter for the the user selected update interval
- prepare_new_iteration()
westpa.westext.stringmethod.string_method module
- class westpa.westext.stringmethod.string_method.ABCMeta(name, bases, namespace, /, **kwargs)
Bases:
type
Metaclass for defining Abstract Base Classes (ABCs).
Use this metaclass to create an ABC. An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as ‘virtual subclasses’ – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).
- register(subclass)
Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
- westpa.westext.stringmethod.string_method.abstractmethod(funcobj)
A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods are overridden. The abstract methods can be called using any of the normal ‘super’ call mechanisms. abstractmethod() may be used to declare abstract methods for properties and descriptors.
Usage:
- class C(metaclass=ABCMeta):
@abstractmethod def my_abstract_method(self, arg1, arg2, argN):
…
- class westpa.westext.stringmethod.string_method.abstractproperty(fget=None, fset=None, fdel=None, doc=None)
Bases:
property
A decorator indicating abstract properties.
Deprecated, use ‘property’ with ‘abstractmethod’ instead:
- class C(ABC):
@property @abstractmethod def my_abstract_property(self):
…
- class westpa.westext.stringmethod.string_method.Iterable
Bases:
object
- class westpa.westext.stringmethod.string_method.FourierFit(P=2, ndims=2, maxiters=100, tol=1e-06)
Bases:
object
- calc_string(w, t, x_meas)
- optimize(data, weight, w0, t0)
- class westpa.westext.stringmethod.string_method.WESTStringMethod(centers, **kwargs)
Bases:
object
- abstract property centers
Return the centers of all of the strings
- abstract property length
Return a list of the lengths of each string
- abstractmethod update_string_centers(avgcoords, binprob)
Given a set of average coordinates (avgcoords) in each bin and the individual probabilities for each bin (binprob), update the string centers
- class westpa.westext.stringmethod.string_method.DefaultStringMethod(centers, slen=None, slabels=None, mpairs=None, dtau=0.1, kappa=0.1, sciflag=None, fixed_ends=True, fourierflag=False, fourier_P=2, fourier_maxiters=100, fourier_tol=1e-06, **kwargs)
Bases:
WESTStringMethod
Implementation of a method to evolve one or more pseudo-1D strings in a high dimensional progress coordinate space.
Parameters centers: A numpy array of size (number of total centers,pcoord dim) that stores
the positions of all of the string images
slen: An iterable containing the number of centers in each string slabels: An list containing the relative positions in each string of any state label
progress coordinates if present. These progress coordinates will be ignored in the calculation. None if no labels
- mpairs: A list of lists containing the indices of pairs of centers that should move together.
None if strings move independently
dtau: Parameter controlling the rate at which centers move toward the average value in the bin kappa: Parameter controlling the smoothing of the string fixed_ends: Boolean flag specifying whether to fix ends of the strings sciflag: Boolean flag specifying whether to attempt to use scipy methods which are
generally more efficient
fourierflag: Boolean flag specifying whether to user fourier fitting method fourier_P: Integer value specifying how many fourier modes to use in fitting fourier_maxiters: Maximum number of iterations of fourier fitting procedure fourier_tol: Tolerance for ending fourier fitting
- property centers
Return the centers of all of the strings
- property length
Return a list of the lengths of each string
- calculate_length(x)
- finalize_init()
- update_string_centers(avgcoords, binprob)
Update the position of all string centers Parameters avgcoords: Average position of replicas in each voronoi cell binprob: The total weight in each voronoi cell
Module contents
westext.stringmethod - Plugin to drive the adaptive evolution of one or more strings of Voronoi bins
Joshua L. Adelman 2011
- class westpa.westext.stringmethod.DefaultStringMethod(centers, slen=None, slabels=None, mpairs=None, dtau=0.1, kappa=0.1, sciflag=None, fixed_ends=True, fourierflag=False, fourier_P=2, fourier_maxiters=100, fourier_tol=1e-06, **kwargs)
Bases:
WESTStringMethod
Implementation of a method to evolve one or more pseudo-1D strings in a high dimensional progress coordinate space.
Parameters centers: A numpy array of size (number of total centers,pcoord dim) that stores
the positions of all of the string images
slen: An iterable containing the number of centers in each string slabels: An list containing the relative positions in each string of any state label
progress coordinates if present. These progress coordinates will be ignored in the calculation. None if no labels
- mpairs: A list of lists containing the indices of pairs of centers that should move together.
None if strings move independently
dtau: Parameter controlling the rate at which centers move toward the average value in the bin kappa: Parameter controlling the smoothing of the string fixed_ends: Boolean flag specifying whether to fix ends of the strings sciflag: Boolean flag specifying whether to attempt to use scipy methods which are
generally more efficient
fourierflag: Boolean flag specifying whether to user fourier fitting method fourier_P: Integer value specifying how many fourier modes to use in fitting fourier_maxiters: Maximum number of iterations of fourier fitting procedure fourier_tol: Tolerance for ending fourier fitting
- calculate_length(x)
- property centers
Return the centers of all of the strings
- finalize_init()
- property length
Return a list of the lengths of each string
- update_string_centers(avgcoords, binprob)
Update the position of all string centers Parameters avgcoords: Average position of replicas in each voronoi cell binprob: The total weight in each voronoi cell
- class westpa.westext.stringmethod.WESTStringMethod(centers, **kwargs)
Bases:
object
- abstract property centers
Return the centers of all of the strings
- abstract property length
Return a list of the lengths of each string
- abstractmethod update_string_centers(avgcoords, binprob)
Given a set of average coordinates (avgcoords) in each bin and the individual probabilities for each bin (binprob), update the string centers
- class westpa.westext.stringmethod.StringDriver(sim_manager, plugin_config)
Bases:
object
- avgpos_cartesian(n_iter)
Get average position of replicas in each bin as of n_iter for the the user selected update interval
- dfunc()
- get_avgpos(n_iter)
- get_avgpos_method(plugin_config)
- get_dfunc_method(plugin_config)
- get_initial_centers()
- get_string_method(plugin_config)
- prepare_new_iteration()
- update_bin_mapper()
Update the bin_mapper using the current string