Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f377617
Move geos-xml-viewer to geos-xml-tools
alexbenedicto Jul 3, 2025
3214856
Update geos-xml-tools based scripts + test them
alexbenedicto Jul 10, 2025
c9b94a7
Move testCellLocator to geos-mesh as test_cell_locator
alexbenedicto Jul 11, 2025
8ab37b9
Move write_wells to geos-xml-tools base functionalities
alexbenedicto Jul 11, 2025
fad6ed8
Remove non XML related scripts
alexbenedicto Jul 11, 2025
48eb6df
Remove geosDeckReader vtk algorithm to be replaced by functionalities…
alexbenedicto Jul 11, 2025
97f2c98
Remove unused code
alexbenedicto Jul 11, 2025
29a42bf
Remove xsdata dependency
alexbenedicto Jul 11, 2025
09c2381
yapf formatting
alexbenedicto Jul 11, 2025
3e3d655
Test vtk_builder
alexbenedicto Jul 11, 2025
da76610
Update main.py to have access to new functionalities
alexbenedicto Jul 12, 2025
37d039a
Change GEOSX to GEOS
alexbenedicto Jul 12, 2025
31cf392
Better handling functions
alexbenedicto Jul 14, 2025
2007fd2
Add copyrights
alexbenedicto Jul 14, 2025
298d8f3
Remove write_wells because hardcoded and not used
alexbenedicto Jul 14, 2025
bfd01b9
Fix for mypy
alexbenedicto Jul 14, 2025
ec72d93
Ruff checking + yapf formatting
alexbenedicto Jul 14, 2025
8a44c4c
Improve __doc__ for each file
alexbenedicto Jul 15, 2025
5beb9a4
Update sphinx documentation
alexbenedicto Jul 18, 2025
e09e536
Avoid setting an invalid wd if an error happens in process
alexbenedicto Jul 18, 2025
27f093d
Remove test_deckSource.py because is a duplicate of test_vtk_builder.py
alexbenedicto Jul 18, 2025
b45e0d3
Fix test isolation that would make other tests fail in the repo
alexbenedicto Jul 18, 2025
f6c4367
Remove duplication and fix format in test_xml_processor
alexbenedicto Jul 18, 2025
e941b39
Better handling of file generation anc deletion when running test_vtk…
alexbenedicto Jul 18, 2025
19e6b30
Allow default region creation for VTKMesh
alexbenedicto Jul 23, 2025
e4ba82a
Update conf.py
alexbenedicto Jul 23, 2025
a2c8ea4
Add command line documentation
alexbenedicto Jul 23, 2025
0f61ba5
Remove pyvista_viewer that is redundant with geos-trame
alexbenedicto Jul 23, 2025
dc668d1
Better naming in docs
alexbenedicto Jul 23, 2025
dd0db36
Remove pyvista_viewer test
alexbenedicto Jul 23, 2025
20834d7
Move deckReader to geos-pv as PVGeosDeckReader
alexbenedicto Jul 23, 2025
ead7e5e
Remove pyvista_viewer command lines
alexbenedicto Jul 23, 2025
6ef2dc2
Move doc of PVGeosDeckReader to geos-pv-docs
alexbenedicto Jul 23, 2025
505e2e6
Improve geos_xml_tools_docs
alexbenedicto Jul 23, 2025
653d230
yapf
alexbenedicto Jul 30, 2025
b6f9c48
Merge remote-tracking branch 'origin/main' into benedicto/cleanup/har…
alexbenedicto Jul 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
- geos-trame
- geos-utils
- geos-xml-tools
- geos-xml-viewer
- hdf5-wrapper
- pygeos-tools
include:
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ The following packages define hands-on executables that can be used through the

