Skip to content

Commit 71f9705

Browse files
committed
Regex Comments
1 parent 386fd88 commit 71f9705

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

openpmd_validator/check_h5.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,9 @@ def check_root_attr(f, v):
397397
result_array += test_attr(f, v, "required", "iterationFormat", np.string_)
398398

399399
# optional but required for extensions
400-
result_array += test_attr(f, v, "optional", "openPMDextension", np.string_, "^[a-zA-Z0-9\-;]+$")
400+
result_array += test_attr(f, v, "optional", "openPMDextension", np.string_,
401+
# allowed are a-Z 0-9 - ; (but no spaces!)
402+
"^[a-zA-Z0-9\-;]+$")
401403
# optional but required for data
402404
result_array += test_attr(f, v, "optional", "meshesPath", np.string_)
403405
result_array += test_attr(f, v, "optional", "particlesPath", np.string_)
@@ -688,6 +690,7 @@ def check_meshes(f, iteration, v, extensionStates):
688690
# Check for the attributes of each record
689691
for field_name in list_meshes :
690692
field = f[full_meshes_path + field_name.encode('ascii')]
693+
# allowed are a-Z 0-9 - ; : (but no spaces!)
691694
result_array += test_attr(field, v, "optional",
692695
"speciesType", np.string_,
693696
"^[a-zA-Z0-9\-;:]+$")
@@ -841,6 +844,7 @@ def check_particles(f, iteration, v, extensionStates) :
841844

842845
# Check the attributes associated with the SpeciesType extension
843846
if extensionStates['SpeciesType'] :
847+
# allowed are a-Z 0-9 - ; : (but no spaces!)
844848
result_array += test_attr(species, v, "optional", "speciesType",
845849
np.string_, "^[a-zA-Z0-9\-;:]+$")
846850

0 commit comments

Comments
 (0)