Skip to content

Commit

Permalink
attribute_defs.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Apr 18, 2023
1 parent d5d6f24 commit a8b47ac
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 11 deletions.
15 changes: 4 additions & 11 deletions share/openPMD/json_schema/attribute_defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,10 @@
"const": "ARR_DBL_7"
},
"value": {
"any_of": [
{
"type": "number"
},
{
"type": "array",
"items": {
"type": "number"
}
}
]
"type": "array",
"items": {
"type": "number"
}
}
}
}
Expand Down
157 changes: 157 additions & 0 deletions share/openPMD/json_schema/attribute_defs.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@

["$defs"]

######################
# Vectors of strings #
######################

["$defs".vec_string_attribute.properties]

value.any_of = [
{ type = "string" },
{ type = "array", items = { "type" = "string" } },
]

datatype.enum = [
"STRING",
"CHAR",
"SCHAR",
"UCHAR",
"VEC_STRING",
"VEC_CHAR",
"VEC_SCHAR",
"VEC_UCHAR",
]

##################
# Vectors of int #
##################

["$defs".vec_int_attribute.properties]

value.any_of = [
{ type = "integer" },
{ type = "array", items = { "type" = "integer" } },
]

datatype.enum = [
"SHORT",
"INT",
"LONG",
"LONGLONG",
"USHORT",
"UINT",
"ULONG",
"ULONGLONG",
"VEC_SHORT",
"VEC_INT",
"VEC_LONG",
"VEC_LONGLONG",
"VEC_USHORT",
"VEC_UINT",
"VEC_ULONG",
"VEC_ULONGLONG",
]

####################
# Vectors of float #
####################

["$defs".vec_float_attribute.properties]

value.any_of = [
{ type = "number" },
{ type = "array", items = { "type" = "number" } },
]

datatype.enum = [
"SHORT",
"INT",
"LONG",
"LONGLONG",
"USHORT",
"UINT",
"ULONG",
"ULONGLONG",
"FLOAT",
"DOUBLE",
"LONG_DOUBLE",
"CFLOAT",
"CDOUBLE",
"CLONG_DOUBLE",
"VEC_SHORT",
"VEC_INT",
"VEC_LONG",
"VEC_LONGLONG",
"VEC_USHORT",
"VEC_UINT",
"VEC_ULONG",
"VEC_ULONGLONG",
"VEC_FLOAT",
"VEC_DOUBLE",
"VEC_LONG_DOUBLE",
"VEC_CFLOAT",
"VEC_CDOUBLE",
"VEC_CLONG_DOUBLE",
]

###########################
# Special case: #
# unitDimension attribute #
###########################

["$defs".unitDimension.properties]

value = { type = "array", items = { type = "number" } }
datatype.const = "ARR_DBL_7"

#####################
# string attributes #
#####################

["$defs".string_attribute.properties]

value.type = "string"
datatype.enum = ["STRING", "CHAR", "SCHAR", "UCHAR"]

##################
# int attributes #
##################

["$defs".int_attribute.properties]

value.type = "integer"
datatype.enum = [
"SHORT",
"INT",
"LONG",
"LONGLONG",
"USHORT",
"UINT",
"ULONG",
"ULONGLONG",
]

####################
# float attributes #
####################

["$defs".float_attribute.properties]

value.type = "number"
datatype.enum = [
"SHORT",
"INT",
"LONG",
"LONGLONG",
"USHORT",
"UINT",
"ULONG",
"ULONGLONG",
"FLOAT",
"DOUBLE",
"LONG_DOUBLE",
"CFLOAT",
"CDOUBLE",
"CLONG_DOUBLE",
]

0 comments on commit a8b47ac

Please sign in to comment.