* `mesh-doctor`: GEOS pre-processing application
* `time-history`: load and plot hdf5 files
* `geos-xml-viewer`: load GEOS xml file and display geometrical objects (mesh, boxes, wells)
* `geos-trame`: web interface to check, display objects, and edit GEOS xml file (see [Trame documentation](https://kitware.github.io/trame/guide/tutorial/))


Expand All @@ -60,6 +59,7 @@ GEOS Python packages dependency tree (inter-dependency and main external depende
├── geos-xml-tools
│ ├── lxml
│ ├── pyvista
├── geos-mesh
│ ├── geos-utils
Expand All @@ -86,11 +86,6 @@ GEOS Python packages dependency tree (inter-dependency and main external depende
│ ├── pyvista
│ ├── trame
├── geos-xml-viewer
│ ├── geos-xml-tools
│ ├── geos-mesh
│ ├── pyvista
├── geos-pv
├── geos-prep
├── geos-posp
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Add python modules to be documented
python_root = '..'
python_modules = ( 'geos-ats', 'geos-geomechanics', 'geos-mesh', 'geos-posp', 'geos-pv', 'geos-timehistory',
'geos-utils', 'geos-xml-tools', 'geos-xml-viewer', 'hdf5-wrapper', 'pygeos-tools' )
'geos-utils', 'geos-xml-tools', 'hdf5-wrapper', 'pygeos-tools' )


for m in python_modules:
Expand All @@ -45,7 +45,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.napoleon', 'sphinx_design', 'sphinx_rtd_theme', 'sphinxarg.ext', 'sphinxcontrib.programoutput',
'sphinx.ext.napoleon', 'sphinx_design', 'sphinx_rtd_theme', 'sphinxarg.ext', 'sphinxcontrib.programoutput',
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.mathjax', 'sphinx.ext.todo', 'sphinx.ext.viewcode'
]

Expand Down
84 changes: 13 additions & 71 deletions docs/geos-xml-tools.rst
Original file line number Diff line number Diff line change
@@ -1,82 +1,24 @@

.. _XMLToolsPackage:

GEOS XML Tools
--------------------------

The `geos-xml-tools` python package adds a set of advanced features to the GEOS xml format: units, parameters, and symbolic expressions.
See :ref:`PythonToolsSetup` for details on setup instructions, and `Advanced XML Features <https://geosx-geosx.readthedocs-hosted.com/en/latest/coreComponents/fileIO/doc/InputXMLFiles.html#advanced-xml-features>`_ for a detailed description of the input format.
The available console scripts for this package and its API are described below.


convert_abaqus
^^^^^^^^^^^^^^

Convert an abaqus format mesh file to gmsh or vtk format.

.. argparse::
:module: geos.xml_tools.command_line_parsers
:func: build_preprocessor_input_parser
:prog: preprocess_xml


format_xml
^^^^^^^^^^^^^^

Formats an xml file.

.. argparse::
:module: geos.xml_tools.command_line_parsers
:func: build_xml_formatter_input_parser
:prog: format_xml


check_xml_attribute_coverage
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Checks xml attribute coverage for files in the GEOS repository.

.. argparse::
:module: geos.xml_tools.command_line_parsers
:func: build_attribute_coverage_input_parser
:prog: check_xml_attribute_coverage


check_xml_redundancy
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Checks for redundant attribute definitions in an xml file, such as those that duplicate the default value.

.. argparse::
:module: geos.xml_tools.command_line_parsers
:func: build_xml_redundancy_input_parser
:prog: check_xml_redundancy

====================

API
^^^
**geos-xml-tools** is a Python package that adds advanced features to the GEOS XML format, including units, parameters, and symbolic expressions.

.. automodule:: geos.xml_tools.main
:members:
See :ref:`PythonToolsSetup` for setup instructions, and `Advanced XML Features <https://geosx-geosx.readthedocs-hosted.com/en/latest/coreComponents/fileIO/doc/InputXMLFiles.html#advanced-xml-features>`_ for a detailed description of the input format.

.. automodule:: geos.xml_tools.xml_processor
:members:
.. toctree::
:maxdepth: 1
:caption: Contents:

.. automodule:: geos.xml_tools.xml_formatter
:members:
./geos_xml_tools_docs/command_line_interface

.. automodule:: geos.xml_tools.unit_manager
:members:
./geos_xml_tools_docs/preprocess

.. automodule:: geos.xml_tools.regex_tools
:members:
./geos_xml_tools_docs/format_xml

.. automodule:: geos.xml_tools.xml_redundancy_check
:members:
./geos_xml_tools_docs/check_xml_attribute_coverage

.. automodule:: geos.xml_tools.attribute_coverage
:members:
./geos_xml_tools_docs/check_xml_redundancy

.. automodule:: geos.xml_tools.table_generator
:members:
./geos_xml_tools_docs/vtk_builder

./geos_xml_tools_docs/api
107 changes: 0 additions & 107 deletions docs/geos-xml-viewer.rst

This file was deleted.

39 changes: 39 additions & 0 deletions docs/geos_pv_docs/PVGeosDeckReader.rst
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not write the doc in the PVGeosDeckReader.py as for the other plugins ?

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
PVGeosDeckReader
================

Overview
--------
- `PVGeosDeckReader` is a Python-based Paraview reader that allows users to open GEOS XML files and create mesh objects for visualization and analysis.
- The plugin is implemented in `PVGeosDeckReader.py` and registered as `PythonGeosDeckReader` in Paraview.
- It outputs a `vtkPartitionedDataSetCollection` representing the mesh and associated regions as defined in the XML file.

Key Features
------------
- **Direct XML loading**: Open GEOS XML input files (`.xml`) in Paraview as native datasets.
- **Region support**: The reader uses the `Region` attribute (or a user-specified attribute) to organize mesh data.
- **Integration with GEOS workflows**: Enables direct inspection and analysis of simulation input decks without conversion steps.

How to Use
----------
1. Install the geos-pv package and ensure Paraview is set up to use Python plugins.
2. In Paraview, load the plugin (typically via the Python Plugin Manager or by specifying the path to `PVGeosDeckReader.py`).
3. Use the "Open" dialog in Paraview to select a GEOS XML file. Choose the `PythonGeosDeckReader` when prompted.
4. The mesh and regions defined in the XML will be loaded as a multi-block dataset for visualization and further processing.

Technical Details
-----------------
- The plugin is implemented as a subclass of `VTKPythonAlgorithmBase` and uses the `create_vtk_deck` function from geos-xml-tools to build the VTK data structure.
- The plugin exposes a `FileName` property for selecting the XML file and can be extended to support additional attributes or options.

Example
-------
.. code-block:: console

paraview --python-script=path/to/PVGeosDeckReader.py
# Or load via the Paraview GUI

# In Paraview:
# File > Open > select input.xml > choose PythonGeosDeckReader

.. note::
This plugin is intended for users who want to inspect or debug GEOS input decks visually, or to prepare data for further Paraview-based workflows.
7 changes: 7 additions & 0 deletions docs/geos_pv_docs/readers.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Paraview readers
================

.. toctree::
:maxdepth: 1
:caption: Contents:

./PVGeosDeckReader.rst


readers.PVGeosLogReader module
----------------------------------

Expand Down
26 changes: 26 additions & 0 deletions docs/geos_xml_tools_docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
API
===

.. automodule:: geos.xml_tools.main
:members:

.. automodule:: geos.xml_tools.xml_processor
:members:

.. automodule:: geos.xml_tools.xml_formatter
:members:

.. automodule:: geos.xml_tools.unit_manager
:members:

.. automodule:: geos.xml_tools.regex_tools
:members:

.. automodule:: geos.xml_tools.xml_redundancy_check
:members:

.. automodule:: geos.xml_tools.attribute_coverage
:members:

.. automodule:: geos.xml_tools.table_generator
:members:
19 changes: 19 additions & 0 deletions docs/geos_xml_tools_docs/check_xml_attribute_coverage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Check for attribute coverage
============================

Analyzes how well a project's XML files cover the possibilities defined in an XML Schema Definition (.xsd) file.

This tool parses the schema, scans XML files in the specified directory, and generates a report showing which attributes are used, their values, and their default values from the schema.
Useful for identifying missing or underused attributes in a codebase.

Example
-------
.. code-block:: console

geos-xml-tools coverage -r /path/to/geos/root -o coverage_report.xml


.. argparse::
:module: geos.xml_tools.command_line_parsers
:func: build_attribute_coverage_input_parser
:prog: check_xml_attribute_coverage
18 changes: 18 additions & 0 deletions docs/geos_xml_tools_docs/check_xml_redundancy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Check redundancy
================

Checks for redundant attribute definitions in XML files, such as those that duplicate default values or are otherwise unnecessary.

This tool scans XML files in the specified directory and reports attributes that are defined but do not differ from their defaults, helping to clean up and simplify XML configurations.

Example
-------
.. code-block:: console

geos-xml-tools redundancy -r /path/to/geos/root


.. argparse::
:module: geos.xml_tools.command_line_parsers
:func: build_xml_redundancy_input_parser
:prog: check_xml_redundancy
Loading
Loading