Submodules¶
bngl_utils¶
Submodule bngl_utils provides a function to load parameters from a BNGL file.
Methods:¶
load_bngl_parameters (file_name: str, parameter_overrides: Dict[str, float]=None) -> Dict[str, float]¶
Load parameters section from a BNGL file and return it as a dictionary name->value.
- file_name: strPath to the BNGL file to be loaded.
- parameter_overrides: Dict[str, float] = NoneFor each key k in the parameter_overrides, if it is defined in the BNGL’s parameters section,its value is ignored and instead value parameter_overrides[k] is used.Example: 2010_bng_parameter_override/model.py
data_utils¶
Submodule data_utils provides data loading and manipulation functions.
Methods:¶
load_dat_file (file_name: str) -> List[List[float]]¶
Loads a two-column file where the first column is usually time and the second is afloating point value. Returns a two-column list.Can be used to load a file with variable rate constants.
- file_name: strPath to the .dat file to be loaded.
geometry_utils¶
Submodule geometry_utils provides several functions to define model geometry. Rather limited for now.
Methods:¶
create_box (name: str, edge_dimension: float=None, xyz_dimensions: List[float]=None) -> GeometryObject¶
Creates a GeometryObject in the shape of a cube whose center is at (0, 0, 0).
- name: strName of the created geometry object.
- edge_dimension: float = NoneSpecifies length of each edge of the box in um.None of x/y/z dimensions can be set.
- xyz_dimensions: List[float] = NoneSpecifies x/y/z sizes of the box in um. Parameter edge_dimension must not be set.
create_icosphere (name: str, radius: float, subdivisions: int) -> GeometryObject¶
Creates a GeometryObject in the shape of an icosphere whose center is at (0, 0, 0).
- name: strName of the created geometry object.
- radius: floatSpecifies radius of the sphere.
- subdivisions: intNumber of subdivisions from the initial icosphere.The higher this value will be the smoother the icosphere will be.Allowed range is between 1 and 8.
validate_volumetric_mesh (model: Model, geometry_object: GeometryObject)¶
Checks that the mesh was correctly analyzed, that it has volume andall edges have neighboring walls.Must be called after model initialization.Throws exception with detained message if validation did not pass.
- model: ModelModel object after initialization.
- geometry_object: GeometryObjectGeometry object to be checked.
run_utils¶
Submodule run_utils provides functions used by checkpointing.
Methods:¶
get_last_checkpoint_dir (seed: int) -> str¶
Searches the directory checkpoints for the last checkpoint for the givenparameters and returns the directory name if such a directory exists.Returns empty string if no checkpoint directory was found.Currently supports only the seed argument.
- seed: int
remove_cwd (paths: List[str]) -> List[str]¶
Removes all directory names items pointing to the current working directory from a list andreturns a new list.
- paths: List[str]