Skip to content

Commit 386fd88

Browse files
committed
Example: SpeciesType
Add `speciesType` attributes to some records.
1 parent 40b5090 commit 386fd88

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openpmd_validator/createExamples_h5.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def setup_root_attr(f):
8888
The file in which to write the data
8989
"""
9090

91-
# extensions list: ED-PIC extension is used
92-
ext_list = ["ED-PIC"]
91+
# extensions list: ED-PIC and SpeciesType extensions are used
92+
ext_list = ["ED-PIC", "SpeciesType"]
9393

9494
# Required attributes
9595
f.attrs["openPMD"] = np.string_("2.0.0")
@@ -139,6 +139,7 @@ def write_rho_cylindrical(meshes, mode0, mode1):
139139
rho = meshes[full_rho_path]
140140
rho.attrs["comment"] = np.string_(
141141
"Density of electrons in azimuthal decomposition")
142+
rho.attrs["speciesType"] = np.string_("electron")
142143

143144
# Create the dataset (cylindrical with azimuthal modes up to m=1)
144145
# The first axis has size 2m+1
@@ -323,6 +324,7 @@ def add_EDPIC_attr_particles(particle):
323324
The group of the particle that gets additional attributes.
324325
325326
"""
327+
particle.attrs["speciesType"] = np.string_("electron")
326328
particle.attrs["particleShape"] = 3.0
327329
particle.attrs["currentDeposition"] = np.string_("Esirkepov")
328330
# particle.attrs["currentDepositionParameters"] = np.string_("")

0 commit comments

Comments
 (0)