Skip to content

Mesh series indexing

Florian Zill requested to merge FZill/ogstools:MeshSeries_Indexing into main

This MR enables a consistent and stackable way to index / slice / subselect a part of a MeshSeries in the time or space dimension:

  • time: indexing with __get_item__ with slices or arrays
  • space: using the transform() or extract() method

Code changes:

  • removed data (efficient data reading is now done with values(), so no need for two functions doing the same. If one really wants to use some string indexing on the xdmf dataitems this is still accessable via ms._xdmf_reader.dataitems[...], but the string indexing in particular was not testing or working before anyway.
  • removed dataitems from MeshSeries (it was only there to allow for the same API for data with pvd as with xdmf)
  • removed aggregate as it condensed down to a one-liner
  • values() doesn't have the selection argument anymore as it is now unneeded
  • the mesh_cache now stores the indivudual Meshes instead of just the pyvista meshes (this fixed a bug which prevented us from writing data to the MeshSeries
  1. Feature description was added to the changelog
  2. Tests covering your feature were added?
  3. Any new feature or behaviour change was documented?
  4. API-breaking changes documented in docs/releases/ogstools-0.x.md
Edited by Tobias Meisel

Merge request reports

Loading