tauopt.models#
Pydantic mirrors of the /v1 API objects – what both drivers hand back to callers.
Featherweight: pydantic only. Shapes are SigOpt-lineage; Suggestion carries
the engine provenance that re-derives it. The space language spans
categorical/grid/conditions + linear constraints; the metrics cluster spans
multimetric/thresholds/stored + num_solutions; observations can carry noise.
Module Contents#
Classes#
One page of a list route ( |
|
One experiment metric: |
|
One search-space parameter: numeric ( |
|
One linear constraint over plain double parameters: the |
|
Wall-clock split of the suggest step: GP fit vs acquisition-optimization seconds across the ask. Absent on instant rungs (random/sobol). |
|
Mirror of the engine’s center-in-bootstrap decision record (branch / action / reason). |
|
Mirror of the engine’s provenance receipt (identity triple). |
|
One entry of best_assignments: |
|
Experiment progress snapshot: |
|
An optimization experiment: the search space ( |
|
One suggested trial: the |
|
One reported result for a set of assignments: |
|
200-with-empty-data when nothing succeeded yet – the answer is an empty set, not a broken service. Multimetric: the Pareto frontier. num_solutions > 1: the diverse top-k. |
|
One page of |
|
|
|
|
Functions#
The 400 |
|
The service’s body-defect gate, mirrored (app/api/validation.py |
Data#
API#
- tauopt.models.Assignments#
None
- tauopt.models.T#
‘TypeVar(…)’
- class tauopt.models.Page(rows: collections.abc.Iterable[tauopt.models.T] = (), *, total: int | None = None)#
Bases:
list[tauopt.models.T]One page of a list route (
Client.suggestions,Client.observations): thelistevery caller iterates, indexes and measures, plustotal– the TOTAL number of rows under the call’s filters (the service’scount; the page’s own length on the all-rows path), so a paging caller knows when it has read the last page. The attribute istotal, notcount, socount(value)stays the list method.copy(),copy.copy,copy.deepcopyand pickling keeptotal; a slice (page[1:]), a concatenation (page + rows) and a repetition (page * n) are plainlists without it, and an in-place+=orextendkeeps the oldtotal.==compares the rows only: a page equals a plain list of the same rows, and two pages with different totals and the same rows are equal.Initialization
Initialize self. See help(type(self)) for accurate signature.
- copy() tauopt.models.Page[tauopt.models.T]#
The list method, as a
Pagewith the sametotal(list.copyalone returns a plainlist).
- class tauopt.models.Metric(/, **data: Any)#
Bases:
pydantic.BaseModelOne experiment metric:
objectivesets the direction,strategythe role (optimized, stored-only, or an outcome constraint), andthresholdthe constraint/frontier bound.Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- tauopt.models.metric_shorthand_message(name: str) str#
The 400
validation_errormessage both drivers answer to a bare-stringmetric="<name>": the shorthand names no objective, and the old expansion to{"name": name}maximized a loss silently. One text, quoted by TROUBLESHOOTING.md, built here so the Client’s pre-flight and the local driver’s door never drift.
- class tauopt.models.ParameterSpec(/, **data: Any)#
Bases:
pydantic.BaseModelOne search-space parameter: numeric (
double/integer) with exactly one ofboundsor an explicitgrid, orcategoricalwithcategorical_values.conditionsmakes it active only when each named parent categorical takes one of the listed values.Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.models.LinearConstraintSpec(/, **data: Any)#
Bases:
pydantic.BaseModelOne linear constraint over plain double parameters: the
termscoefficient-weighted sumoprhs. Suggestions satisfy every linear constraint by construction.Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- op: Literal[>=, <=]#
None
- class tauopt.models.ProvenanceTimings(/, **data: Any)#
Bases:
pydantic.BaseModelWall-clock split of the suggest step: GP fit vs acquisition-optimization seconds across the ask. Absent on instant rungs (random/sobol).
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.models.CenterRecord(/, **data: Any)#
Bases:
pydantic.BaseModelMirror of the engine’s center-in-bootstrap decision record (branch / action / reason).
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.models.Provenance(/, **data: Any)#
Bases:
pydantic.BaseModelMirror of the engine’s provenance receipt (identity triple).
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- timings: tauopt.models.ProvenanceTimings | None#
None
- center: tauopt.models.CenterRecord | None#
None
- class tauopt.models.BestObservation(/, **data: Any)#
Bases:
pydantic.BaseModelOne entry of best_assignments:
valuein single-metric mode,valuesfor multimetric (frontier entries).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- assignments: tauopt.models.Assignments#
None
- class tauopt.models.Progress(/, **data: Any)#
Bases:
pydantic.BaseModelExperiment progress snapshot:
observation_count, the scalarbest_observation,expected_suggest_s(the next ask’s cost estimate; populated by the hosted plane, None from the local driver),open_suggestions(the open-suggestion count, both drivers), andfrontier_count(the size of the non-dominated frontier of a multimetric experiment, the hosted plane’s bounded count: None on single-metric experiments, from the local driver, and past the service’s listing bound). The scalar best is None until a non-failed observation exists, and always None for multimetric experiments (the frontier is read via best assignments instead).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- best_observation: tauopt.models.BestObservation | None#
None
- class tauopt.models.Experiment(/, **data: Any)#
Bases:
pydantic.BaseModelAn optimization experiment: the search space (
parametersplus optionallinear_constraints), the metric cluster (metric, ormetricswhen multimetric), and run settings (observation_budget,parallel_bandwidth,num_solutions).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- parameters: tuple[tauopt.models.ParameterSpec, ...]#
None
- metric: tauopt.models.Metric#
None
- metrics: tuple[tauopt.models.Metric, ...] | None#
None
- linear_constraints: tuple[tauopt.models.LinearConstraintSpec, ...] | None#
None
- progress: tauopt.models.Progress | None#
None
- tauopt.models.TAG_PRINTABLE_MESSAGE#
‘must be printable (no control or separator characters)’
- tauopt.models.NUL_MESSAGE#
‘NUL bytes are not allowed’
- tauopt.models.SURROGATE_MESSAGE#
‘strings must be valid UTF-8 (lone surrogates are not allowed)’
- tauopt.models.NONFINITE_MESSAGE#
‘non-finite numbers (NaN, Infinity) are not allowed’
- tauopt.models.body_defect(value: Any) str | None#
The service’s body-defect gate, mirrored (app/api/validation.py
body_defect): the first defect in a parsed body value – dict keys included, containers walked – or None: a string with a NUL, a string no UTF-8 encoder can carry (a lone surrogate), a non-finite float (bool is not float). The gate runs before any field parses, so on the hosted plane a defect inside a container sent astaganswers this text, never the type text; the Client’s facade and the local driver’s body door mirror that precedence (round 2 of the worker-tag lane, ASTRA-1).
- class tauopt.models.Suggestion(/, **data: Any)#
Bases:
pydantic.BaseModelOne suggested trial: the
assignmentsto evaluate next, plus theprovenancereceipt identifying exactly how it was derived (replay additionally needs the recorded experiment state).stateflips toclosedwhen an observation reports against it, when it is explicitly dismissed, or (hosted plane only) when the next ask finds it older than the experiment’ssuggestion_ttl_sand setsexpired_at.Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- assignments: tauopt.models.Assignments#
None
- provenance: tauopt.models.Provenance#
None
- class tauopt.models.Observation(/, **data: Any)#
Bases:
pydantic.BaseModelOne reported result for a set of assignments:
valueor per-metricvalues, optional noise viavalue_stddev/values_stddev, orfailed=Truefor a failed evaluation.suggestion_idis None when the observation is reported off-suggestion (direct assignments).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- assignments: tauopt.models.Assignments#
None
- class tauopt.models.BestAssignments(/, **data: Any)#
Bases:
pydantic.BaseModel200-with-empty-data when nothing succeeded yet – the answer is an empty set, not a broken service. Multimetric: the Pareto frontier. num_solutions > 1: the diverse top-k.
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- data: tuple[tauopt.models.BestObservation, ...]#
‘Field(…)’
- class tauopt.models.ExperimentList(/, **data: Any)#
Bases:
pydantic.BaseModelOne page of
GET /v1/experiments:countis the total under the call’s filters (by default the caller’s ACTIVE experiment total – the number the active-experiment cap counts – not the page size) anddatathe page, newest first by default, each row WITH itsprogress(the hosted list leavesexpected_suggest_snull; read one by id for the estimate). Archived experiments are listed only withinclude_deleted; read one by id.Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- data: tuple[tauopt.models.Experiment, ...]#
‘Field(…)’
- class tauopt.models.Health(/, **data: Any)#
Bases:
pydantic.BaseModelGET /health:statusis"ok"after the service’s database round-trip (no token needed, so it says nothing about yours); the local driver answers"ok"for the in-process engine.Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.models.AuthCheck(/, **data: Any)#
Bases:
pydantic.BaseModelGET /v1/auth/check:user_idis the account the token resolves to (an integer from the hosted service; the request is not counted as usage). The local driver has no accounts and answersNone.Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’