AnalyzeResult#
Module: exa.core.analyze_result.analyze_result
- class AnalyzeResult(run_result, *, observations=None, plots=None, extra=None, error=None, error_traceback=None)#
Bases:
objectData object for the result of the analysis.
- Parameters:
run_result (RunResult) – The run result containing the full dataset and run data.
observations (Sequence[LocalObservation] | None) – Observations produced by the analysis.
plots (dict[str, PlotDefinition] | None) – A dict of plot definitions, which can be used to visualize run_result.dataset.
extra (dict | None) – A dictionary to store extra analyze results which can’t be added to any other attribute.
error (str | None) – An optional string to store the summary of a possible error during analysis.
error_traceback (str | None) – An optional string to store the traceback of a possible error during analysis.
Attributes
Shortcut to access run_result.dataset.
Shortcut to access run_result.run_definition.sweep_definition.settings.
Methods
Add any number of data arrays to
run_result.dataset.Add an observation to
observations.Add an observation to
observations.Add an observation to
observationsfrom a given parameter.Add an observation to
observationsfrom a given setting.Generate and show a selected plot from
plots.Generate and show multiple plots from
plots.Generate a report that displays the observations and plots from the analysis.
- property settings: SettingNode#
Shortcut to access run_result.run_definition.sweep_definition.settings.
- plot(key='default', **kwargs)#
Generate and show a selected plot from
plots.- Parameters:
key (str) – Selects which plot to show. If “default” and no “default” key exists, returns the first one.
kwargs – Keyword arguments passed to the generating function.
- Returns:
The generated Figure.
- Raises:
ValidationError – If no plots exist in
plots.KeyError – If key does not exist in
plots.
- Return type:
- plot_all(keys=None, **kwargs)#
Generate and show multiple plots from
plots.- Parameters:
- Returns:
The list of the generated Figures.
- Raises:
ValidationError – if no plots exist in
plots.KeyError – if key does not exist in
plots.
- Return type:
- add_arrays(*args)#
Add any number of data arrays to
run_result.dataset.Hint: Use
annotate()first to add parameter information.- Parameters:
args (DataArray) – DataArrays to add. Each one should have a name or “parameter” metadata.
- Return type:
None
- add_setting_observation(setting, value, *, uncertainty=None, tags=None, validation_rules=None)#
Add an observation to
observationsfrom a given setting.- Parameters:
setting (Setting) – Setting to be converted into an observation.
value (Annotated[bool | str | int | float | complex | ndarray, PlainValidator(func=~exa.common.data.value.validate_value, json_schema_input_type=~typing.Any), PlainSerializer(func=~exa.common.data.value.serialize_value, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={}, mode=None)]) – Value that is saved as an observation for
dut_field.uncertainty (Annotated[int | float | complex | ndarray, PlainValidator(func=~exa.common.data.value.validate_value, json_schema_input_type=~typing.Any), PlainSerializer(func=~exa.common.data.value.serialize_value, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={}, mode=None)] | None) – The uncertainty of the observation value.
Nonemeans unknown.validation_rules (list[Callable] | None) – The list of validation rules for the observation.
- Return type:
None
- add_parameter_observation(parameter, value, *, prefix='', uncertainty=None, tags=None, validation_rules=None)#
Add an observation to
observationsfrom a given parameter.- Parameters:
parameter (Parameter) – Parameter to be converted into an observation.
value (Annotated[bool | str | int | float | complex | ndarray, PlainValidator(func=~exa.common.data.value.validate_value, json_schema_input_type=~typing.Any), PlainSerializer(func=~exa.common.data.value.serialize_value, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={}, mode=None)]) – Value that is saved as an observation for
dut_field.prefix (str) – String, typically a component name, attached in front of the dut field, separated by a dot.
uncertainty (Annotated[int | float | complex | ndarray, PlainValidator(func=~exa.common.data.value.validate_value, json_schema_input_type=~typing.Any), PlainSerializer(func=~exa.common.data.value.serialize_value, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={}, mode=None)] | None) – The uncertainty of the observation value.
Nonemeans unknown.validation_rules (list[Callable] | None) – The list of validation rules for the observation.
- Return type:
None
- add_observation_with_qon(*, qon, value, unit, uncertainty=None, tags=None, validation_rules=None)#
Add an observation to
observations.- Parameters:
qon (QON) – Qualified observation name of the property the observation is about.
unit (str) – The observation unit (base SI unit, e.g. Hz and never GHz). Can be an empty string for quantities without unit (e.g. fidelity values).
value (Annotated[bool | str | int | float | complex | ndarray, PlainValidator(func=~exa.common.data.value.validate_value, json_schema_input_type=~typing.Any), PlainSerializer(func=~exa.common.data.value.serialize_value, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={}, mode=None)]) – Value of the observation.
uncertainty (Annotated[int | float | complex | ndarray, PlainValidator(func=~exa.common.data.value.validate_value, json_schema_input_type=~typing.Any), PlainSerializer(func=~exa.common.data.value.serialize_value, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={}, mode=None)] | None) – The uncertainty of the observation value.
Nonemeans unknown.validation_rules (list[Callable] | None) – Validation rules for the observation.
- Return type:
None
- add_observation(dut_field, value, unit, *, uncertainty=None, tags=None, validation_rules=None)#
Add an observation to
observations.- Parameters:
dut_field (str) – Name of the property the observation is about.
unit (str) – The observation unit (base SI unit, e.g. Hz and never GHz). Can be an empty string for quantities without unit (e.g. fidelity values).
value (Annotated[bool | str | int | float | complex | ndarray, PlainValidator(func=~exa.common.data.value.validate_value, json_schema_input_type=~typing.Any), PlainSerializer(func=~exa.common.data.value.serialize_value, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={}, mode=None)]) – Value that is saved as an observation for
dut_field.uncertainty (Annotated[int | float | complex | ndarray, PlainValidator(func=~exa.common.data.value.validate_value, json_schema_input_type=~typing.Any), PlainSerializer(func=~exa.common.data.value.serialize_value, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={}, mode=None)] | None) – The uncertainty of the observation value.
Nonemeans unknown.validation_rules (list[Callable] | None) – The list of validation rules for the observation.
- Return type:
None
- render_report(target='notebook')#
Generate a report that displays the observations and plots from the analysis.
- Parameters:
target (Literal['notebook', 'str'] | ~pathlib.Path) – The target format as string or a file path. Accepted values: “notebook”, “str” or
Pathinstance. For “notebook”, the output is a HTML document that is displayed in a Jupyter notebook. Target “str” returns HTML format in a string, and path instances saves document to a file.- Returns:
Rendered string or None if the report is rendered in notebook as a side effect.
- Return type:
Inheritance
