submodules.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. .. _api-submodules:
  2. **********
  3. Submodules
  4. **********
  5. bngl_utils
  6. ==========
  7. Submodule bngl_utils provides a function to load parameters from a BNGL file.
  8. Methods:
  9. *********
  10. .. _bngl_utils__load_bngl_parameters:
  11. load_bngl_parameters (file_name: str, parameter_overrides: Dict[str, float]=None) -> Dict[str, float]
  12. -----------------------------------------------------------------------------------------------------
  13. | Load parameters section from a BNGL file and return it as a dictionary name->value.
  14. * | file_name: str
  15. | Path to the BNGL file to be loaded.
  16. * | parameter_overrides: Dict[str, float] = None
  17. | For each key k in the parameter_overrides, if it is defined in the BNGL's parameters section,
  18. | its value is ignored and instead value parameter_overrides[k] is used.
  19. | Example: `2010_bng_parameter_override/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/pymcell4_positive/2010_bng_parameter_override/model.py>`_
  20. data_utils
  21. ==========
  22. Submodule data_utils provides data loading and manipulation functions.
  23. Methods:
  24. *********
  25. .. _data_utils__load_dat_file:
  26. load_dat_file (file_name: str) -> List[List[float]]
  27. ---------------------------------------------------
  28. | Loads a two-column file where the first column is usually time and the second is a
  29. | floating point value. Returns a two-column list.
  30. | Can be used to load a file with variable rate constants.
  31. * | file_name: str
  32. | Path to the .dat file to be loaded.
  33. geometry_utils
  34. ==============
  35. Submodule geometry_utils provides several functions to define
  36. model geometry. Rather limited for now.
  37. Methods:
  38. *********
  39. .. _geometry_utils__create_box:
  40. create_box (name: str, edge_dimension: float=None, xyz_dimensions: List[float]=None) -> GeometryObject
  41. ------------------------------------------------------------------------------------------------------
  42. | Creates a GeometryObject in the shape of a cube whose center is at (0, 0, 0).
  43. * | name: str
  44. | Name of the created geometry object.
  45. * | edge_dimension: float = None
  46. | Specifies length of each edge of the box in um.
  47. | None of x/y/z dimensions can be set.
  48. * | xyz_dimensions: List[float] = None
  49. | Specifies x/y/z sizes of the box in um. Parameter edge_dimension must not be set.
  50. | Examples: `1400_rel_site_for_each_it/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/pymcell4/1400_rel_site_for_each_it/model.py>`_ `1105_point_release_w_create_box_not_cube/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/pymcell4/1105_point_release_w_create_box_not_cube/model.py>`_
  51. .. _geometry_utils__create_icosphere:
  52. create_icosphere (name: str, radius: float, subdivisions: int) -> GeometryObject
  53. --------------------------------------------------------------------------------
  54. | Creates a GeometryObject in the shape of an icosphere whose center is at (0, 0, 0).
  55. * | name: str
  56. | Name of the created geometry object.
  57. * | radius: float
  58. | Specifies radius of the sphere.
  59. * | subdivisions: int
  60. | Number of subdivisions from the initial icosphere.
  61. | The higher this value will be the smoother the icosphere will be.
  62. | Allowed range is between 1 and 8.
  63. | Example: `1110_point_release_w_create_icosphere/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/pymcell4/1110_point_release_w_create_icosphere/model.py>`_
  64. .. _geometry_utils__validate_volumetric_mesh:
  65. validate_volumetric_mesh (model: Model, geometry_object: GeometryObject)
  66. ------------------------------------------------------------------------
  67. | Checks that the mesh was correctly analyzed, that it has volume and
  68. | all edges have neighboring walls.
  69. | Must be called after model initialization.
  70. | Throws exception with detained message if validation did not pass.
  71. * | model: Model
  72. | Model object after initialization.
  73. * | geometry_object: GeometryObject
  74. | Geometry object to be checked.
  75. run_utils
  76. =========
  77. Submodule run_utils provides functions used by checkpointing.
  78. Methods:
  79. *********
  80. .. _run_utils__get_last_checkpoint_dir:
  81. get_last_checkpoint_dir (seed: int) -> str
  82. ------------------------------------------
  83. | Searches the directory checkpoints for the last checkpoint for the given
  84. | parameters and returns the directory name if such a directory exists.
  85. | Returns empty string if no checkpoint directory was found.
  86. | Currently supports only the seed argument.
  87. * | seed: int
  88. .. _run_utils__remove_cwd:
  89. remove_cwd (paths: List[str]) -> List[str]
  90. ------------------------------------------
  91. | Removes all directory names items pointing to the current working directory from a list and
  92. | returns a new list.
  93. * | paths: List[str]