Skip to content

Conversation

@Felice27
Copy link

@Felice27 Felice27 commented Nov 14, 2025

The documentation and code comments list ParticleHistogram2D's value_function as an optional flag, but when omitted, the code still calls the parser and accumulates 0 in every bin, yielding a histogram of all 0's without any warning or error message. This is inconsistent with the 1D histogram, which defaults to summing over particle weight w.

Changes implemented:

  • m_do_parser_value is assigned to `false' in the header if not declared
  • In the constructor, value_function defaults to "w" when not provided and always builds a parser from the resolved string
  • value_function is written to the OpenPMD file metadata
  • Docs: clarify that the 2D parsers receive 8 arguments (t, x, y, z, ux, uy, uz, w) instead of 7; update wording so that "value" and "filter" definitions aren't conflated.

This should patch an issue I was encountering where 2D Particle Histogram writing produced all-0 arrays if value function was not manually set to w.

Edited: found an old issue of a user encountering an issue with the default implementation. Fixes #4540

…n omitted; init flag; record value_function in metadata

Signed-off-by: Jack Felice <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cryptic error message when value_function parameter in Histogram2D not set

1 participant