Skip to content

[EPIC] TTE code sharing and new python packages organization proposal #54

Open
4 of 4 issues completed
Open

Description

@margauxraguenel

What is the requested feature?

Various Python tools were developed by TotalEnergies to visualize and process GEOS inputs/outputs. These codes may however benefit to the whole GEOS community (e.g., #50) and can be shared. Some common needs (e.g., #16) may also be addressed once instead of multiple times. To this end, this epic aims to share in the GEOS repository TotalEnergies Python tools and reorganize/refactor python projects to merge duplicated codes.


Is your request related to a specific problem?

  • Need to share TotalEnergies Python tools that will benefit to the whole GEOS community,
  • Reorganized and refactor python projects, to avoid duplicated codes and improve dependency management (cf. proposed organisation)

Describe the solution you'd like

We propose first to integrate TotalEnergies code to geosPythonPackages as they currently are, then a refactoring of the whole project to merge duplicated codes and update package dependencies.

The proposed organisation is the following, as described in the attached document:

  • Data structures and processing packages:
    • geos-ats:
    • hdf5-wrapper:
    • geos-xml-tools: reader, writer, split or merge tools, check tools for geos-xml file.
    • geos-mesh: IO, statistics, procesing tools of meshes based on vtk data structure.
    • geomechanics: Data structures and geomechanical properties calculation functions
  • API packages:
    • xml-vtk: Convert geos-xml to vtk objects and conversely.
    • geos-prop: Pre-procssing tools as vtk filters including mesh-doctor features
    • geos-posp: Post-processing tools as vtk filters including geos output mesh cleaning and new properties calculation filters
  • Script packages:
    • geos-timehistory: plot time serie curves from geos hdf5 (and csv) files
    • geos-xml-viewer: Input object visualization tool from geos-xml based on pyvista
    • mesh-doctor: pre-processing scripts
    • geos-trame: xml interactive viewer and editor
  • Paraview (PV) plugins:
    • geos-pv: paraview plugins to wrap API packages

The proposed new organisation aims at splitting processing packages from user-interface packages (i.e., script or IHM-based packages). This organisation was initially proposed by @untereiner who applied it to packages hdf5-wrapper (processing) and geos-timehistory (script).

Advantages are:

  • to use same processing modules in multiple user-interface packages
  • avoiding duplicated codes and easing code maintenance
  • better management of package dependencies

For instance, PR #16 deals with the need to use mesh-doctor tools through Paraview in addition of current scripts. This need requires to either duplicate code or introduce a dependency of Paraview to the whole geos-mesh package, resulting in introducing a dependency of Paraview plugins to pyvista. It is not recommended since Paraview and pyvista are both user-interface modules (the former through an IHM, the latter through APIs) with similar functionalities. The integration of TotalEnergies code into geosPythonPackages will raise similar issues.


Proposed roadmap

  1. TotalEnergies code sharing:
  1. Create vtk filters for mesh-doctor features #80 :
  • Create vtk filter for mesh-doctor generate_global_ids in geos-mesh
  • Create vtk filter for mesh-doctor collocated_nodes in geos-mesh
  • Create vtk filter for mesh-doctor element_volumes in geos-mesh
  • Create vtk filter for mesh-doctor fix_elements_orderings in geos-mesh
  • Create vtk filter for mesh-doctor generate_fractures in geos-mesh
  • Create vtk filter for mesh-doctor non_conformal in geos-mesh
  • Create vtk filter for mesh-doctor self_intersecting_elements in geos-mesh
  • Create vtk filter for mesh-doctor supported_elements in geos-mesh
  • Create mesh-doctor package and update with vtk filters
  • Create Paraview plugins for mesh-doctor vtk filters (PoC / Paraview integration for mesh_doctor  #16)
  • Add mesh_stats checks and field_operations features #51 and merge with TotalEnergies codes
  1. geos-xml-tools refactoring
  • Gather python codes that process GEOS xml files from geos-xml-tools, geos-xml-viewer, geos-trame (Unify the XML parsing of GEOS files #76)
  • Create xml-vtk package with xml-vtk conversion vtk filters
  • Refactor geos-xml-viewer to update with xml-vtk package
  • Refactor geos-trame to update with xml-vtk package
  • (Optional) Create Paraview plugins for xml-vtk filters
  • File classification  #25

PythonPackagesProposal.pdf
updatePythonPackagesProposal_09042025.pdf

Activity

  1. untereiner commented on Feb 3, 2025

    @untereiner

    Don't hesitate if you need some help !

  2. paloma-martinez commented on Sep 30, 2025

    @paloma-martinez
    Contributor

    As discussed, this is the dependency diagram that would represent the repository after this refactor.

    Image
    • All tools packages will contain only data model and processing functions.
    • mesh-doctor will be extracted from geos-mesh to constitute a package on its own. If some processing functions are very generic, they should stay in geos-mesh and only be called from there. The corresponding mesh-doctor plugins will be added to geos-pv.
    • geos-processing will contain all pre- and post-processing VTK filters, including mesh-doctor filters. With that in mind, a dedicated PR should be done to move the filters that are currently in geos-mesh to geos-processing.
    • A mesh-converter package could also be extracted from geos-mesh, as it is an application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions