diff --git a/docs/_modules/hdhelpers/metadata/conventions.html b/docs/_modules/hdhelpers/metadata/conventions.html index 6749dba..6558a24 100644 --- a/docs/_modules/hdhelpers/metadata/conventions.html +++ b/docs/_modules/hdhelpers/metadata/conventions.html @@ -58,1887 +58,1886 @@
18The models document the request body of the hetida designer backend endpoint for checking 19metadata. Hence they occur as JSON Schemas in the openapi.json of the backend, so that third party 20projects, e.g. adapters providing or receiving such metadata, can validate against them. - 21Additional fields are allowed at every level. The models are immutable, see ConventionModel. - 22Metadata timestamps are UTC ISO strings with an explicit Z or +00:00 offset. - 23 - 24check_metadata_conventions additionally checks the rules which JSON Schema cannot express, - 25optionally against the actual data. - 26""" - 27 - 28import datetime - 29import difflib - 30import json - 31import math - 32import re - 33from collections import Counter - 34from collections.abc import Mapping - 35from enum import StrEnum - 36from functools import cache, lru_cache - 37from importlib import resources - 38from typing import Annotated, Any, ClassVar, Literal, NoReturn, Self - 39 - 40import pandas as pd - 41from pydantic import ( - 42 AfterValidator, - 43 BaseModel, - 44 BeforeValidator, - 45 ConfigDict, - 46 Field, - 47 GetJsonSchemaHandler, - 48 ModelWrapValidatorHandler, - 49 StrictBool, - 50 StrictFloat, - 51 StrictInt, - 52 StrictStr, - 53 ValidationError, - 54 ValidationInfo, - 55 model_validator, - 56) - 57from pydantic.json_schema import JsonSchemaValue - 58from pydantic_core import CoreSchema, PydanticCustomError - 59 - 60from hdhelpers.metadata._reading import MetadataReading, id_of - 61 - 62TimeseriesDataType = Literal["SERIES", "SINGLETSFRAME", "MULTITSFRAME"] - 63 + 21Their docstrings and field descriptions become the descriptions of these schemas, so they are + 22written for JSON users: null, true and false instead of their Python counterparts and no Python + 23names, e.g. of functions or parameters. + 24Additional fields are allowed at every level. The models are immutable, see ConventionModel. + 25Metadata timestamps are UTC ISO strings with an explicit Z or +00:00 offset. + 26 + 27check_metadata_conventions additionally checks the rules which JSON Schema cannot express, + 28optionally against the actual data. + 29""" + 30 + 31import datetime + 32import difflib + 33import json + 34import math + 35import re + 36from collections import Counter + 37from collections.abc import Mapping + 38from enum import StrEnum + 39from functools import cache, lru_cache + 40from importlib import resources + 41from typing import Annotated, Any, ClassVar, Literal, NoReturn, Self + 42 + 43import pandas as pd + 44from pydantic import ( + 45 AfterValidator, + 46 BaseModel, + 47 BeforeValidator, + 48 ConfigDict, + 49 Field, + 50 GetJsonSchemaHandler, + 51 ModelWrapValidatorHandler, + 52 StrictBool, + 53 StrictFloat, + 54 StrictInt, + 55 StrictStr, + 56 ValidationError, + 57 ValidationInfo, + 58 model_validator, + 59) + 60from pydantic.json_schema import JsonSchemaValue + 61from pydantic_core import CoreSchema, PydanticCustomError + 62 + 63from hdhelpers.metadata._reading import MetadataReading, id_of 64 + 65TimeseriesDataType = Literal["SERIES", "SINGLETSFRAME", "MULTITSFRAME"] + 66 + 67
Immutable metadata for a SERIES: one metric with a single “value” dimension.
-Read from a pandas Series with read_metadata. See the module documentation for storage, -adapter exchange and common field rules.
+Metadata of a SERIES: one metric with a single “value” dimension.
+Exchanged with adapters, e.g. in the Data-Attributes header of generic REST adapter endpoints +or the __metadata__ field of the direct provisioning adapter’s wrapped format.
Immutable metadata for a SINGLETSFRAME: one metric with one or more value columns.
-Read from a pandas DataFrame with read_metadata. See the module documentation for storage, -adapter exchange and common field rules.
+Metadata of a SINGLETSFRAME: one metric with one or more value columns.
+Exchanged with adapters, e.g. in the Data-Attributes header of generic REST adapter endpoints +or the __metadata__ field of the direct provisioning adapter’s wrapped format.
Immutable metadata for a MULTITSFRAME: multiple metrics identified by a metric column.
+Metadata of a MULTITSFRAME: multiple metrics identified by a metric column.
Each metric can have several value dimensions; a MULTITSFRAME may also hold one metric. -Read from a pandas DataFrame with read_metadata. See the module documentation for storage, -adapter exchange and common field rules.
+Exchanged with adapters, e.g. in the Data-Attributes header of generic REST adapter endpoints +or the __metadata__ field of the direct provisioning adapter’s wrapped format.unit and measurement. Unit and measurement
may be None. Optional fields include names, data type, deadband and display precision.
Properties supplied by a source system for a metric and its parent assets.
Stores already-resolved values, e.g. a plant’s latitude; the source system resolves the
-hierarchy. Metadata lookups use these properties as fallbacks only with
-include_inherited=True. Convention-defined fields such as name, id and unit belong in
-the metric or value-dimension metadata.
Use JSON types matching each value’s meaning: numbers, booleans and UTC ISO timestamp strings for points in time. For example, hetida platform supplies properties by label, using a signal’s own value or that of the nearest parent asset providing one.
+The reading methods of the root models use these properties as fallbacks only with
+include_inherited=True.
Method for aggregating timeseries values into coarser intervals.
-Metadata lookups normalize AVG to MEAN; they are distinct enum values.
+AVG is an alias of MEAN.
Severity of an issue found when checking metadata against the metadata conventions
-error: Violates the conventions, so helpers and components may misinterpret the metadata. +
error: Violates the conventions, so consumers like components may misinterpret the metadata. warning: Likely a mistake, e.g. metadata not matching the data.
A metadata validation problem, reported as an error or warning.
+A problem found when checking metadata against the metadata conventions
+An error for a violation of the conventions, a warning for a likely mistake.
Error for a violation; warning for a likely mistake.
-Path to the affected field, e.g. “metrics[0].name”; empty for the -metadata as a whole.
-str
-Path to the affected field, e.g. "metrics[0].name"; empty for the metadata as a whole.
Explanation of the problem.
-str
-