csv_output_handler
The CSV output handler.
This module defines the CSVOutputHandler class, which is responsible for
writing samples to a CSV file. It's used by the Merlin job manager.
CSVOutputHandler
Bases: BaseOutputHandler
Output handler for writing samples to a CSV file.
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 |
|---|---|
write |
Writes a list of samples to a CSV file. |
Source code in src/mada_tools/simulation/simutils/samples/output/csv_output_handler.py
write(samples, **kwargs)
Writes a list of samples to a CSV file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
samples
|
ndarray
|
The samples to write, where each sample is a list of floats. |
required |
**kwargs
|
Dict[str, str]
|
Additional keyword arguments for output configuration. For CSV output, this must include: - output_file: The path to the CSV file where samples will be written. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
SampleOutputResult |
SampleOutputResult
|
A result object containing the output path and output type. |
Source code in src/mada_tools/simulation/simutils/samples/output/csv_output_handler.py
CSVOutputSettings
dataclass
Bases: BaseSettings
A class to encapsulate the settings for how to output samples to a csv file.
This class is implemented to follow the common architecture used throughout the sample generation and output handling of the job management system. If more settings are needed, they can be added here easily.
Dataclasses like this help with type checking and setting defaults.
Attributes:
| Name | Type | Description |
|---|---|---|
output_file |
str
|
CSV file to save all samples (for csv mode). |
Methods:
| Name | Description |
|---|---|
validate |
Validates the input settings. |
__str__ |
Returns a string representation of the settings. |
__repr__ |
Returns a detailed string representation of the settings. |
Source code in src/mada_tools/simulation/simutils/samples/output/csv_output_handler.py
validate()
Validates the input settings.