spectre.tools.Status.ExecutableStatus.CharacteristicExtract¶
- class spectre.tools.Status.ExecutableStatus.CharacteristicExtract¶
- __init__()¶
Methods
__init__
()format
(field, value)Transform status values to human-readable strings.
render_dashboard
(job, input_file)Render a dashboard for the job (experimental).
status
(input_file, work_dir)Provide status information of an executable run.
Attributes
executable_name_patterns
fields
- executable_name_patterns: List[str] = ['^CharacteristicExtract']¶
- fields: Dict[str, str | None] = {'Time': 'M'}¶
- format(field, value)¶
Transform status values to human-readable strings.
- Parameters:
field – The name of the field, as listed in ‘fields’ (e.g. “Time”).
value – The status value of the field, as returned by ‘status()’.
Returns: Human-readable representation of the value.
- render_dashboard(job: dict, input_file: dict)¶
Render a dashboard for the job (experimental).
- Parameters:
job – A dictionary of job information, including the input file and working directory. See the ‘spectre.tools.Status.fetch_status’ function for details.
input_file – The input file read in as a dictionary.
This method can be overridden by subclasses to provide a custom dashboard for the job. The default implementation does nothing.
- status(input_file, work_dir)¶
Provide status information of an executable run.
- Parameters:
input_file – The input file read in as a dictionary.
work_dir – The working directory of the executable run. Paths in the input file are relative to this directory.
- Returns: Dictionary of ‘fields’ and their values. For example:
{“Time”: 10.5, “Orbits”: 3}. Not all fields must be provided if they can’t be determined.
- Note: Avoid raising exceptions in this function. It is better to provide
only a subset of fields than to raise an exception. For example, if there’s an error reading the number of orbits, intercept and log the exception and just skip providing the number of orbits.