Storage#

get_all_iterations(output_path: Path | None = None) ndarray#

Obtain all iterations for the given path. Will sort results in ascending order.

Parameters:

output_path (Path) – Folder of stored results. If not specified, we obtain it via the get_last_output_path function.

Returns:

iterations – Numpy array containing all iterations.

Return type:

np.ndarray

Raises:

ValueError: – See get_last_output_path.

get_last_output_path(search_path: Path = PosixPath('out/cr_trichome')) Path#

We usually expect a file structure of the form:

out
└── cr_trichome
    ├── 2024-07-31-T17-34-27
    ├── 2024-07-31-T17-34-40
    ├── 2024-07-31-T17-34-50
    └── 2024-07-31-T17-34-57

This function will now obtain the most recent output path.

>>> get_last_output_path()
Path("out/cr_trichome/2024-07-31-T17-34-57")
Parameters:

search_path (Path) – The folder in which to search.

Returns:

path – The last simulation path.

Return type:

Path

Raises:

ValueError: – If search_path does not contain any folders.

load_cells(iteration: int, output_path: Path | None = None) DataFrame#

Loads all cells from a given iteration at the specified output path.

Parameters:
  • iteration (int) – Iteration number for which to load results.

  • output_path (Path | None = None) – Folder of stored results. If not specified, we obtain it via the get_last_output_path function.

Returns:

cells – Flattened dataframe with all values that make up the cell-agent.

Return type:

pd.DataFrame

Raises:

ValueError: – See get_last_output_path.