Source code for httk.optimade.model.config

from dataclasses import dataclass, field
from typing import Any


def _default_provider() -> dict[str, Any]:
    return {
        "name": "httk",
        "description": (
            "This is a database hosted with the High-Throughput Toolkit (httk), "
            "for which the hoster has not specifically configured the provider."
        ),
        "prefix": "httk",
    }


@dataclass
[docs] class OptimadeConfig: """Configuration of a served OPTIMADE database. ``implementation`` extends/overrides the fields of the ``meta`` -> ``implementation`` dictionary (e.g. ``issue_tracker``, ``source_url``, ``maintainer``). ``database``, ``schema_url``, and ``request_delay`` populate the corresponding optional ``meta`` fields (OPTIMADE v1.2+) when set. ``license``, ``available_licenses``, and ``available_licenses_for_entries`` populate the corresponding optional base-info attributes when set. ``data_available`` is filled in by ``process_init`` with the number of available entries per entry endpoint. """
[docs] provider: dict[str, Any] = field(default_factory=_default_provider)
[docs] implementation: dict[str, Any] = field(default_factory=dict)
[docs] database: dict[str, Any] | None = None
[docs] schema_url: str | None = None
[docs] request_delay: float | None = None
[docs] license: dict[str, Any] | str | None = None
[docs] available_licenses: list[str] | None = None
[docs] available_licenses_for_entries: list[str] | None = None
[docs] data_available: dict[str, int] = field(default_factory=dict)
[docs] partial_data_chunk_size: int = 1000