pittgoogle.registry

Pitt-Google registries.

ProjectIds([pittgoogle, pittgoogle_dev, ...])

Registry of Google Cloud Project IDs.

Schemas()

Registry of schemas used by Pitt-Google.


class pittgoogle.registry.ProjectIds(pittgoogle: Final[str] = 'ardent-cycling-243415', pittgoogle_dev: Final[str] = 'avid-heading-329016', elasticc: Final[str] = 'elasticc-challenge')[source]

Registry of Google Cloud Project IDs.

elasticc: Final[str]

Project running classifiers for ELAsTiCC alerts and reporting to DESC.

pittgoogle: Final[str]

Pitt-Google’s production project.

pittgoogle_dev: Final[str]

Pitt-Google’s testing and development project.

class pittgoogle.registry.Schemas[source]

Registry of schemas used by Pitt-Google.

Examples

# View list of registered schema names.
pittgoogle.Schemas().names

# Load a schema (choose a name from above and substitute it below).
schema = pittgoogle.Schemas().get(schema_name="ztf")

# View more information about all the schemas.
pittgoogle.Schemas().manifest

For Developers: Add a new schema to the registry


static get(schema_name: Literal['elasticc', 'lsst', 'lvk', 'ztf', 'default', None] = 'default', alert_bytes: bytes | None = None) Schema[source]

Return the schema with name matching schema_name.

Parameters:
  • schema_name (str or None, optional) – Name of the schema to return. If None, the default schema is returned.

  • alert_bytes (bytes or None, optional) – Message data, if available. Some schemas will use this to infer the schema version.

Returns:

Schema from the registry with name matching schema_name.

Return type:

schema.Schema

Raises:

exceptions.SchemaError – If a schema named schema_name is not found in the registry or cannot be loaded.

property manifest: list[dict]

List of dicts containing the registration information of all known schemas.

property names: list[str]

Names of all registered schemas.

A name from this list can be used with the Schemas.get() method to load a schema. Capital letters between angle brackets indicate that you should substitute your own values. For example, to use the LSST schema listed here as "lsst.v<MAJOR>_<MINOR>.alert", choose your own major and minor versions and use like pittgoogle.Schemas.get("lsst.v7_1.alert"). View available schema versions by following the origin link in Schemas.manifest.