Skip to content

Base classes

polaris._artifact.BaseArtifactModel

Bases: BaseModel

Base class for all artifacts on the Hub. Specifies meta-data that is used by the Hub.

Optional

Despite all artifacts basing this class, note that all attributes are optional. This ensures the library can be used without the Polaris Hub. Only when uploading to the Hub, some of the attributes are required.

Attributes:

Name Type Description
name Optional[SlugCompatibleStringType]

A slug-compatible name for the dataset. Together with the owner, this is used by the Hub to uniquely identify the benchmark.

description str

A beginner-friendly, short description of the dataset.

tags list[str]

A list of tags to categorize the benchmark by. This is used by the hub to search over benchmarks.

user_attributes Dict[str, str]

A dict with additional, textual user attributes.

owner Optional[HubOwner]

A slug-compatible name for the owner of the dataset. If the dataset comes from the Polaris Hub, this is the associated owner (organization or user). Together with the name, this is used by the Hub to uniquely identify the benchmark.

polaris_version str

The version of the Polaris library that was used to create the artifact.

from_json classmethod

from_json(path: str)

Loads a benchmark from a JSON file.

Parameters:

Name Type Description Default
path str

Loads a benchmark specification from a JSON file.

required

to_json

to_json(path: str)

Saves the benchmark to a JSON file.

Parameters:

Name Type Description Default
path str

Saves the benchmark specification to a JSON file.

required