wrfhydropy.CycleSimulation¶
-
class
wrfhydropy.CycleSimulation(init_times: list, restart_dirs: list, forcing_dirs: list = [], ncores: int = 1)[source]¶ Class for a WRF-Hydro CycleSimulation object. The Cycle Simulation object is used to orchestrate a set of ‘N’ WRF-Hydro simulations, referred to as ‘casts’, which only differ in their 1) restart times and 2) their forcings.
Methods
add(self, obj, …)Add an approparite object to an CycleSimulation, such as a Simulation, Job, or Scheduler. compose(self, symlink_domain, force, …)Cycle compose (directories and files to disk) :Parameters: * symlink_domain – Symlink the domain files rather than copy * force – Compose into directory even if not empty. pickle(self, path)Pickle ensemble sim object to specified file path :Parameters: path – The file path for pickle rm_casts(self)Remove members from memory, replace with their paths. run(self, n_concurrent, teams, …)Run the cycle of simulations. -
__init__(self, init_times:list, restart_dirs:list, forcing_dirs:list=[], ncores:int=1)[source]¶ Instantiate a Cycle object. :Parameters: * init_times – A required list of datetime.datetime objects which specify the
restart time of each cast in the cycle. (Same for deterministic and ensemble cycle simultions).restart_dirs – Deterministic: a required list of either strings or pathlib.Path objects. Ensemble: a required list of lists. The outer list is for the cycles
“casts” requested in init_times. The inner list is for each ensemble member in the cast.
The following rules are applied to the individual entires: 1) A dot or a null string (are identical pathlib.Path objects and) mean
“do nothing” with respect to the default path in the domain.
- An existing path/file is used/kept (a non-existent path is not, gives an error).
- A negative integer in units hours, pointing to a previous cast in the cycle.
- Other wise, value error raised.
forcing_dirs – optional Deterministic: list of either strings or pathlib.Path objects Ensemble: A list of lists, as for restart_dirs. See restart_dirs for usage rules.
ncores – integer number of cores for running parallelizable methods (not the casts themselves). For an ensemble cycle, setting this value > 1 will force the ensemble.ncores = 1.
Methods
__init__(self, init_times, restart_dirs, …)Instantiate a Cycle object. add(self, obj, …)Add an approparite object to an CycleSimulation, such as a Simulation, Job, or Scheduler. compose(self, symlink_domain, force, …)Cycle compose (directories and files to disk) :Parameters: * symlink_domain – Symlink the domain files rather than copy * force – Compose into directory even if not empty. pickle(self, path)Pickle ensemble sim object to specified file path :Parameters: path – The file path for pickle rm_casts(self)Remove members from memory, replace with their paths. run(self, n_concurrent, teams, …)Run the cycle of simulations. -