File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed
Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 22
33std::string backendEnding ()
44{
5+ return " json" ;
56 auto extensions = openPMD::getFileExtensions ();
67 if (auto it = std::find (extensions.begin (), extensions.end (), " toml" );
78 it != extensions.end ())
@@ -50,7 +51,7 @@ void write()
5051 * Don't specify datatype and extent for this one to indicate that this
5152 * information is not yet known.
5253 */
53- E[" z" ].resetDataset ({openPMD::Datatype::UNDEFINED });
54+ E[" z" ].resetDataset ({});
5455
5556 ds.extent = {10 };
5657
@@ -100,7 +101,7 @@ void read()
100101 openPMD::Series read (
101102 " ../samples/tomlTemplate." + backendEnding (),
102103 openPMD::Access::READ_LINEAR);
103- read.readIterations (); // @todo change to read. parseBase()
104+ read.parseBase ();
104105 openPMD::helper::listSeries (read);
105106}
106107
Original file line number Diff line number Diff line change @@ -41,18 +41,24 @@ class Dataset
4141public:
4242 enum : std::uint64_t
4343 {
44- JOINED_DIMENSION = std::numeric_limits<std::uint64_t >::max ()
44+ JOINED_DIMENSION = std::numeric_limits<std::uint64_t >::max (),
45+ UNDEFINED_EXTENT = std::numeric_limits<std::uint64_t >::max () - 1
4546 };
4647
47- Dataset (Datatype, Extent = { 1 } , std::string options = " {}" );
48+ Dataset (Datatype, Extent, std::string options = " {}" );
4849
4950 /* *
5051 * @brief Constructor that sets the datatype to undefined.
5152 *
52- * Helpful for resizing datasets, since datatypes need not be given twice.
53+ * Helpful for:
54+ *
55+ * 1. Resizing datasets, since datatypes need not be given twice.
56+ * 2. Initializing datasets as undefined, as used by template mode in the
57+ * JSON/TOML backend. In this case, the default (undefined) specification
58+ * for the Extent may be used.
5359 *
5460 */
55- Dataset (Extent);
61+ Dataset (Extent = {UNDEFINED_EXTENT} );
5662
5763 Dataset &extend (Extent newExtent);
5864
Original file line number Diff line number Diff line change @@ -644,7 +644,7 @@ void JSONIOHandlerImpl::createDataset(
644644 }
645645 case IOMode::Template:
646646 if (parameter.extent != Extent{0 } &&
647- parameter.dtype != Datatype::UNDEFINED )
647+ parameter.extent [ 0 ] != Dataset::UNDEFINED_EXTENT )
648648 {
649649 dset[" extent" ] = parameter.extent ;
650650 }
@@ -1998,7 +1998,7 @@ JSONIOHandlerImpl::obtainJsonContents(File const &file)
19981998 }
19991999 }
20002000
2001- if (m_IOModeSpecificationVia == SpecificationVia::DefaultValue &&
2001+ if (m_attributeModeSpecificationVia == SpecificationVia::DefaultValue &&
20022002 openpmd_internal.contains (JSONDefaults::AttributeMode))
20032003 {
20042004 auto modeOption = openPMD::json::asLowerCaseStringDynamic (
You can’t perform that action at this time.
0 commit comments