23
23
from mdio .schemas .v1 .stats import StatisticsMetadata
24
24
from mdio .schemas .v1 .units import AllUnits
25
25
26
+ CoordinateMetadata = create_model (
27
+ "CoordinateMetadata" ,
28
+ ** model_fields (AllUnits ),
29
+ ** model_fields (UserAttributes ),
30
+ __base__ = CamelCaseStrictModel ,
31
+ __doc__ = "Reduced Metadata, perfect for simple Coordinates." ,
32
+ )
33
+
26
34
27
35
class Coordinate (NamedArray ):
28
- """An MDIO coordinate array with metadata."""
36
+ """A simple MDIO Coordinate array with metadata.
29
37
30
- data_type : ScalarType = Field (..., description = "Data type of coordinate." )
31
- metadata : list [AllUnits | UserAttributes ] | None = Field (
32
- default = None , description = "Coordinate metadata."
33
- )
38
+ For large or complex Coordinates, define a Variable instead.
39
+ """
40
+
41
+ data_type : ScalarType = Field (..., description = "Data type of Coordinate." )
42
+ metadata : CoordinateMetadata | None = Field (default = None , description = "Coordinate Metadata." )
34
43
35
44
36
45
VariableMetadata = create_model (
@@ -40,14 +49,15 @@ class Coordinate(NamedArray):
40
49
** model_fields (StatisticsMetadata ),
41
50
** model_fields (UserAttributes ),
42
51
__base__ = CamelCaseStrictModel ,
52
+ __doc__ = "Complete Metadata for Variables and complex or large Coordinates." ,
43
53
)
44
54
45
55
46
56
class Variable (NamedArray ):
47
- """An MDIO variable that has coordinates and metadata."""
57
+ """An MDIO Variable that has coordinates and metadata."""
48
58
49
59
coordinates : list [Coordinate ] | list [str ] | None = Field (
50
60
default = None ,
51
- description = "Coordinates of the MDIO variable dimensions." ,
61
+ description = "Coordinates of the MDIO Variable dimensions." ,
52
62
)
53
- metadata : VariableMetadata | None = Field (default = None , description = "Variable metadata ." )
63
+ metadata : VariableMetadata | None = Field (default = None , description = "Variable Metadata ." )
0 commit comments