EOS batch, archive, and session API

Batch plans describe a deterministic sequence of fit requests. Native archives preserve every immutable attempt together with accepted/candidate state and history. Session provides the stateful public surface appropriate for a notebook, service, or future GUI.

Batch contracts

quantas.api.eos.BatchFailurePolicy

alias of EOSBatchFailurePolicy

quantas.api.eos.BatchJob

alias of EOSBatchJob

quantas.api.eos.BatchPlan

alias of EOSBatchPlan

quantas.api.eos.BatchResult

alias of EOSBatchResult

Specification files

quantas.api.eos.SPEC_TEMPLATE_FILENAME = 'eos.spec'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

quantas.api.eos.read_spec(path)

Read and parse an EOS specification from any regular text file.

Parameters:
pathstr or Path

Specification path. The suffix has no semantic meaning.

Returns:
EOSSpecDocument

Parsed document with input-unit declarations available immediately.

Raises:
EOSSpecError

If the signature, sections, keys, or scalar values are invalid.

OSError

If the file cannot be read.

Parameters:

path (str | Path)

Return type:

EOSSpecDocument

quantas.api.eos.resolve_spec(document, dataset)

Resolve defaults, targets, models, constraints, and solver contracts.

Parameters:
documentEOSSpecDocument

Parsed EOS specification.

datasetEOSDataset

Normalized dataset used to expand targets = all and validate target availability.

Returns:
EOSResolvedSpec

Typed batch plan and report options.

Raises:
EOSSpecError

If inherited settings are inconsistent or unavailable for dataset.

Parameters:
  • document (EOSSpecDocument)

  • dataset (EOSDataset)

Return type:

EOSResolvedSpec

quantas.api.eos.write_spec_template(path='eos.spec', *, overwrite=False)

Write the complete EOS specification template to disk.

Parameters:
pathstr or Path, optional

Destination path. Its suffix has no semantic meaning.

overwritebool, optional

Replace an existing regular file when True.

Returns:
pathlib.Path

Resolved destination object used for writing.

Raises:
FileExistsError

If the destination exists and overwrite is False.

IsADirectoryError

If path identifies a directory.

OSError

If the destination cannot be written.

Parameters:
  • path (str | Path)

  • overwrite (bool)

Return type:

Path

Batch execution

quantas.api.eos.run_batch(input_data, plan, archive, *, observer=None, overwrite=False, creator='quantas eos run', pressure_unit=None, length_unit=None, temperature_unit=None)

Run and persist an EOS batch plan.

Parameters:
input_dataDataset, str, or Path

Normalized EOS dataset or input path.

planBatchPlan

Ordered fitting jobs and acceptance policy.

archivestr or Path

Destination native EOS HDF5 archive.

observerObserver or None, optional

Frontend-neutral workflow observer.

overwritebool, optional

Replace an existing archive.

creatorstr, optional

Provenance identifier written to archive metadata.

pressure_unit, length_unit, temperature_unitstr or None, optional

Unit overrides used when reading a path.

Returns:
BatchResult

Structured summary of attempted, accepted, and failed fits.

Raises:
FileExistsError

If the archive exists and overwrite is false.

ValueError

If the plan or input dataset is invalid.

Parameters:
  • input_data (EOSDataset | str | Path)

  • plan (EOSBatchPlan)

  • archive (str | Path)

  • observer (Observer | None)

  • overwrite (bool)

  • creator (str)

  • pressure_unit (str | None)

  • length_unit (str | None)

  • temperature_unit (str | None)

Return type:

EOSBatchResult

Native archive

quantas.api.eos.Archive

alias of EOSArchive

quantas.api.eos.open_archive(path, *, writable=False)

Open a native EOS archive.

Parameters:
pathstr or Path

Existing native EOS HDF5 archive.

writablebool, optional

Open in append/update mode when true.

Returns:
Archive

Active archive handle. Use it as a context manager or call close.

Raises:
ValueError

If the file is not a supported EOS archive.

Parameters:
  • path (str | Path)

  • writable (bool)

Return type:

EOSArchive

Persistent session

quantas.api.eos.Session

alias of EOSSession