Skip to content

Commit 9413821

Browse files
committed
Proper dataset definitions
1 parent 3e4c506 commit 9413821

File tree

3 files changed

+76
-30
lines changed

3 files changed

+76
-30
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
["$defs"]
2+
3+
######################################
4+
# n-dimensional datasets of any type #
5+
######################################
6+
7+
[["$defs".any_type_recursive_array.anyOf]]
8+
type = "array"
9+
items.type = "number"
10+
11+
[["$defs".any_type_recursive_array.anyOf]]
12+
type = "array"
13+
items."$ref" = "#/$defs/any_type_recursive_array"
14+
15+
["$defs".any_type_dataset.properties]
16+
17+
datatype.enum = [
18+
"CHAR",
19+
"UCHAR",
20+
"SCHAR",
21+
"SHORT",
22+
"INT",
23+
"LONG",
24+
"LONGLONG",
25+
"USHORT",
26+
"UINT",
27+
"ULONG",
28+
"ULONGLONG",
29+
"FLOAT",
30+
"DOUBLE",
31+
"LONG_DOUBLE",
32+
"CFLOAT",
33+
"CDOUBLE",
34+
"CLONG_DOUBLE",
35+
"BOOL",
36+
]
37+
data."$ref" = "#/$defs/any_type_recursive_array"
38+
39+
######################################
40+
# n-dimensional datasets of int type #
41+
######################################
42+
43+
[["$defs".int_type_recursive_array.intOf]]
44+
type = "array"
45+
items.type = "integer"
46+
47+
[["$defs".int_type_recursive_array.intOf]]
48+
type = "array"
49+
items."$ref" = "#/$defs/int_type_recursive_array"
50+
51+
["$defs".int_type_dataset.properties]
52+
53+
datatype.enum = [
54+
"CHAR",
55+
"UCHAR",
56+
"SCHAR",
57+
"SHORT",
58+
"INT",
59+
"LONG",
60+
"LONGLONG",
61+
"USHORT",
62+
"UINT",
63+
"ULONG",
64+
"ULONGLONG",
65+
"BOOL",
66+
]
67+
data."$ref" = "#/$defs/int_type_recursive_array"

share/openPMD/json_schema/particle_patches.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ description = "Custom attributes allowed, no required attributes defined."
1919
[properties.numParticles]
2020
title = "numParticles"
2121
description = "number of particles in this patch"
22-
23-
# todo: INT type dataset
24-
"$ref" = "record_component.json"
22+
allOf = [
23+
{ "$ref" = "record_component.json" },
24+
{ "$ref" = "dataset_defs.json#/$defs/int_type_dataset" },
25+
]
2526

2627

2728
[properties.numParticlesOffset]
2829
title = "numParticles"
2930
description = "offset within the one-dimensional records of the particle species where the first particle in this patch is stored"
30-
31-
# todo: INT type dataset
32-
"$ref" = "record_component.json"
31+
allOf = [
32+
{ "$ref" = "record_component.json" },
33+
{ "$ref" = "dataset_defs.json#/$defs/int_type_dataset" },
34+
]
3335

3436

3537
[properties.offset]

share/openPMD/json_schema/record_component.toml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,7 @@ required = ["data", "datatype"]
4747
description = "An n-dimensional dataset containing the payload."
4848
title = "Array dataset"
4949

50-
[allOf.oneOf.properties]
51-
52-
datatype.enum = [
53-
"CHAR",
54-
"UCHAR",
55-
"SCHAR",
56-
"SHORT",
57-
"INT",
58-
"LONG",
59-
"LONGLONG",
60-
"USHORT",
61-
"UINT",
62-
"ULONG",
63-
"ULONGLONG",
64-
"FLOAT",
65-
"DOUBLE",
66-
"LONG_DOUBLE",
67-
"CFLOAT",
68-
"CDOUBLE",
69-
"CLONG_DOUBLE",
70-
"BOOL",
71-
]
72-
# TODO: properly define this
73-
data.type = "array"
50+
"$ref" = "dataset_defs.json#/$defs/any_type_dataset"
7451

7552
########################
7653
# Option 2.2: Constant #

0 commit comments

Comments
 (0)