Skip to content

Write scientific defaults upon close (Iteration::close or Series::close)#1834

Open
franzpoeschel wants to merge 70 commits intoopenPMD:devfrom
franzpoeschel:defaults-upon-close
Open

Write scientific defaults upon close (Iteration::close or Series::close)#1834
franzpoeschel wants to merge 70 commits intoopenPMD:devfrom
franzpoeschel:defaults-upon-close

Conversation

@franzpoeschel
Copy link
Copy Markdown
Contributor

@franzpoeschel franzpoeschel commented Jan 14, 2026

Close #1439
This PR focuses on Iteration-level attributes (including attributes included below Iteration level)
Needed for introducing a synchronous mode

TODO:

  • Write side changes
  • Read side changes: Move attribute initializations to new ScientificDefaults logic as well, be more lenient about missing attributes
  • Maybe expose the finalize() method publically, so users can request openPMD to set defaults now
  • Reduce use of templates, size of ScientificDefaults.o
  • Check places from where readDefaults is called
  • particlePatches being weird, check them
  • clean up declarations and definitions
  • Decide if defaults should be populated upon flush() (benefit: early readers get readable datasets) or upon close() (benefit: we do populate too eagerly, users might add defaults late)
  • Do sth about populateDefaultMetadata()

@franzpoeschel franzpoeschel added api: breaking breaking API changes internal labels Jan 14, 2026
Comment on lines +281 to +284
// for (size_t i = 0; i < udims.size(); ++i)
// {
// res[7 * i] = 1;
// }

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines +698 to +701
// TODO: unitSI
// REQUIRE(r["x"].numAttributes() == 0);
// REQUIRE(r["y"].numAttributes() == 0);
// REQUIRE(r["z"].numAttributes() == 0);

Check notice

Code scanning / CodeQL

Commented-out code Note test

This comment appears to contain commented-out code.
@franzpoeschel
Copy link
Copy Markdown
Contributor Author

TODO: Move this check into finalize, maybe only print a warning

            throw std::runtime_error(
                "A Record can not be written without any contained "
                "RecordComponents: " +
                name);

@ax3l
Copy link
Copy Markdown
Member

ax3l commented Jan 14, 2026

@franzpoeschel is this for 0.18.0? :)

@franzpoeschel
Copy link
Copy Markdown
Contributor Author

@franzpoeschel is this for 0.18.0? :)

Yup, this is still under development

@ax3l ax3l added this to the 0.18.0 milestone Jan 14, 2026
@ax3l
Copy link
Copy Markdown
Member

ax3l commented Feb 17, 2026

@franzpoeschel sorry small conflict in CoreTest.cpp, will review the rest in the meantime :)

@ax3l ax3l self-assigned this Feb 17, 2026
@franzpoeschel franzpoeschel force-pushed the defaults-upon-close branch 2 times, most recently from 99f8758 to 7ef8956 Compare February 26, 2026 13:33
Comment on lines +128 to +131
// if (access::write(IOHandler()->m_frontendAccess))
// {
// populateDefaultMetadata();
// }

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

defaultAttribute(*this, "unitSI")
.template withSetter<RecordComponent>(1.0, &RecordComponent::setUnitSI)
.withReader(float_types, require_type<double>())(wor);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: verify that this properly implements the previous logic for require_unit_SI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: breaking breaking API changes internal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scientific default values

3 participants