Skip to content

Commit 471875b

Browse files
committed
Merge branch 'develop' into refactor-coupling
2 parents 61b70ec + 3e96c3a commit 471875b

3 files changed

Lines changed: 33 additions & 4 deletions

File tree

micro_manager/interpolation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def compute_rbf_interpolant(
320320
dst_size = f.shape[-1]
321321

322322
r = np.linalg.norm(x[None, :, :] - x[:, None, :], ord=2, axis=-1)
323-
# compute lin and const term
323+
# compute linear and constant terms
324324
b = np.zeros((src_size + 1, dst_size))
325325
p = np.zeros((n_points, src_size + 1))
326326
p[:, 0] = 1

micro_manager/model_manager.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,32 @@ class ModelManager:
4646
"""
4747

4848
def __init__(self, logger: Logger):
49+
"""
50+
Constructor for the ModelManager.
51+
52+
Parameters
53+
----------
54+
logger: Logger
55+
Logger to be used by the ModelManager and the created micro simulation classes.
56+
"""
4957
self._registered_classes: list[MicroSimulationClass] = []
5058
self._stateless_map: dict[MicroSimulationClass, bool] = dict()
5159
self._backend_map: dict[MicroSimulationClass, MicroSimulationInterface] = dict()
5260
self._logger: Logger = logger
5361

5462
def load_models(self, config: Config, n_workers: int, conn_workers: Optional[Any]):
63+
"""
64+
Loads the micro simulation classes specified in the config.
65+
66+
Parameters
67+
----------
68+
config: Config
69+
Config object.
70+
n_workers: int
71+
Number of workers to be used for the micro simulations, used for initialization of the micro simulation classes.
72+
conn_workers: Optional[Any]
73+
Connection to workers, used for initialization of the micro simulation classes.
74+
"""
5575
stateless_flags = config.micro_stateless_flags()
5676
for idx, model_file in enumerate(config.micro_file_names()):
5777
try:
@@ -74,6 +94,7 @@ def load_models(self, config: Config, n_workers: int, conn_workers: Optional[Any
7494
def register(self, micro_sim_cls: MicroSimulationClass, stateless: bool):
7595
"""
7696
Register a micro simulation class to create an instance of it later.
97+
If a model is stateless, it will be initialized once and stored in the backend map, so that all instances of this model will delegate to the same compute instance.
7798
7899
Parameters
79100
----------
@@ -95,6 +116,14 @@ def register(self, micro_sim_cls: MicroSimulationClass, stateless: bool):
95116

96117
@property
97118
def num_models(self) -> int:
119+
"""
120+
Returns the number of registered micro simulation classes.
121+
122+
Returns
123+
-------
124+
num_models: int
125+
Number of registered micro simulation classes.
126+
"""
98127
return len(self._registered_classes)
99128

100129
def get_cls_by_name(self, name: str) -> MicroSimulationClass:

micro_manager/tools/spatial_methods.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,9 +880,9 @@ def dim_extend(a):
880880

881881
def decompose(self) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
882882
"""
883-
Decomposes the domain, by conceptually merging all support and query points across all rank
884-
and splitting the query points, s.t. each rank will have approx the same amount of query points.
885-
Support points alongside their function values are distributed to the respective ranks, that query points
883+
Decomposes the domain by conceptually merging all support and query points across all ranks
884+
and splitting the query points such that each rank will have approximately the same amount of query points.
885+
Support points alongside their function values are distributed to the respective ranks, so that query points
886886
are surrounded by sufficient support points.
887887
888888
Returns

0 commit comments

Comments
 (0)