base_output_handler
Base class for output handler components.
Subclasses should implement the write method.
BaseOutputHandler
Bases: BaseKwargsHandler, ABC
Base class for output handler components.
Attributes:
| Name | Type | Description |
|---|---|---|
settings_class |
The settings class for this output handler. |
|
supported_kwargs |
The full set of supported keyword arguments for the |
|
required_kwargs |
The set of required keyword arguments for the |
Methods:
| Name | Description |
|---|---|
check_if_samples_are_empty |
Checks if the given samples array is empty. |
find_missing_required_kwargs |
Validates that all required keyword arguments are present. |
build_settings_from_kwargs |
Validates the keyword arguments and builds the settings object. |
write |
Write the generated samples to a file or other storage. |
Source code in src/mada_tools/simulation/simutils/samples/output/base_output_handler.py
check_if_samples_are_empty(samples)
Checks if the given samples array is empty.
Raises:
| Type | Description |
|---|---|
ValueError
|
If samples have not been generated yet. |
Source code in src/mada_tools/simulation/simutils/samples/output/base_output_handler.py
write(samples, **kwargs)
abstractmethod
Write the generated samples to a file or other storage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
samples
|
ndarray
|
The generated samples. |
required |
**kwargs
|
Dict[str, Any]
|
Additional keyword arguments for output configuration. This will vary by implementation. We use kwargs as each output handler may require different parameters. |
{}
|
Returns:
| Type | Description |
|---|---|
SampleOutputResult
|
A SampleOutputResult object containing the output path, output type, and run instances. |