simloaderbyfield.py

class SimLoaderByField(load_dir, coords_file, time_step_file, node_field_files, connect_files=None, glob_file=None, glob_slices=None, load_opts=None)[source]

Bases: IOutputLoader

Class for loading simulation data (i.e. a SimData object) from a series of plain text delimited files or binary numpy npy files.

Implements the IOutputLoader interface.

__init__(load_dir, coords_file, time_step_file, node_field_files, connect_files=None, glob_file=None, glob_slices=None, load_opts=None)[source]
Parameters:
  • load_dir (Path) – Directory to load the simulation data files from.

  • coords_file (str | Path | None) – String or full path specifying the coordinates file. If None then no coordinates are loaded and they can be manually specified in the SimData object.

  • time_step_file (str | Path | None) – String or full path to the file containing the simulation time steps. If None then no time step file is loaded and the time steps can be manually specified in the SimData object.

  • node_field_files (dict[str,str] | None) – Dicitionary keyed by the node field variable name where the value is the file name for that field variable to be found in the load directory. If None then no nodal field variables are loaded.

  • connect_files (str | list[str] | None, optional) – Wildcard pattern specifying how to identify connectivity files in the load directory or list of strings for the connectivity files, by default None. If None then no connectivity tables are loaded.

  • glob_file (str | None, optional) – File name for the global variables file in the load directory, by default None. If None then global variables are not loaded.

  • glob_slices (dict[str,slice] | None, optional) – Dictionary keyed with the global variable names with slices specifying which columns to extract for the given global variable, by default None. If None then no global variables are loaded.

  • load_opts (SimLoadOpts | None, optional) – Options for loading the simulation data including the number of threads for using multi-processing to load field files, by default None. If None then a default load options dataclass is created.

Raises:

SimLoadErr – The specified load directory is not a directory.

load_sim_data(load_config)[source]

Loads the simulation data object based on the specified config.

Parameters:

load_config (SimLoadConfig) – Configuration specifying which parts of the SimData object to load.

Returns:

SimData – The SimData object assembled from loading files from disk.

load_all_sim_data()[source]

Loads all simulation data into a SimData object.

Returns:

SimData – The SimData object assembled from loading files from disk.