Skip to content

xdmf: read_grid_fragment and collection_names, the two XDMF reads a Proteus archive reader needs - #20

Merged
cekees merged 1 commit into
mainfrom
xdmf-fragment-readers
Oct 23, 2026
Merged

cekees merged 1 commit into
mainfrom
xdmf-fragment-readers

Conversation

@cekees

@cekees cekees commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Two small readers in ymf.xdmf, for Proteus's XDMF retirement (campaign C2):

  • read_grid_fragment(text) -> (grid, time): one serialized <Grid> element, as Proteus <= 1.9.x stored per rank and step inside its HDF5 files. The time is the fragment's own <Time> or None, which is how a reader tells the two write paths of that Proteus apart.
  • collection_names(path) -> [str]: the names of a .xmf's top-level grids, in file order. The order of the collections is the one thing that Proteus recorded nowhere else, and a hot start must reproduce it.

Proteus's archive reader used xml.etree for exactly these two things; with them here, Proteus imports no XML parser at all. Seven tests.

🤖 Generated with Claude Code

…roteus archive reader needs

Proteus <= 1.9.x stored one <Grid> fragment per rank and step inside its
HDF5 files and wrote the order of its collections only into the .xmf
beside them. A current Proteus reads both when it hot starts from or
converts such an archive. With these two functions it does so without
importing an XML parser itself: XDMF is this module's business.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant