MODULE REFERENCE

datasets

anomx.integrations.platform.datasets

Datasets connected to an Anomx platform.

An AnomxDataset bridges local work and the platform's data module:

```python dataset = AnomxDataset.from_anomx("data_dataset:42f1…") # load by identifier observation_set = dataset.to_observation_set()

dataset = AnomxDataset(name="lab-run-7", frame=frame) dataset.sync_with_anomx() # create it in anomx ```

Credentials come from the /.anomx home the CLI agent maintains; without a configured platform connection an AnomxConnectionError is raised.

AnomxConnectionError

AnomxConnectionError

Bases: RuntimeError

Raised when no platform connection is configured or a call fails.

AnomxDataset

AnomxDataset(*, identifier: str | None = None, name: str = '', description: str = '', frame: pd.DataFrame | None = None, metadata: dict[str, Any] | None = None)

A dataset that can be loaded from or created on an Anomx platform.

Signature parameters
ParameterTypeDefault
identifierkeyword onlystr | NoneNone
namekeyword onlystr''
descriptionkeyword onlystr''
framekeyword onlypd.DataFrame | NoneNone
metadatakeyword onlydict[str, Any] | NoneNone

Members

from_anomxclassmethod
from_anomx(identifier: str, *, home: Any | None = None) -> 'AnomxDataset'

Load a whole dataset (metadata and samples) from the platform.

Signature parameters
ParameterTypeDefault
identifierstrrequired
homekeyword onlyAny | NoneNone

Returns 'AnomxDataset'

sync_with_anomxmethod
sync_with_anomx(*, home: Any | None = None) -> str

Create this locally composed dataset on the platform.

Returns the created dataset identifier and stores it on the instance. Sample upload is not part of this first pass — the platform object is created with the dataset's metadata.

Signature parameters
ParameterTypeDefault
homekeyword onlyAny | NoneNone

Returns str

to_observation_setmethod
to_observation_set(**kwargs: Any) -> ObservationSet

Materialize the loaded samples as the canonical observation set.

Signature parameters
ParameterTypeDefault
**kwargsAny—

Returns ObservationSet

to_csvmethod
to_csv() -> str

Serialize the samples as CSV (mirrors the platform export format).

Returns str

read_platform_connection

read_platform_connection(home: Any | None = None) -> dict[str, str]

Read the platform URL and token from the /.anomx home.

Signature parameters
ParameterTypeDefault
homeAny | NoneNone

Returns dict[str, str]

REQUEST_TIMEOUT_SECONDS

REQUEST_TIMEOUT_SECONDS = 30