Skip to content

Commit 07acb94

Browse files
committed
mesh.toml
1 parent 8754438 commit 07acb94

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#########################################################
2+
# Requirement 1: Mesh-specific structure and attributes #
3+
#########################################################
4+
5+
[[allOf]]
6+
7+
type = "object"
8+
required = ["attributes"]
9+
title = "Mesh"
10+
description = "A mesh/grid of cells."
11+
12+
[allOf.properties.attributes]
13+
title = "Attributes"
14+
15+
####################################
16+
# Requirement 1.1: Mesh attributes #
17+
####################################
18+
19+
[[allOf.properties.attributes.allOf]]
20+
21+
title = "Mesh attributes"
22+
description = "Standard-defined attributes at the Mesh level."
23+
required = [
24+
"axisLabels",
25+
"geometry",
26+
"gridGlobalOffset",
27+
"gridSpacing",
28+
"gridUnitSI",
29+
"timeOffset",
30+
"unitDimension",
31+
]
32+
33+
[allOf.properties.attributes.allOf.properties]
34+
35+
gridUnitSI."$ref" = "attribute_defs.json#/$defs/float_attribute"
36+
gridSpacing."$ref" = "attribute_defs.json#/$defs/vec_float_attribute"
37+
gridGlobalOffset."$ref" = "attribute_defs.json#/$defs/vec_float_attribute"
38+
timeOffset."$ref" = "attribute_defs.json#/$defs/float_attribute"
39+
geometryParameters."$ref" = "attribute_defs.json#/$defs/string_attribute"
40+
unitDimension."$ref" = "attribute_defs.json#/$defs/unitDimension"
41+
geometry."$ref" = "attribute_defs.json#/$defs/string_attribute"
42+
dataOrder."$ref" = "attribute_defs.json#/$defs/string_attribute"
43+
axisLabels."$ref" = "attribute_defs.json#/$defs/vec_string_attribute"
44+
45+
################################################
46+
# Requirement 1.1: Generic attribute structure #
47+
################################################
48+
49+
[[allOf.properties.attributes.allOf]]
50+
title = "Attribute layout"
51+
"$ref" = "attributes.json"
52+
53+
######################################
54+
# Requirement 2: Contains components #
55+
######################################
56+
57+
[[allOf]]
58+
59+
title = "Contains components"
60+
description = "Additionally to the attributes, at least one component must be contained"
61+
62+
####################################################
63+
# Requirement 2.1: Either this is a scalar mesh... #
64+
####################################################
65+
66+
[[allOf.oneOf]]
67+
title = "Scalar mesh component"
68+
"$ref" = "mesh_record_component.json"
69+
70+
#################################################
71+
# Requirement 2.1: ... or it's a vector mesh. #
72+
# Note that exactly one of these two conditions #
73+
# must be true, not both at once (oneOf). #
74+
#################################################
75+
76+
[[allOf.oneOf]]
77+
title = "Vector component"
78+
# The attributes are contained in this dict, and at least one further
79+
# non-scalar component. Hence, we require at least two entries.
80+
minProperties = 2
81+
propertyNames.pattern = "^\\w*$"
82+
83+
[allOf.oneOf.patternProperties."^(?!attributes).*"]
84+
title = "Vector mesh component"
85+
"$ref" = "mesh_record_component.json"

0 commit comments

Comments
 (0)