diff --git a/.github/workflows/README.md b/.github/workflows/README.md
index 1ac7d02a..3f823457 100644
--- a/.github/workflows/README.md
+++ b/.github/workflows/README.md
@@ -22,7 +22,7 @@ Tests each Python package independently to ensure:
- `geos-ats` - Automated Testing System for GEOS
- `geos-geomechanics` - Geomechanics analysis tools
- `geos-mesh` - Mesh conversion and validation tools
-- `geos-posp` - Post-processing utilities
+- `geos-processing` - Post-processing utilities
- `geos-timehistory` - Time history analysis
- `geos-trame` - Trame-based visualization
- `geos-utils` - Utility functions
@@ -62,7 +62,7 @@ build:
```yaml
check_integration_label:
- Checks for 'test-geos-integration' label
-
+
check_force_integration_label:
- Checks for 'force-geos-integration' label
```
@@ -141,7 +141,7 @@ Tests that geosPythonPackages integrates correctly with GEOS by:
- Patches script to search `/usr/local/bin/` for pip-installed tools
- Installs Python packages via the GEOS setup script
- Creates symlinks to tools in `bin_direct/`
-- **Validates**:
+- **Validates**:
- ✅ Python packages install correctly
- ✅ Scripts are findable and linkable
- ✅ All required tools are available
@@ -262,7 +262,7 @@ Tests are automatically skipped when changes only affect:
#### Non-Integrated Packages
- `geos-geomechanics/` - Standalone geomechanics tools
-- `geos-posp/` - Post-processing utilities
+- `geos-processing/` - Post-processing utilities
- `geos-pv/` - ParaView utilities
- `geos-timehistory/` - Time history analysis
- `geos-trame/` - Trame visualization
diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
index 10d5e513..9c668d1b 100644
--- a/.github/workflows/python-package.yml
+++ b/.github/workflows/python-package.yml
@@ -58,12 +58,11 @@ jobs:
max-parallel: 3
matrix:
python-version: ["3.10","3.11","3.12"]
- package-name:
+ package-name:
- geos-ats
- geos-utils
- geos-geomechanics
- geos-mesh
- - geos-posp
- geos-processing
- geos-timehistory
- geos-trame
@@ -78,8 +77,6 @@ jobs:
dependencies: "geos-utils geos-geomechanics"
- package-name: geos-processing
dependencies: "geos-utils geos-mesh geos-geomechanics"
- - package-name: geos-posp
- dependencies: "geos-utils geos-mesh geos-geomechanics geos-processing"
- package-name: pygeos-tools
dependencies: "geos-utils geos-mesh"
- package-name: geos-timehistory
@@ -92,11 +89,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
-
+
- name: Install OSMesa and GL
run: |
sudo apt-get update
- sudo apt-get install -y libosmesa6
+ sudo apt-get install -y libosmesa6
sudo apt-get install -y \
libegl1-mesa-dev \
libgles2-mesa-dev \
@@ -151,7 +148,7 @@ jobs:
echo "Label '${{ env.LABEL_TEST_GEOS_INTEGRATION }}' found"
fi
echo "has_label=$LABEL_FOUND" >> $GITHUB_OUTPUT
-
+
check_force_integration_label:
runs-on: ubuntu-latest
needs: [build]
@@ -281,11 +278,11 @@ jobs:
echo "required=false" >> "$GITHUB_OUTPUT"
echo "skip_reason=no-geos-integrated-changes" >> "$GITHUB_OUTPUT"
fi
-
+
geos_ci_dispatch:
name: Dispatch cases of GEOS CI
runs-on: ubuntu-latest
- outputs:
+ outputs:
is_GEOS_CI_skipped: ${{ steps.dispatch.outputs.skipped }}
fwd_geos_integration_required: ${{ steps.dispatch.outputs.fwd_geos_integration_required }}
fwd_skip_reason: ${{ steps.dispatch.outputs.skip_reason }}
@@ -298,23 +295,23 @@ jobs:
HAS_TEST_LABEL="${{ needs.check_integration_label.outputs.has_geos_integration_label }}"
HAS_FORCE_LABEL="${{ needs.check_force_integration_label.outputs.has_geos_integration_force_label }}"
SKIP_REASON="${{ needs.check_geos_integration_required.outputs.skip_reason }}"
-
+
echo "fwd_geos_integration_required=${GEOS_REQUIRED}" >> "$GITHUB_OUTPUT"
echo "fwd_skip_reason=${SKIP_REASON}" >> "$GITHUB_OUTPUT"
-
+
echo "=== GEOS Integration Dispatch ==="
echo "GEOS Required (by file changes): ${GEOS_REQUIRED}"
echo "Has '${{ env.LABEL_TEST_GEOS_INTEGRATION }}' label: ${HAS_TEST_LABEL}"
echo "Has '${{ env.LABEL_FORCE_GEOS_INTEGRATION }}' label: ${HAS_FORCE_LABEL}"
echo ""
-
+
# Case 1: Force label - always run tests
if [[ "$HAS_FORCE_LABEL" == "true" ]]; then
echo "✓ '${{ env.LABEL_FORCE_GEOS_INTEGRATION }}' label present - forcing GEOS integration tests"
echo "skipped=false" >> "$GITHUB_OUTPUT"
exit 0
fi
-
+
# Case 2: GEOS required AND test label present - run tests
if [[ "$GEOS_REQUIRED" == "true" && "$HAS_TEST_LABEL" == "true" ]]; then
echo "✓ GEOS integration required and '${{ env.LABEL_TEST_GEOS_INTEGRATION }}' label present"
@@ -322,7 +319,7 @@ jobs:
echo "skipped=false" >> "$GITHUB_OUTPUT"
exit 0
fi
-
+
# Case 3: GEOS required BUT test label missing - ERROR
if [[ "$GEOS_REQUIRED" == "true" && "$HAS_TEST_LABEL" == "false" ]]; then
echo "✗ ERROR: GEOS integration is required but '${{ env.LABEL_TEST_GEOS_INTEGRATION }}' label is missing"
@@ -334,7 +331,7 @@ jobs:
echo "Action required: Add the '${{ env.LABEL_TEST_GEOS_INTEGRATION }}' label to this PR"
exit 1
fi
-
+
# Case 4: GEOS NOT required BUT test label present - SKIP TESTS
if [[ "$GEOS_REQUIRED" == "false" && "$HAS_TEST_LABEL" == "true" ]]; then
echo "⊘ SKIPPED: '${{ env.LABEL_TEST_GEOS_INTEGRATION }}' label present but GEOS integration is not required"
@@ -348,7 +345,7 @@ jobs:
echo "skipped=true" >> "$GITHUB_OUTPUT"
exit 0
fi
-
+
# Case 5: GEOS NOT required AND no labels - SKIP TESTS
if [[ "$GEOS_REQUIRED" == "false" && "$HAS_TEST_LABEL" == "false" ]]; then
echo "⊘ GEOS integration not required and no labels present"
@@ -357,7 +354,7 @@ jobs:
echo "skipped=true" >> "$GITHUB_OUTPUT"
exit 0
fi
-
+
# Should never reach here
echo "✗ ERROR: Unexpected state in dispatch logic"
exit 1
@@ -383,7 +380,7 @@ jobs:
GEOS_REQUIRED="${{ needs.geos_ci_dispatch.outputs.fwd_geos_integration_required }}"
SKIP_REASON="${{ needs.geos_ci_dispatch.outputs.fwd_skip_reason }}"
-
+
GEOS_RESULT="${{ needs.geos_integration_test.result }}"
if [[ "$GEOS_REQUIRED" == "true" ]]; then
diff --git a/.github/workflows/typing-check.yml b/.github/workflows/typing-check.yml
index 0a00276d..2cd6a7c9 100644
--- a/.github/workflows/typing-check.yml
+++ b/.github/workflows/typing-check.yml
@@ -16,7 +16,7 @@ jobs:
max-parallel: 3
matrix:
# add packages to check typing
- package-name: ["geos-geomechanics", "geos-posp", "geos-processing", "geos-timehistory", "geos-utils", "geos-trame", "geos-xml-tools", "hdf5-wrapper"]
+ package-name: ["geos-geomechanics", "geos-processing", "geos-timehistory", "geos-utils", "geos-trame", "geos-xml-tools", "hdf5-wrapper"]
steps:
- uses: actions/checkout@v4
diff --git a/docs/conf.py b/docs/conf.py
index 7f9197b0..79fc5152 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -17,7 +17,7 @@
# Add python modules to be documented
python_root = '..'
-python_modules = ( 'geos-ats', 'geos-geomechanics', 'geos-mesh', 'geos-posp', 'geos-processing', 'geos-pv', 'geos-timehistory',
+python_modules = ( 'geos-ats', 'geos-geomechanics', 'geos-mesh', 'geos-processing', 'geos-pv', 'geos-timehistory',
'geos-utils', 'geos-xml-tools', 'geos-xml-viewer', 'hdf5-wrapper', 'pygeos-tools' )
diff --git a/docs/geos-posp.rst b/docs/geos-posp.rst
deleted file mode 100644
index efa3c25e..00000000
--- a/docs/geos-posp.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-GEOS Post-Processing tools
-=============================
-
-.. toctree::
- :maxdepth: 5
- :caption: Contents:
-
- ./geos_posp_docs/home.rst
-
- ./geos_posp_docs/modules.rst
\ No newline at end of file
diff --git a/docs/geos_mesh_docs/utils.rst b/docs/geos_mesh_docs/utils.rst
index 31f83c3f..7c15213c 100644
--- a/docs/geos_mesh_docs/utils.rst
+++ b/docs/geos_mesh_docs/utils.rst
@@ -46,4 +46,14 @@ geos.mesh.utils.multiblockModifiers module
.. automodule:: geos.mesh.utils.multiblockModifiers
:members:
:undoc-members:
- :show-inheritance:
\ No newline at end of file
+ :show-inheritance:
+
+
+
+geos.mesh.utils.pyvistaTools module
+-----------------------------------------------
+
+.. automodule:: geos.mesh.utils.pyvistaTools
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/geos_posp_docs/home.rst b/docs/geos_posp_docs/home.rst
deleted file mode 100644
index 9f109466..00000000
--- a/docs/geos_posp_docs/home.rst
+++ /dev/null
@@ -1,44 +0,0 @@
-Home
------
-
-**Geos-posp** is a Python library to read, process and visualize GEOS simulation software outputs.
-
-**GEOS** is an open-source THM (Thermo-Hydro-Mechanical) simulation framework designed for modeling coupled flow, transport,
-and geomechanics in the subsurface on high performance computing platforms. It provides advanced solvers for various applications,
-including carbon sequestration and geothermal energy systems.
-
-Developed as part of the FC-MAELSTROM research project by Lawrence Livermore National Laboratory (LLNL), Stanford University, TotalEnergies, and Chevron,
-GEOS draws on their expertise in simulation and high-performance computing research. If you are interested,
-you can explore more about GEOS in the `official documentation `_.
-
-GEOS outputs include:
-
-* a log file where many simulation statistics are dump into;
-* csv and hdf5 files containing simulation properties through time
-* a 3D mesh with properties that evolve through time.
-
-This library is based on `vtk `_ framework and `Paraview `_ visualization software.
-It includes:
-
-* a reader able to parse the GEOS output log to collect data and display them as tables;
-* tools to clean imported 3D mesh;
-* tools to compute additional geomechanical properties;
-* tools to display Mohr's circles at a given time step and the evolution through time.
-
-The tools included in this library can be used either through:
-
-* Python scripts that call vtk readers and filters.
-* Paraview software by loading plugins located in the PVplugins folder.
-
-
-The current code has been developed on Python 3.9.13 (i.e., Python version used by Paraview 5.12.0) using the following libraries:
-
-* matplotlib 3.2.1
-* pandas 2.0.1
-* numpy 1.24.3
-* vtk 9.3.2
-* typing_extensions 4.12
-
-Additional dependencies:
-
-* paraview - if plugins are used through Paraview
diff --git a/docs/geos_posp_docs/modules.rst b/docs/geos_posp_docs/modules.rst
deleted file mode 100644
index a87e24eb..00000000
--- a/docs/geos_posp_docs/modules.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-Processing
-==========
-
-.. toctree::
- :maxdepth: 5
-
- pyvistaTools
diff --git a/docs/geos_posp_docs/pyvistaTools.rst b/docs/geos_posp_docs/pyvistaTools.rst
deleted file mode 100644
index d9a4a40f..00000000
--- a/docs/geos_posp_docs/pyvistaTools.rst
+++ /dev/null
@@ -1,13 +0,0 @@
-pyvistaTools
-============
-
-This packages defines utilities using pyvista.
-
-
-geos_posp.pyvistaTools.pyvistaUtils module
------------------------------------------------
-
-.. automodule:: geos_posp.pyvistaTools.pyvistaUtils
- :members:
- :undoc-members:
- :show-inheritance:
\ No newline at end of file
diff --git a/docs/index.rst b/docs/index.rst
index b7175f8d..3f7b66d5 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -86,8 +86,6 @@ Packages
geos-mesh
- geos-posp
-
geos-processing
geos-pv
diff --git a/geos-posp/src/geos_posp/pyvistaTools/pyvistaUtils.py b/geos-mesh/src/geos/mesh/utils/pyvistaTools.py
similarity index 73%
rename from geos-posp/src/geos_posp/pyvistaTools/pyvistaUtils.py
rename to geos-mesh/src/geos/mesh/utils/pyvistaTools.py
index 7c17e3ef..79e636f3 100644
--- a/geos-posp/src/geos_posp/pyvistaTools/pyvistaUtils.py
+++ b/geos-mesh/src/geos/mesh/utils/pyvistaTools.py
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright 2023-2024 TotalEnergies.
# SPDX-FileContributor: Martin Lemay
-from typing import Optional, Union, cast
+from typing import Optional, Union
import numpy as np
import numpy.typing as npt
@@ -16,9 +16,8 @@
from geos.mesh.utils.arrayHelpers import ( getAttributeValuesAsDF, computeCellCenterCoordinates )
from geos.mesh.utils.arrayModifiers import transferPointDataToCellData
-__doc__ = r"""
+__doc__ = """
This module contains utilities to process meshes using pyvista.
-
"""
@@ -31,14 +30,14 @@ def loadDataSet(
"""Load the data using pyvista and extract properties from horizontal slice.
Args:
- reader (pv.PVDReader): pyvista pvd reader
- timeStepIndexes (list[int]): list of time step indexes to load.
- elevation (float): elevation (m) of horizontal slice
- properties (tuple[str]): list of properties to extract
+ reader (pv.PVDReader): Pyvista pvd reader.
+ timeStepIndexes (list[int]): List of time step indexes to load.
+ elevation (float): Elevation (m) of horizontal slice.
+ properties (tuple[str]): List of properties to extract.
Returns:
- tuple[dict[str, pd.DataFrame], npt.NDArray[np.float64]]: tuple containing
- a dictionnary with times as keys and dataframe with properties as
+ tuple[dict[str, pd.DataFrame], npt.NDArray[np.float64]]: Tuple containing
+ a dictionary with times as keys and dataframe with properties as
values, and an array with cell center coordinates of the slice.
"""
@@ -46,7 +45,8 @@ def loadDataSet(
surface: vtkPolyData
timeValues: list[ float ] = reader.time_values
for index in timeStepIndexes:
- assert index < len( timeValues ), "Time step index is out of range."
+ if index >= len( timeValues ):
+ raise IndexError( "Time step index is out of range." )
time: float = timeValues[ index ]
reader.set_active_time_value( time )
@@ -54,23 +54,27 @@ def loadDataSet(
volMesh: Optional[ Union[ pv.MultiBlock, pv.UnstructuredGrid ] ] = getBlockByName(
inputMesh, GeosDomainNameEnum.VOLUME_DOMAIN_NAME.value )
- assert volMesh is not None, "Volumic mesh was not found."
+ if not volMesh:
+ raise AttributeError( "Volumic mesh was not found." )
# Merge volume block
mergedMesh: pv.UnstructuredGrid = volMesh.combine(
merge_points=True ) if isinstance( volMesh, pv.MultiBlock ) else volMesh
- assert mergedMesh is not None, "Merged mesh is undefined."
+ if not mergedMesh:
+ raise ValueError( "Merged mesh is undefined." )
- # extract data
+ # Extract data
surface = extractSurfaceFromElevation( mergedMesh, elevation )
- # transfer point data to cell center
- surface = cast( vtkPolyData, transferPointDataToCellData( surface ) )
+ # Transfer point data to cell center
+ surface = vtkPolyData.SafeDownCast( transferPointDataToCellData( surface ) )
timeToPropertyMap[ str( time ) ] = getAttributeValuesAsDF( surface, properties )
- # get cell center coordinates
- assert surface is not None, "Surface are undefined."
+ # Get cell center coordinates
+ if not surface:
+ raise ValueError( "Surface are undefined." )
pointsCoords: vtkDataArray = computeCellCenterCoordinates( surface )
- assert pointsCoords is not None, "Cell center are undefined."
+ if not pointsCoords:
+ raise ValueError( "Cell center are undefined." )
pointsCoordsNp: npt.NDArray[ np.float64 ] = vnp.vtk_to_numpy( pointsCoords )
return ( timeToPropertyMap, pointsCoordsNp )
@@ -93,14 +97,14 @@ def getBlockByName( multiBlockMesh: Union[ pv.MultiBlock, pv.UnstructuredGrid ],
mesh: Optional[ Union[ pv.MultiBlock, pv.UnstructuredGrid ] ]
for i, mbMesh in enumerate( multiBlockMesh ):
- # if one of the block of multiBlockMesh is the volumic mesh,
+ # If one of the block of multiBlockMesh is the volumic mesh,
# then save the mesh and break
if multiBlockMesh.get_block_name( i ) == blockName:
mesh = mbMesh
break
- # else look at its internal mesh(es)
+ # Else look at its internal mesh(es)
mesh = getBlockByName( mbMesh, blockName )
- # if mesh is not None, it is the searched one
+ # If mesh is not None, it is the searched one
if mesh is not None:
break
return mesh
diff --git a/geos-posp/pyproject.toml b/geos-posp/pyproject.toml
deleted file mode 100644
index e1c05a89..00000000
--- a/geos-posp/pyproject.toml
+++ /dev/null
@@ -1,93 +0,0 @@
-[build-system]
-requires = ["setuptools>=61.2", "wheel >= 0.37.1"]
-build-backend = "setuptools.build_meta"
-
-[tool.setuptools]
-include-package-data = true
-
-[tool.setuptools.packages.find]
-where = ["src"]
-include = ["geos_posp*"]
-exclude = ['tests*']
-
-[project]
-name = "geos-posp"
-version = "1.0.0"
-description = "The Python package geos-posp is dedicated to post-process data from the geos simulation tool."
-authors = [{name = "GEOS Contributors" }]
-maintainers = [{name = "Alexandre Benedicto", email = "alexandre.benedicto@external.totalenergies.com" },
- {name = "Romain Baville", email = "romain.baville@external.totalenergies.com" },
- {name = "Paloma Martinez", email = "paloma.martinez@external.totalenergies.com" }]
-license = {text = "Apache-2.0"}
-classifiers = [
- "Intended Audience :: Developers",
- "Development Status :: 4 - Beta",
- "License :: OSI Approved :: Apache Software License ",
- "Natural Language :: English",
- "Operating System :: OS Independent",
- "Programming Language :: Python :: 3 :: Only",
- "Topic :: Scientific/Engineering :: Visualization",
-]
-keywords = [
- "GEOS",
- "Simulation",
-]
-
-requires-python = ">= 3.10"
-
-dependencies = [
- "geos-geomechanics",
- "geos-utils",
- "geos-mesh",
- "geos-processing",
- "vtk >= 9.3",
- "numpy >= 2.2",
- "pandas >= 2.2",
- "typing_extensions >= 4.12",
-]
-
-
-[project.urls]
-Homepage = "https://github.com/GEOS-DEV/geosPythonPackages"
-Documentation = "https://geosx-geosx.readthedocs-hosted.com/projects/geosx-geospythonpackages/en/latest/"
-Repository = "https://github.com/GEOS-DEV/geosPythonPackages.git"
-"Bug Tracker" = "https://github.com/GEOS-DEV/geosPythonPackages/issues"
-
-[project.optional-dependencies]
-build = [
- "build ~= 1.2"
-]
-dev = [
- "mypy",
- "yapf",
-]
-test = [
- "pytest-cov",
- "pytest"
-]
-
-[tool.bumpversion]
-current_version = "1.0.0"
-
-[[tool.bumpversion.files]]
-filename = "pyproject.toml"
-search = 'version = "{current_version}"'
-
-[tool.pytest.ini_options]
-addopts = "--import-mode=importlib"
-console_output_style = "count"
-pythonpath = [".", "src"]
-python_classes = "Test"
-python_files = "test*.py"
-python_functions = "test*"
-testpaths = ["tests"]
-norecursedirs = "bin"
-filterwarnings = []
-
-[tool.coverage.run]
-branch = true
-source = ["geos-posp"]
-omit = [
- "*/pyvistaUtils/*",
- "*/visu/*",
-]
\ No newline at end of file
diff --git a/geos-posp/src/geos_posp/__init__.py b/geos-posp/src/geos_posp/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/geos-posp/src/geos_posp/py.typed b/geos-posp/src/geos_posp/py.typed
deleted file mode 100644
index e69de29b..00000000
diff --git a/geos-posp/src/geos_posp/pyvistaTools/__init__.py b/geos-posp/src/geos_posp/pyvistaTools/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/geos-pv/requirements.txt b/geos-pv/requirements.txt
index 6ec1b5a9..f17109a7 100644
--- a/geos-pv/requirements.txt
+++ b/geos-pv/requirements.txt
@@ -1,5 +1,4 @@
geos-geomechanics
geos-mesh
-geos-posp
geos-utils
geos-processing
\ No newline at end of file
diff --git a/install_packages.sh b/install_packages.sh
index b6726ef7..bc6b6a13 100755
--- a/install_packages.sh
+++ b/install_packages.sh
@@ -3,7 +3,6 @@ python -m pip install --upgrade ./geos-utils
python -m pip install --upgrade ./geos-geomechanics
python -m pip install --upgrade ./geos-mesh
python -m pip install --upgrade ./geos-processing
-python -m pip install --upgrade ./geos-posp
python -m pip install --upgrade ./geos-xml-tools
python -m pip install --upgrade ./geos-xml-viewer
python -m pip install --upgrade ./hdf5-wrapper