EOS input and fitting operations

The direct fitting layer parses and normalizes datasets, validates one scientific request, executes the selected regression strategy, and returns an in-memory fit result. It does not mutate an archive unless the caller later adds the result through a batch or session.

Input

quantas.api.eos.read_input(source, *, pressure_unit=None, length_unit=None, temperature_unit=None)

Read and normalize one EOS dataset.

Parameters:
sourcestr or Path

Keyword-directed EOS input table.

pressure_unit, length_unit, temperature_unitstr or None, optional

Explicit unit overrides. File declarations and documented defaults are used when omitted.

Returns:
Dataset

Validated float64 dataset with normalized units and selection metadata.

Raises:
ValueError

If the file format, units, or scientific columns are invalid.

Parameters:
  • source (str | Path)

  • pressure_unit (str | None)

  • length_unit (str | None)

  • temperature_unit (str | None)

Return type:

EOSDataset

quantas.api.eos.normalize_input(source, *, pressure_unit=None, length_unit=None, temperature_unit=None)

Return a normalized EOS dataset.

Parameters:
sourceDataset, str, or Path

Existing dataset contract or input path.

pressure_unit, length_unit, temperature_unitstr or None, optional

Explicit unit overrides used only when reading a path.

Returns:
Dataset

Validated EOS dataset.

Raises:
TypeError

If source is neither a dataset nor a path.

Parameters:
  • source (EOSDataset | str | Path)

  • pressure_unit (str | None)

  • length_unit (str | None)

  • temperature_unit (str | None)

Return type:

EOSDataset

Capabilities and request validation

quantas.api.eos.domain_capability(domain)

Return the declared capability for one EOS domain.

Parameters:
domainEOSFitDomain or str

Stable domain value such as "pv" or "ev".

Returns:
EOSDomainCapability

Immutable capability declaration.

Raises:
ValueError

If the domain is unknown.

Parameters:

domain (EOSFitDomain | str)

Return type:

EOSDomainCapability

quantas.api.eos.default_solver_options(method)

Return default typed options for a fitting method.

Parameters:
methodFitMethod or str

Requested statistical strategy.

Returns:
SolverOptions

Fresh method-specific options object.

Parameters:

method (FitMethod | str)

Return type:

OLSOptions | WLSOptions | EffectiveVarianceOptions | OrthogonalDistanceOptions

quantas.api.eos.validate_request(input_data, request)

Validate one EOS request against a normalized dataset.

Parameters:
input_dataDataset, str, or Path

EOS dataset or input path.

requestFitRequest

Fit request to validate without executing the solver.

Raises:
ValueError

If the domain, target, model, data selection, or constraints are incompatible.

Parameters:
  • input_data (EOSDataset | str | Path)

  • request (EOSFitRequest)

Return type:

None

Direct fitting

quantas.api.eos.fit(input_data, request, *, pressure_unit=None, length_unit=None, temperature_unit=None)

Fit one EOS request.

Parameters:
input_dataDataset, str, or Path

Normalized EOS dataset or input table path.

requestFitRequest

Model, scientific domain, target, parameter constraints, and solver options.

pressure_unit, length_unit, temperature_unitstr or None, optional

Unit overrides used when input_data is a path.

Returns:
FitResult

Immutable fit result including parameters, uncertainties, residuals, warnings, and numerical diagnostics.

Raises:
ValueError

If the request is incompatible with the dataset or the selected model.

Parameters:
  • input_data (EOSDataset | str | Path)

  • request (EOSFitRequest)

  • pressure_unit (str | None)

  • length_unit (str | None)

  • temperature_unit (str | None)

Return type:

EOSFitResult

Record metadata helper

quantas.api.eos.record_domain(archive, *, slot=None, record_id=None)

Return the scientific domain of one EOS archive record.

Parameters:
archivestr or Path

Native EOS HDF5 archive.

slotstr, ResultSlot, or None, optional

Accepted result slot.

record_idint or None, optional

Explicit immutable record identifier.

Returns:
FitDomain

pv, vt, or pvt domain of the selected record.

Raises:
ValueError

If record selection is ambiguous or invalid.

Parameters:
  • archive (str | Path)

  • slot (str | EOSResultSlot | None)

  • record_id (int | None)

Return type:

EOSFitDomain