Skip to content

panoptes.pipeline.settings

panoptes.pipeline.settings

PipelineParams

Bases: BaseSettings

Source code in src/panoptes/pipeline/settings.py
class PipelineParams(BaseSettings):
    camera: CameraSettings = CameraSettings()
    catalog: CatalogSettings = CatalogSettings()
    background: BackgroundSettings = BackgroundSettings()

    @property
    def fingerprint(self) -> str:
        """A short digest of every parameter that affects a product.

        This is the cache key, not decoration. The old flow stored `params` in
        every document and never compared them, so changing a setting left
        stale products behind with no signal that they no longer matched the
        settings that were supposed to have produced them. See data contract
        3.4.

        Keys are sorted so the digest depends on the values and not on field
        declaration order -- otherwise reordering a model would invalidate the
        entire archive.
        """
        canonical = json.dumps(json.loads(self.model_dump_json()), sort_keys=True)
        digest = hashlib.sha256(canonical.encode()).hexdigest()
        return digest[:FINGERPRINT_LENGTH]

fingerprint property

fingerprint: str

A short digest of every parameter that affects a product.

This is the cache key, not decoration. The old flow stored params in every document and never compared them, so changing a setting left stale products behind with no signal that they no longer matched the settings that were supposed to have produced them. See data contract 3.4.

Keys are sorted so the digest depends on the values and not on field declaration order -- otherwise reordering a model would invalidate the entire archive.