pytrnsys_process.process.process_batch.process_single_simulation#

pytrnsys_process.process.process_batch.process_single_simulation(sim_folder: Path, processing_scenarios: Callable[[Simulation], None] | Sequence[Callable[[Simulation], None]]) Simulation[source]#

Process a single simulation folder using the provided processing scenario(s).

Parameters:
  • sim_folder – Path to the simulation folder to process

  • processing_scenarios – Single callable or sequence of callables that implement the processing logic for a simulation. Each callable should take a Simulation object as its only parameter.

Return type:

Simulation object containing the processed data

Example

>>> from process import data_structures            >>> import pathlib as _pl
>>> from pytrnsys_process import api
...
>>> def processing_step_1(sim: data_structures.Simulation):
...     # Process simulation data
...     pass
>>> results = api.process_single_simulation(
...     _pl.Path("path/to/simulation"),
...     processing_step_1
... )