petitRADTRANS.sbi.artifacts
===========================

.. py:module:: petitRADTRANS.sbi.artifacts

.. autoapi-nested-parse::

   Artifact metadata and registry interfaces for SBI assets.



Classes
-------

.. autoapisummary::

   petitRADTRANS.sbi.artifacts.ArtifactRole
   petitRADTRANS.sbi.artifacts.ArtifactMetadata
   petitRADTRANS.sbi.artifacts.ArtifactRegistry
   petitRADTRANS.sbi.artifacts.RegisteredArtifact
   petitRADTRANS.sbi.artifacts.FileArtifactRegistry


Module Contents
---------------

.. py:class:: ArtifactRole

   Bases: :py:obj:`str`, :py:obj:`enum.Enum`


   Artifact categories produced by the SBI workflow.


   .. py:attribute:: SIMULATION_DATASET
      :value: 'simulation_dataset'



   .. py:attribute:: POSTERIOR_MODEL
      :value: 'posterior_model'



   .. py:attribute:: BENCHMARK_REPORT
      :value: 'benchmark_report'



   .. py:attribute:: CALIBRATION_REPORT
      :value: 'calibration_report'



.. py:class:: ArtifactMetadata

   Traceability metadata shared by all persisted SBI artifacts.


   .. py:attribute:: role
      :type:  ArtifactRole


   .. py:attribute:: task_name
      :type:  str


   .. py:attribute:: version
      :type:  str


   .. py:attribute:: estimator_family
      :type:  str | None
      :value: None



   .. py:attribute:: task_version
      :type:  str | None
      :value: None



   .. py:attribute:: task_fingerprint
      :type:  str | None
      :value: None



   .. py:attribute:: preprocessing_version
      :type:  str | None
      :value: None



   .. py:attribute:: forward_model_family
      :type:  str | None
      :value: None



   .. py:attribute:: petitradtrans_version
      :type:  str | None
      :value: None



   .. py:attribute:: retrieval_config_digest
      :type:  str | None
      :value: None



   .. py:attribute:: opacity_digest
      :type:  str | None
      :value: None



   .. py:attribute:: observation_schema
      :type:  Mapping[str, Any]


   .. py:attribute:: preprocessing_metadata
      :type:  Mapping[str, Any]


   .. py:attribute:: metadata
      :type:  Mapping[str, Any]


   .. py:method:: to_payload() -> dict[str, Any]


   .. py:method:: from_payload(payload: Mapping[str, Any]) -> ArtifactMetadata
      :classmethod:



   .. py:method:: from_task(task: petitRADTRANS.sbi.task.SBITask, role: ArtifactRole, version: str, estimator_family: str | None = None, metadata: Mapping[str, Any] | None = None, preprocessing_metadata: Mapping[str, Any] | None = None, retrieval_config_digest: str | None = None, opacity_digest: str | None = None) -> ArtifactMetadata
      :classmethod:


      Build artifact metadata from an SBI task family.



.. py:class:: ArtifactRegistry

   Bases: :py:obj:`abc.ABC`


   Resolve and persist versioned SBI artifacts.


   .. py:method:: register(metadata: ArtifactMetadata, location: str) -> None
      :abstractmethod:


      Register an artifact location under the supplied metadata.



   .. py:method:: resolve(role: ArtifactRole, task_name: str, version: str | None = None) -> str
      :abstractmethod:


      Resolve an artifact path or URI for the requested task and role.



.. py:class:: RegisteredArtifact

   Stored registry entry for one persisted artifact.


   .. py:attribute:: metadata
      :type:  ArtifactMetadata


   .. py:attribute:: location
      :type:  str


   .. py:method:: to_payload() -> dict[str, Any]


   .. py:method:: from_payload(payload: Mapping[str, Any]) -> RegisteredArtifact
      :classmethod:



.. py:class:: FileArtifactRegistry(root_directory: str)

   Bases: :py:obj:`ArtifactRegistry`


   Simple JSON-backed registry for local SBI artifacts.


   .. py:attribute:: root_directory


   .. py:attribute:: index_path


   .. py:method:: _load_entries() -> list[RegisteredArtifact]


   .. py:method:: _write_entries(entries: list[RegisteredArtifact]) -> None


   .. py:method:: register(metadata: ArtifactMetadata, location: str) -> None

      Register an artifact location under the supplied metadata.



   .. py:method:: resolve(role: ArtifactRole, task_name: str, version: str | None = None) -> str

      Resolve an artifact path or URI for the requested task and role.



