Results
This page lists the return types for solve and daemon
submission types. See the Core API for the complete
solve signature and the Solving Projects guide for
input and execution workflows. Use the Working With Results pages
to select a result workflow before you use this reference.
Solve Return Types
The project input and the keys= input determine the return type of
solve:
Project input |
|
Return type |
|---|---|---|
One project |
No value or one set of project keys |
|
One project |
||
No value or one set of project keys |
||
SolveResult provides access to one project result.
BatchSolveResult provides access to results
for multiple sets of project keys. BundledSolveResult
provides ordered results for one ordered project
bundle. BundledBatchSolveResult
provides the ordered project-bundle results for multiple sets of project keys.
List-Style Access
Several result types support standard Python list operations:
PostprocessCollection[index]returns onePostprocessRecordfor an integer index.BatchPostprocessCollection[index]selects one postprocess result across the batch for an integer index.BatchSolveResult[index]returns oneBatchSolveEntryfor an integer index; a slice returns a newBatchSolveResult.BundledSolveResult[index]returns oneSolveResultfor an integer index.BundledBatchSolveResult[index]returns oneBatchSolveResultfor the selected project across all batched project keys.BatchSolveSubmissionandBundledBatchSolveSubmissionsupport integer access and slicing.
Use len(value) to get the number of entries. You can iterate over these types in their
documented order. Integer access supports negative positions unless a method states
otherwise.
BundledSolveSubmission represents
one complete bundle. Call its wait() method before selecting project results.
Open Existing Results
- jcmsuite.results.open(path, *, project_file=None)[source]
Open an existing solve result without running solve(…).
- Parameters:
path (str | Path) – Path to a rendered project file (.jcmp or .jcm) or a
*_resultsdirectory.project_file (str | Path | None, optional) – project file associated with a result directory. Use this option only if path is a result directory.
- Returns:
Solve result with its available result data loaded.
- Return type:
- Raises:
InvalidConfigurationError – If path does not point to a readable project file or result directory.
Single Results
- class jcmsuite.results.SolveResult(project_file=None, backend_used=None, template_renders=<factory>, daemon_job_id=None, log=None, keys=<factory>, _post_process_only=False)[source]
Provide the result for one project and one set of project keys.
- Parameters:
project_file (Path | None, optional) – project file used for the solve.
backend_used (BackendMode | None, optional) – Execution method used for the solve.
template_renders (tuple[TemplateRenderInfo, ...], optional) – Template rendering operations completed during solve preparation.
daemon_job_id (int | None, optional) – Daemon submission identifier, if the solve used the daemon.
log (SolveExecutionLog | None, optional) – Messages and completion code from the solve.
keys (Mapping[str, object] | None, optional) – project keys used for this solve result, or None if no project keys were supplied.
- classmethod from_project_file(project_file)[source]
Open an existing solve result from a project file.
- Parameters:
project_file (str | Path) – Path to a rendered project file (.jcmp or .jcm). The method loads result data from the *_results directory with the same file stem.
- Returns:
Solve result with its available result data loaded.
- Return type:
- Raises:
InvalidConfigurationError – If the project file is missing or no result data is found.
- classmethod from_result_dir(result_dir, *, project_file=None)[source]
Open an existing solve result from a result directory.
- Parameters:
result_dir (str | Path) – Path to a
*_resultsdirectory that contains solver results.project_file (str | Path | None, optional) – project file associated with the result directory. If omitted, the method tries to find the project file next to the directory.
- Returns:
Solve result with its available result data loaded.
- Return type:
- Raises:
InvalidConfigurationError – If the result directory is invalid or no result data is found.
- load_cartesian_fields(field_file, *, format='squeeze')[source]
Load a Cartesian fieldbag file associated with this solve result.
- Parameters:
field_file (str | Path) – Fieldbag file path. Relative paths are resolved against project_file.parent when available.
format ({"squeeze", "full"}, optional) – Shape of the returned coordinates and field values. “squeeze” removes dimensions of length 1. “full” keeps all dimensions.
- Returns:
Coordinates, field values, available derivatives, and file information.
- Return type:
- Raises:
InvalidConfigurationError – If the fieldbag path is not a file or format is not supported.
RuntimeError – If the fieldbag file is damaged or uses an unsupported storage format.
- load_table(table_file, *, format='named')[source]
Load a table file associated with this solve result.
- Parameters:
table_file (str | Path) – Table file path. Relative paths are resolved against project_file.parent when available.
format ({"named"}, optional) – Output format. The only supported value is “named”.
- Returns:
One table, or an ordered collection if the file contains multiple tables.
- Return type:
- Raises:
InvalidConfigurationError – If the table path is not a file or format is not supported.
- refresh_artifacts()[source]
Read the result files again.
- Returns:
The fieldbag, computational-cost, eigenvalue, and postprocess data reflect the current files.
- Return type:
None
- property costs
Return computational-cost data.
- Returns:
Computational-cost data, or None if it is unavailable.
- Return type:
ComputationalCosts | None
- property eigenvalues
Return eigenvalue data.
- Returns:
Eigenvalue data, or None if it is unavailable.
- Return type:
Eigenvalues | None
- property file
Return the solution fieldbag file.
- Returns:
Solution fieldbag file, or None if it is unavailable.
- Return type:
Path | None
- log
Messages and completion code from
SolveExecutionLog.
- property postprocesses
Return the postprocess results in project file order.
- Returns:
Available postprocess results. An empty collection indicates that no postprocess result is available.
- Return type:
- project_file
Project file used for the solve.
- class jcmsuite.results.SolveExecutionLog(backend, stdout, stderr, return_code, streamed_to_console)[source]
Store the captured log for one solve.
- Parameters:
backend (BackendMode) – Execution method that produced the log.
stdout (str) – Messages written to stdout.
stderr (str) – Error messages written to standard error.
return_code (int | None) – Completion code from JCMsuite, if available. A value of 0 indicates success.
streamed_to_console (bool) – True if the messages were also shown in the terminal while the solve ran.
- backend
Execution method that produced the log.
- return_code
Completion code from JCMsuite, if available. Zero indicates success.
- stderr
Error messages written to standard error.
- stdout
Messages written to stdout.
- streamed_to_console
Whether the messages were also shown in the terminal during the solve.
- class jcmsuite.results.TemplateRenderInfo(source_template, rendered_project, keys)[source]
Store information about one template that JCMsuite converted.
- Parameters:
source_template (Path) – Source .jcmt or .jcmpt template.
rendered_project (Path) – Generated .jcm or .jcmp file used by the solver.
keys (dict[str, object]) – project keys used for template rendering.
Single-Result Data
- class jcmsuite.results.SolveKeys(values=None, *, source=None)[source]
Store and export the project keys for one solve.
A list used as a project key remains one value. It does not create Batched project keys.
- Parameters:
values (Mapping[str, object] | None, optional) – project keys. If omitted, use an empty dictionary.
source (Path | None, optional) – project file associated with the project keys.
- to_df(orient=None)[source]
Return the project keys as a DataFrame.
- Parameters:
orient ({"wide", "long"} | None, optional) – Table layout. “wide” gives one row with one column for each project key. “long” gives one row for each project key. If omitted, use “wide”.
- Returns:
project keys in the selected layout.
- Return type:
pandas.DataFrame
- Raises:
ValueError – If orient is not “wide”, “long”, or None.
- to_dict()[source]
Return a new dictionary that contains the project keys.
- Returns:
Copy of the project keys.
- Return type:
Mapping[object, object]
- class jcmsuite.results.ComputationalCosts(table, source=None)[source]
Store and export computational-cost data.
- Parameters:
table (Mapping[object, object]) – Dictionary read from computational_costs.jcm.
source (str | Path | None, optional) – Source file or storage origin for the computational-cost data.
- to_df(orient=None)
Return table data in the requested DataFrame orientation.
- Parameters:
orient ({"wide", "long"} | None, optional) – Table layout. If omitted, use the natural wide form.
- Returns:
Table data in the selected layout.
- Return type:
pandas.DataFrame
- Raises:
ValueError – If orient is not None, “wide”, or “long”.
- to_dict()[source]
Return the computational-cost data as a dictionary.
- Returns:
Computational-cost values and header information.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_xarray()[source]
Return the computational-cost data as an xarray DataTree.
The root node contains the cost values.
- Returns:
Computational-cost data in the root node.
- Return type:
xarray.DataTree
- property header
Return the table header.
- Returns:
Header information, or None if no header is available.
- Return type:
ComputationalCostsHeader | None
- property title
Return the table title.
- Returns:
Table title, or None if the table has no title.
- Return type:
str | None
- class jcmsuite.results.ComputationalCostsHeader(table, source=None)[source]
Store and export information from a computational-cost header.
- Parameters:
table (Mapping[object, object]) – Header information from computational_costs.jcm.
source (str | Path | None, optional) – Source file or storage origin for the computational-cost header.
- to_df(orient=None)[source]
Return header metadata in the requested DataFrame orientation.
- Parameters:
orient ({None, "long"}, optional) – Select the table layout. Header metadata supports only long form.
- Returns:
Long-form computational-cost header.
- Return type:
pandas.DataFrame
- Raises:
UnsupportedExportError – If orient is “wide”.
ValueError – If orient is not None, “wide”, or “long”.
- to_dict()[source]
Return the header information as a dictionary.
- Returns:
Copy of the computational-cost header.
- Return type:
Mapping[object, object]
- class jcmsuite.results.Eigenvalues(table, source=None)[source]
Store and export eigenvalue data.
- Parameters:
table (Mapping[object, object]) – Dictionary read from eigenvalues.jcm.
source (str | Path | None, optional) – Source file or storage origin for the eigenvalue data.
- to_df(orient=None)
Return table data in the requested DataFrame orientation.
- Parameters:
orient ({"wide", "long"} | None, optional) – Table layout. If omitted, use the natural wide form.
- Returns:
Table data in the selected layout.
- Return type:
pandas.DataFrame
- Raises:
ValueError – If orient is not None, “wide”, or “long”.
- to_dict()[source]
Return the eigenvalue data as a dictionary.
- Returns:
Eigenvalue values and table information.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_xarray()[source]
Return the eigenvalue data as an xarray DataTree.
- Returns:
Tree with all eigenvalue data in the root node. The row_index coordinate identifies each eigenvalue row.
- Return type:
xarray.DataTree
- Raises:
InvalidConfigurationError – If the eigenvalue data cannot form a table.
- class jcmsuite.results.PostprocessCollection(records)[source]
Store postprocess records in project file order.
- __getitem__(index)[source]
Return one postprocess record by position.
- Parameters:
index (int) – Record position. Position 0 selects the first record.
- Returns:
Selected postprocess record.
- Return type:
- __iter__()[source]
Iterate over records in project file order.
- Returns:
Postprocess records in project file order.
- Return type:
Iterator[PostprocessRecord]
- class jcmsuite.results.PostprocessRecord(source_file, _raw, title, payload=None, available=True, failure_message=None)[source]
Store and export one postprocess result.
- is_field_export()[source]
Return whether this record contains a Cartesian field export.
- Returns:
True when the record contains field data. Otherwise, False.
- Return type:
bool
- to_df(orient=None)[source]
Return tabular postprocess data as a pandas DataFrame.
- Parameters:
orient ({None, "wide", "long"}, optional) – Select the table layout. Structured and table-collection payloads support only the long layout.
- Raises:
InvalidConfigurationError – If the record is unavailable or does not contain tabular data.
UnsupportedExportError – If the payload does not support the requested layout.
- Returns:
Postprocess data in the selected layout.
- Return type:
pandas.DataFrame
- to_dict()[source]
Return the postprocess data as a dictionary.
- Returns:
Postprocess data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_powerflux()[source]
Return a new record with field data converted to power flux.
- Returns:
New record containing converted postprocess data.
- Return type:
- Raises:
InvalidConfigurationError – If the postprocess data is not stored as named values.
- to_xarray()[source]
Return postprocess data as an xarray DataTree.
- Returns:
Postprocess data in an xarray tree.
- Return type:
xarray.DataTree
- property derivatives
Return parameter-derivative navigation for numeric postprocess data.
- Returns:
Name-based selection for canonical table or structured payloads.
- Return type:
TableDerivativeCollection | TableCollectionDerivativeCollection | StructuredDerivativeCollection
- property fields
Return the field-export interface for this record.
- Returns:
Field data and field-navigation operations.
- Return type:
- Raises:
UnsupportedExportError – If the record does not contain field data.
- property header
Return the optional header associated with this postprocess result.
- Returns:
Header data when the result contains a header. Otherwise, None.
- Return type:
PostprocessHeader | None
- class jcmsuite.results.PostprocessHeader(table)[source]
Store and export information from a postprocess header.
- Parameters:
table (Mapping[object, object]) – Header information from a postprocess result.
- to_df(orient=None)[source]
Return one DataFrame row for each header value.
- Parameters:
orient ({None, "long"}, optional) – Select the table layout. Postprocess headers support only long form.
- Returns:
Long-form postprocess header.
- Return type:
pandas.DataFrame
- Raises:
InvalidConfigurationError – If the postprocess header is not tabular.
UnsupportedExportError – If orient is “wide”.
ValueError – If orient is not None, “wide”, or “long”.
- to_dict()[source]
Return the header information as a dictionary.
- Returns:
Copy of the postprocess header.
- Return type:
Mapping[object, object]
Typed Payloads
These payload types represent result data loaded from result files. Use the
load_table,
load_cartesian_fields, or result loading methods to create them; do
not construct them from raw file data. See the Loader API and Field Export
API for loading details.
- class jcmsuite.results.StructuredPayload[source]
Deprecated base class for nested scientific payloads.
No supported file-backed loader produces this family. It remains only for in-memory mappings and restored state and is marked for removal.
- to_df(orient=None)[source]
Return structured data as path/value rows.
- Parameters:
orient (str | None, optional) – DataFrame orientation. Use None or “long”; “wide” is not supported for structured data.
- Returns:
Structured data in path/value rows.
- Return type:
pandas.DataFrame
- abstractmethod to_dict()
Return the result data as a dictionary.
- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- abstractmethod to_xarray()
Return the result data as an xarray DataTree.
- Returns:
Result data in an xarray tree. See the user documentation for xarray export details.
- Return type:
xarray.DataTree
- class jcmsuite.results.StructuredDerivativeCollection[source]
Discover and select structured derivative views by solver parameter.
Use a postprocess record’s
derivativesproperty to obtain this collection. Callkeys()to discover parameter names, then select a name with brackets. Do not construct this collection directly.- __getitem__(parameter)[source]
Select the derivative for one exact parameter name.
- Parameters:
parameter (str) – Exact solver parameter name to select.
- Returns:
Selected structured derivative payload.
- Return type:
- Raises:
KeyError – If the named derivative branch is not available.
InvalidConfigurationError – If symmetric mixed-pair payloads conflict.
- class jcmsuite.results.StructuredDerivativeView[source]
Selected numeric derivative data with structured export operations.
- source
Source path or provenance of the originating postprocess.
- Type:
Source
- title
Postprocess title, when available.
- Type:
str | None
- derivatives
Derivative directions available from this selected payload.
- to_df(orient=None)[source]
Export the selected values using the structured long layout.
- Parameters:
orient (str | None, optional) – Use None or
"long". Structured wide export is unsupported.- Returns:
Long-form path/value rows for the selected derivative.
- Return type:
pandas.DataFrame
- class jcmsuite.results.BatchStructuredPayload(sources)[source]
Base capability family for batch structured payloads.
- to_df(orient=None)[source]
Return batch structured data as path/value rows.
- Parameters:
orient (str | None, optional) – DataFrame orientation. Use None or “long”; “wide” is not supported for batch structured data.
- Returns:
Batch structured data in path/value rows.
- Return type:
pandas.DataFrame
- abstractmethod to_dict()
Return the result data as a dictionary.
- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- abstractmethod to_xarray()
Return the result data as an xarray DataTree.
- Returns:
Result data in an xarray tree. See the user documentation for xarray export details.
- Return type:
xarray.DataTree
- class jcmsuite.results.BatchTablePayload(sources)[source]
Base capability family for batch table payloads.
- to_df(orient=None)[source]
Return batch table data as a long-form pandas DataFrame.
- Parameters:
orient ({None, "long"}, optional) – Select the table layout. Batch table data does not support the wide layout.
- Returns:
Batch table data in long form.
- Return type:
pandas.DataFrame
- Raises:
UnsupportedExportError – If orient is “wide”.
ValueError – If orient is not None or “long”.
- abstractmethod to_dict()
Return the result data as a dictionary.
- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- abstractmethod to_xarray()
Return the result data as an xarray DataTree.
- Returns:
Result data in an xarray tree. See the user documentation for xarray export details.
- Return type:
xarray.DataTree
- class jcmsuite.results.BatchTableCollectionPayload(sources)[source]
Base capability family for batch collections of named tables.
- to_df(orient=None)[source]
Return batch table collections as path/value rows.
- Parameters:
orient (str | None, optional) – DataFrame orientation. Use None or “long”; “wide” is not supported for batch table collections.
- Returns:
Batch table collections in path/value rows.
- Return type:
pandas.DataFrame
- abstractmethod to_dict()
Return the result data as a dictionary.
- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- abstractmethod to_xarray()
Return the result data as an xarray DataTree.
- Returns:
Result data in an xarray tree. See the user documentation for xarray export details.
- Return type:
xarray.DataTree
Batch Results
- class jcmsuite.results.BatchSolveResult(entries)[source]
Provide ordered results for batched project keys.
- Parameters:
entries (tuple[BatchSolveEntry, ...]) – Results in batched project keys order.
Notes
result[index] returns one BatchSolveEntry. result[start:stop] returns a new BatchSolveResult. Iteration yields entries in batched project keys order.
- __getitem__(index)[source]
Return one entry or a new batch selected by a slice.
- Parameters:
index (int | slice) – Entry position or standard Python slice. Negative positions count from the end of the batch.
- Returns:
One entry for an integer position, or a new batch for a slice.
- Return type:
- Raises:
TypeError – If index is not an integer or slice.
IndexError – If an integer position is outside the batch.
- __iter__()[source]
Iterate over entries in batched project keys order.
- Returns:
Iterator over the batch entries.
- Return type:
Iterator[BatchSolveEntry]
- property costs
Return computational-cost data for all batch entries.
- Returns:
Computational-cost data in batched project keys order.
- Return type:
- property eigenvalues
Return eigenvalue data for all batch entries.
- Returns:
Eigenvalue data in batched project keys order.
- Return type:
- property failure_indices
Return the original positions of failed batch entries.
- Returns:
Original batch positions in input order.
- Return type:
tuple[int, …]
- property keys
Return the batched project keys and their original positions.
- Returns:
project keys in their original batch order.
- Return type:
- property postprocesses
Return the batch postprocess collection.
- Returns:
Postprocess results in batched project keys order.
- Return type:
- property project_file
Return the first available project file.
- Returns:
project file from the first successful entry, or None if the batch contains no successful result.
- Return type:
pathlib.Path | None
- property success_indices
Return the original positions of successful batch entries.
- Returns:
Original batch positions in input order.
- Return type:
tuple[int, …]
- class jcmsuite.results.BatchSolveEntry(index, keys, result, failure, _log=None)[source]
Store one ordered entry in a BatchSolveResult.
- Parameters:
index (int) – Position in the batched project keys.
keys (dict[str, object]) – project keys used for this solve entry.
result (SolveResult | None) – Solve result if this entry succeeded.
failure (BatchSolveFailure | None) – Failure information if this entry did not succeed and on_error was “collect”.
_log (SolveExecutionLog | None, optional) – Stored execution log for a failed entry. Application code usually reads the public log property instead of setting this value.
- failure
Failure information if this entry did not succeed.
- index
Position in the batched project keys.
- keys
Project keys used for this solve entry.
- property log
Return the execution log for this batch entry.
- Returns:
Log from result.log for a successful entry, or the stored failure log. Returns None if no log is available.
- Return type:
SolveExecutionLog | None
- result
Solve result if this entry succeeded.
- class jcmsuite.results.BatchSolveFailure(index, keys, exception_type, message)[source]
Describe one failed entry in a BatchSolveResult.
- Parameters:
index (int) – Position in the batched project keys.
keys (dict[str, object]) – project keys for the failed entry.
exception_type (type[Exception]) – Exception class raised while processing the item.
message (str) – Message from the exception.
- class jcmsuite.results.BatchSolveKeys(records)[source]
Store and export batched project keys with their original positions.
- to_df(orient=None)
Return batch table data as a long-form pandas DataFrame.
- Parameters:
orient ({None, "long"}, optional) – Select the table layout. Batch table data does not support the wide layout.
- Returns:
Batch metadata in long form.
- Return type:
pandas.DataFrame
- Raises:
UnsupportedExportError – If orient is “wide”.
ValueError – If orient is not None or “long”.
- to_dict()
Return one information dictionary for each original batch position.
- Returns:
Information dictionaries indexed by original batch position.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_xarray()
Return the information as an xarray DataTree.
The batch_index coordinate contains the original batch positions.
- Returns:
Batch information in the root node.
- Return type:
xarray.DataTree
- property sources
Return one source file for each batch entry.
An unavailable source file is None. The order matches the current batch entries.
- Returns:
Source files in batched project keys order.
- Return type:
tuple[Path | None, …]
- class jcmsuite.results.BatchComputationalCosts(records)[source]
Store and export computational-cost data for a batch.
- Parameters:
records (tuple[BatchExportRecord, ...]) – Computational-cost data in batch order.
- to_df(orient=None)
Return batch table data as a long-form pandas DataFrame.
- Parameters:
orient ({None, "long"}, optional) – Select the table layout. Batch table data does not support the wide layout.
- Returns:
Batch table data in long form.
- Return type:
pandas.DataFrame
- Raises:
UnsupportedExportError – If orient is “wide”.
ValueError – If orient is not None or “long”.
- to_dict()[source]
Return one cost dictionary for each available batch entry.
- Returns:
Cost dictionaries indexed by their original batch positions.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_xarray()[source]
Return the batch computational costs as an xarray DataTree.
- Returns:
Computational-cost data in batched project keys order.
- Return type:
xarray.DataTree
- property available_count
Return the number of entries with computational-cost data.
- Returns:
Number of available computational-cost results.
- Return type:
int
- property count
Return the total number of batch entries.
- Returns:
Number of batch entries.
- Return type:
int
- property header
Return header information for all batch entries.
- Returns:
Header information in batched project keys order.
- Return type:
- property missing_count
Return the number of entries without computational-cost data.
- Returns:
Number of missing computational-cost results.
- Return type:
int
- property sources
Return one source file for each batch entry.
An unavailable source file is None. The order matches the current batch entries.
- Returns:
Source files in batched project keys order.
- Return type:
tuple[Path | None, …]
- class jcmsuite.results.BatchEigenvalues(records)[source]
Store and export eigenvalue data for a batch.
- Parameters:
records (tuple[BatchExportRecord, ...]) – Eigenvalue data in batch order.
- to_df(orient=None)
Return batch table data as a long-form pandas DataFrame.
- Parameters:
orient ({None, "long"}, optional) – Select the table layout. Batch table data does not support the wide layout.
- Returns:
Batch table data in long form.
- Return type:
pandas.DataFrame
- Raises:
UnsupportedExportError – If orient is “wide”.
ValueError – If orient is not None or “long”.
- to_dict()[source]
Return one eigenvalue dictionary for each available batch entry.
- Returns:
Eigenvalue dictionaries indexed by their original batch positions.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_xarray()[source]
Return the batch eigenvalues as an xarray DataTree.
- Returns:
Tree with all data in the root node. batch_index contains the original batch positions. row_index identifies table rows. is_valid identifies source values. is_padded identifies values added to make all batch tables the same length.
- Return type:
xarray.DataTree
- Raises:
InvalidConfigurationError – If no eigenvalue data is available or the tables cannot be combined.
- property available_count
Return the number of entries with eigenvalue data.
- Returns:
Number of available eigenvalue results.
- Return type:
int
- property count
Return the total number of batch entries.
- Returns:
Number of batch entries.
- Return type:
int
- property missing_count
Return the number of entries without eigenvalue data.
- Returns:
Number of missing eigenvalue results.
- Return type:
int
- property sources
Return one source file for each batch entry.
An unavailable source file is None. The order matches the current batch entries.
- Returns:
Source files in batched project keys order.
- Return type:
tuple[Path | None, …]
- class jcmsuite.results.BatchPostprocessCollection(records)[source]
Select one postprocess result across a batch.
- Parameters:
records (tuple[BatchExportRecord, ...]) – Postprocess results in batched project keys order.
Notes
Application code receives this collection from BatchSolveResult.postprocesses; it does not need to construct the collection directly.
Select a postprocess result by its integer position. Export data from the returned BatchPostprocessRecord.
- __getitem__(selector)[source]
Select one postprocess result across the batch.
- Parameters:
selector (int) – Postprocess position shared across all batch entries. Negative positions are not supported.
- Returns:
Batch record when available entries have compatible result data. Older result data can return a read-only selection with the same export operations.
- Return type:
BatchPostprocessRecord | _BatchPostprocessSelection
- Raises:
TypeError – If selector is not an integer or is a Boolean value.
InvalidConfigurationError – If available entries have incompatible result data.
- class jcmsuite.results.BatchPostprocessRecord(records, index, payload)[source]
Provide one type of postprocess result across a batch.
- Parameters:
records (tuple[BatchExportRecord, ...]) – Postprocess results in batched project keys order.
index (int) – Position of the selected postprocess result in each project result.
payload (BatchTablePayload | BatchStructuredPayload | BatchTableCollectionPayload | BatchFieldExportPayload) – Data for the selected postprocess result.
Notes
Application code receives this object after selecting a batch postprocess result; it does not need to construct the object directly.
Available entries must contain the same type and structure of result data.
- is_field_export()[source]
Check whether the selected postprocess result contains field data.
- Returns:
True if the result contains field data. Otherwise, False.
- Return type:
bool
- to_df(orient=None)[source]
Return the selected batch postprocess stream as a DataFrame.
- Parameters:
orient ({None, "wide", "long"}, optional) – Select the table layout. Batch postprocess data supports only the long layout. None selects the long layout.
- Returns:
Selected postprocess data in long form.
- Return type:
pandas.DataFrame
- Raises:
UnsupportedExportError – If the selected postprocess contains field data or orient is “wide”.
ValueError – If orient is not None, “wide”, or “long”.
- to_dict()[source]
Return result dictionaries for the available batch entries.
- Returns:
Result dictionaries indexed by their original batch positions.
- Return type:
Mapping[object, object]
- to_mapping()
Return result data using the deprecated mapping export name.
Deprecated since version 7.2: Use
to_dict()instead.- Returns:
Result data as a dictionary that keeps the original field names.
- Return type:
Mapping[object, object]
- to_powerflux()[source]
Convert the selected result to PowerFlux data.
- Returns:
Converted data in batched project keys order.
- Return type:
- Raises:
InvalidConfigurationError – If an available entry does not contain the required Fourier table data.
- to_xarray()[source]
Return the selected batch result as an xarray DataTree.
- Returns:
Result data in batched project keys order.
- Return type:
xarray.DataTree
- Raises:
InvalidConfigurationError – If available result data cannot be combined in one tree.
- property fields
Return field data for the selected batch result.
- Returns:
Field data in batched project keys order.
- Return type:
- Raises:
UnsupportedExportError – If the selected postprocess result does not contain field data.
- property header
Return the postprocess headers in batched project keys order.
- Returns:
Header information for each batch entry.
- Return type:
- property sources
Return one source file for each batch entry.
An unavailable source file is None. The order matches the Batched project keys.
- Returns:
Source files in batched project keys order.
- Return type:
tuple[Path | None, …]
Ordered Project Bundles
- class jcmsuite.results.BundledSolveResult(entries)[source]
Provide results for one ordered project bundle.
- Parameters:
entries (tuple[BundledSolveEntry, ...]) – project results in ordered project bundle order.
Notes
result[index] returns one project result. Iteration yields project results in ordered project bundle order.
- __getitem__(index)[source]
Return one project result by its position.
- Parameters:
index (int) – Position in the ordered project bundle. Negative positions count from the end of the bundle.
- Returns:
Result for the selected project.
- Return type:
- Raises:
TypeError – If index is not an integer.
IndexError – If index is outside the ordered project bundle.
- __iter__()[source]
Iterate over project results in ordered project bundle order.
- Returns:
Iterator over the project results.
- Return type:
Iterator[SolveResult]
- __len__()[source]
Return the number of project results in the bundle.
- Returns:
Number of projects in the ordered project bundle.
- Return type:
int
- project(selector)[source]
Return one project result by its position.
- Parameters:
selector (int) – Position of the project in the ordered project bundle.
- Returns:
Result for the selected project.
- Return type:
- property project_files
Return the project file paths in ordered project bundle order.
- Returns:
Absolute project file paths.
- Return type:
tuple[Path, …]
- class jcmsuite.results.BundledSolveEntry(project_file, result, _project_identity=None)[source]
Store one project result in an ordered project bundle.
- Parameters:
project_file (Path) – Path to the project file.
result (SolveResult) – Result for the project.
- class jcmsuite.results.BundledBatchSolveResult(entries)[source]
Provide project-first access to batched ordered project bundles.
- Parameters:
entries (tuple[BundledBatchSolveEntry, ...]) – Results in batched project keys order.
Notes
List-style access is project-first. result[index] returns the BatchSolveResult for one project across all batched project keys. Iteration yields these project batch results in ordered project bundle order.
- __getitem__(index)[source]
Return the batch result for one project position.
- Parameters:
index (int) – Position in the ordered project bundle. Negative positions count from the end of the bundle.
- Returns:
Results for the selected project in batched project keys order.
- Return type:
- Raises:
TypeError – If index is not an integer or is a Boolean value.
IndexError – If index is outside the ordered project bundle.
- __iter__()[source]
Iterate over project batch results in bundle order.
- Returns:
Iterator with one batch result for each project.
- Return type:
Iterator[BatchSolveResult]
- __len__()[source]
Return the number of projects in the ordered project bundle.
- Returns:
Number of available project positions.
- Return type:
int
- project(selector)[source]
Return the batch results for one project in the bundle.
- Parameters:
selector (int) – Position of the project in the ordered project bundle.
- Returns:
Results for the selected project in batched project keys order. The result includes failures that were collected during the solve.
- Return type:
- property project_files
Return the project files in ordered project bundle order.
- Returns:
Absolute project file paths, or an empty tuple if no project information is available.
- Return type:
tuple[Path | None, …]
- class jcmsuite.results.BundledBatchSolveEntry(index, keys, result, failure, project_files=(), log=None)[source]
Store one batch entry for a complete ordered project bundle.
- Parameters:
index (int) – Position in the batched project keys.
keys (dict[str, object]) – project keys used for this batch entry.
result (BundledSolveResult | None) – Result for a successful ordered project bundle.
failure (BatchSolveFailure | None) – Failure information when the solve did not succeed.
project_files (tuple[Path, ...], optional) – project files in ordered project bundle order. The files remain available if the solve fails before it produces a project result.
log (SolveExecutionLog | None, optional) – Execution log for a failed ordered project bundle.
Submissions
- class jcmsuite.results.SolveSubmission(job_id, result, keys=None, index=None)[source]
Represent one solve submitted to the daemon.
- Parameters:
job_id (int) – Daemon submission identifier for this submitted solve.
result (SolveResult) – Result information associated with this submission.
keys (dict[str, object] | None, optional) – Submitted project keys, if available.
index (int | None, optional) – Position in the batched project keys, if applicable.
- wait(*, daemon=None, asynchronous=False, break_when='all', timeout=None, on_timeout='raise', on_error='raise', progress=False, progress_label=None)[source]
Wait for this submission and return its result.
- Parameters:
daemon (DaemonHandler | None, optional) – Daemon handler to use. If daemon is None, use the handler that created the submission.
asynchronous (bool, optional) – If True, return a coroutine. The caller must await the coroutine.
break_when ({"all", "any"}, optional) – Completion condition. “all” waits for all submitted solves. “any” returns after the first submitted solve completes.
timeout (float | None, optional) – Maximum wait time in seconds. None sets no time limit.
on_timeout ({"raise", "return"}, optional) – Action at the time limit. “raise” raises an exception. “return” returns the results that are available.
on_error ({"raise", "collect"}, optional) – Action when a solve fails. “raise” raises an exception. “collect” stores the failure information in the result.
progress (bool, optional) – If True, show progress while more than one solve is pending.
progress_label (str | None, optional) – Text for the progress indicator. If omitted, the wait operation uses its default label.
- Returns:
Result for the project. If asynchronous is True, returns a coroutine that produces the result.
- Return type:
SolveResult | Coroutine[object, object, SolveResult]
- class jcmsuite.results.BatchSolveSubmission(entries)[source]
Represent batched project keys submitted to the daemon.
- Parameters:
entries (tuple[SolveSubmission, ...]) – submissions in batched project keys order.
Notes
You can select an entry by position or select a range with a slice. A slice returns another BatchSolveSubmission.
- __getitem__(index)[source]
Return one submission or a sliced batch submission.
- Parameters:
index (int | slice) – Batch position or standard Python slice. Negative positions count from the end of the batch.
- Returns:
One submission for an integer position, or a new batch submission for a slice.
- Return type:
- Raises:
IndexError – If an integer position is outside the batch.
- __iter__()[source]
Iterate over submissions in batched project keys order.
- Returns:
Iterator over the submission entries.
- Return type:
Iterator[SolveSubmission]
- __len__()[source]
Return the number of submission entries.
- Returns:
Number of entries in the submitted batch.
- Return type:
int
- job_ids()[source]
Return daemon submission identifiers in batched project keys order.
- Returns:
Daemon submission identifiers for the submitted solves.
- Return type:
tuple[int, …]
- wait(*, daemon=None, asynchronous=False, break_when='all', timeout=None, on_timeout='raise', on_error='raise', progress=False, progress_label=None)[source]
Wait for the submitted batched project keys.
- Parameters:
daemon (DaemonHandler | None, optional) – Daemon handler to use. If daemon is None, use the handler that created the submission.
asynchronous (bool, optional) – If True, return a coroutine. The caller must await the coroutine.
break_when ({"all", "any"}, optional) – Completion condition. “all” waits for all submitted solves. “any” returns after the first submitted solve completes.
timeout (float | None, optional) – Maximum wait time in seconds. None sets no time limit.
on_timeout ({"raise", "return"}, optional) – Action at the time limit. “raise” raises an exception. “return” returns the results that are available.
on_error ({"raise", "collect"}, optional) – Action when a solve fails. “raise” raises an exception. “collect” stores the failure information in the result.
progress (bool, optional) – If True, show progress while more than one solve is pending.
progress_label (str | None, optional) – Text for the progress indicator. If omitted, the wait operation uses its default label.
- Returns:
Results in batched project keys order. If asynchronous is True, returns a coroutine that produces the results.
- Return type:
BatchSolveResult | Coroutine[object, object, BatchSolveResult]
- property failures
Return no failures before wait(…) creates the batch result.
- Returns:
Empty tuple. Read failures from the BatchSolveResult returned by wait(…).
- Return type:
tuple[BatchSolveFailure, …]
- property successes
Return results that are already available on the submissions.
- Returns:
Available result information in batched project keys order.
- Return type:
tuple[SolveResult, …]
- class jcmsuite.results.BundledSolveSubmission(job_id, project_files=(), keys=None)[source]
Represent one ordered project bundle submitted as one daemon job.
- Parameters:
job_id (int | None) – One daemon job identifier, or None for a cached bundle.
project_files (tuple[Path, ...]) – Prepared project files in execution order. Cached handles retain the supplied project input paths instead.
keys (dict[str, object] | None, optional) – Project Keys for the complete bundle.
Notes
On a Slurm queue, all projects execute in order within one scheduler job. Wait for the complete bundle before selecting individual project results. This Submission does not support indexing or slicing. A BundledBatchSolveSubmission supports both operations on complete bundles.
- wait(*, daemon=None, asynchronous=False, break_when='all', timeout=None, on_timeout='raise', on_error='raise', progress=False, progress_label=None)[source]
Wait for the one job that executes the complete ordered project bundle.
- Parameters:
daemon (DaemonHandler | None, optional) – Daemon handler to use. If daemon is None, use the handler that created the submission.
asynchronous (bool, optional) – If True, return a coroutine. The caller must await the coroutine.
break_when ({"all", "any"}, optional) – Use “all” to wait for the complete bundle. “any” is rejected because individual projects are not independently waitable.
timeout (float | None, optional) – Maximum wait time in seconds. None sets no time limit.
on_timeout ({"raise", "return"}, optional) – Use “raise” to raise a timeout without closing or resubmitting the job. “return” is rejected because a bundle is one solve unit.
on_error ({"raise", "collect"}, optional) – Use “raise” for a failed bundle. “collect” is supported only on a bundled-batch wait.
progress (bool, optional) – If True, show progress while more than one solve is pending.
progress_label (str | None, optional) – Text for the progress indicator. If omitted, the wait operation uses its default label.
- Returns:
Results in ordered project bundle order. If asynchronous is True, returns a coroutine that produces the results.
- Return type:
BundledSolveResult | Coroutine[object, object, BundledSolveResult]
- Raises:
TimeoutError – If the wait reaches its time limit before the bundle completes. The daemon job remains submitted. Call wait() again to collect the same bundle.
ConfigMappingError – If the daemon reports an input error with a source position. The error identifies the source file. Its SolveExecutionError cause contains the exit code and log, and daemon job metadata when available.
SolveExecutionError – If the daemon reports an execution failure without a source position. The complete bundle fails, even if an earlier project produced files.
InvalidConfigurationError – If a wait option is unsupported or the Submission is not bound to its submitting daemon handler.
RuntimeError – If a synchronous wait is called from a running event loop.
Notes
The complete bundle is already submitted. This method does not submit further projects. After success, later waits return the completed bundle. After a terminal daemon failure, later waits raise that failure.
- job_id
One daemon job identifier, or
Nonefor a cached bundle.
- keys
Project Keys for the complete bundle, or
Nonewhen no Project Keys were supplied.
- project_files
Prepared project paths in execution order; supplied input paths for a cached bundle.
- class jcmsuite.results.BundledBatchSolveSubmission(entries)[source]
Represent a batch of submitted ordered project bundles.
- Parameters:
entries (tuple[BundledBatchSolveSubmissionEntry, ...]) – Ordered project bundle submissions in batched project keys order.
Notes
submission[index] returns one successful ordered project bundle submission. A slice returns a new BundledBatchSolveSubmission. Iteration yields successful bundle submissions in batched project keys order and raises an error if an entry contains a collected failure. Call submission[index].wait() to collect one complete bundle. Call submission[start:stop].wait() to collect a subset. Slices retain the original batch indices. Results use the project-first navigation of BundledBatchSolveResult.
- __getitem__(index)[source]
Return one bundle submission or a sliced batch.
- Parameters:
index (int | slice) – Batch position or standard Python slice. Negative positions count from the end of the batch.
- Returns:
One successful bundle submission for an integer position, or a new batch submission for a slice.
- Return type:
- Raises:
TypeError – If the selected entry contains a collected submission failure.
IndexError – If an integer position is outside the batch.
- __iter__()[source]
Iterate over successful bundle submissions in batch order.
- Returns:
Iterator over successful ordered project bundle submissions.
- Return type:
Iterator[BundledSolveSubmission]
- Raises:
TypeError – If an entry contains a collected submission failure.
- __len__()[source]
Return the number of batch entries.
- Returns:
Number of ordered project bundle submission entries.
- Return type:
int
- items()[source]
Return each original batch position with its submission entry.
- Returns:
Pairs in batched project keys order.
- Return type:
tuple[tuple[int, BundledBatchSolveSubmissionEntry], …]
- wait(*, daemon=None, asynchronous=False, break_when='all', timeout=None, on_timeout='raise', on_error='raise', progress=False, progress_label=None)[source]
Wait for the submitted batch of ordered project bundles.
- Parameters:
daemon (DaemonHandler | None, optional) – Daemon handler to use. If daemon is None, use the handler that created the submission.
asynchronous (bool, optional) – If True, return a coroutine. The caller must await the coroutine.
break_when ({"all", "any"}, optional) – Use “all” to wait for all selected bundles. “any” is rejected. Select one bundle or a slice before waiting for a subset.
timeout (float | None, optional) – Maximum wait time in seconds. None sets no time limit.
on_timeout ({"raise", "return"}, optional) – Use “raise” to raise a timeout. “return” is rejected.
on_error ({"raise", "collect"}, optional) – Action when a solve fails. “raise” raises an exception. “collect” stores the failure information in the result.
progress (bool, optional) – If True, show progress while more than one solve is pending.
progress_label (str | None, optional) – Text for the progress indicator. If omitted, the wait operation uses its default label.
- Returns:
Results for the batched ordered project bundles. If asynchronous is True, returns a coroutine that produces the results.
- Return type:
BundledBatchSolveResult | Coroutine[object, object, BundledBatchSolveResult]
- property failures
Return collected failures in batched project keys order.
- Returns:
Failures collected during submission.
- Return type:
tuple[BatchSolveFailure, …]
- property keys
Return the project keys in their original batch order.
- Returns:
project keys for each batch entry.
- Return type:
tuple[dict[str, object], …]
- property results
Return the bundle submissions in batched project keys order.
A value is None if submission did not succeed for that batch entry.
- Returns:
Bundle submissions in batched project keys order.
- Return type:
tuple[BundledSolveSubmission | None, …]
- class jcmsuite.results.BundledBatchSolveSubmissionEntry(index, keys, result, failure, project_files=())[source]
Store one submitted ordered project bundle in a batch.
- Parameters:
index (int) – Position in the original batched project keys.
keys (dict[str, object]) – project keys for this batch entry.
result (BundledSolveSubmission | None) – submission for an ordered project bundle, if submission succeeded.
failure (BatchSolveFailure | None) – Failure information if submission did not succeed.
project_files (tuple[Path, ...], optional) – project files in ordered project bundle order.
Payload Base Classes
These public base classes define the provenance shared by single-result and batch payloads. Concrete payload types are documented above.
- class jcmsuite.results.ExportablePayload[source]
Common provenance state for a single-result export payload.
- class jcmsuite.results.BatchExportablePayload(sources)[source]
Independent base for aligned batch payload provenance.
Export Capability Mixins
These public base classes define the export capabilities shared by single-result and batch payloads. Concrete payload types are documented above.
- class jcmsuite.results.DictionaryExportMixin[source]
Capability for schema-faithful mapping export.
- class jcmsuite.results.DataFrameWideExportMixin[source]
Capability for rectangular, wide DataFrame export.