Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
33 changes: 15 additions & 18 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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 }}
Expand All @@ -298,31 +295,31 @@ 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"
echo " Will proceed with GEOS integration tests"
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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typing-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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' )


Expand Down
10 changes: 0 additions & 10 deletions docs/geos-posp.rst

This file was deleted.

12 changes: 11 additions & 1 deletion docs/geos_mesh_docs/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,14 @@ geos.mesh.utils.multiblockModifiers module
.. automodule:: geos.mesh.utils.multiblockModifiers
:members:
:undoc-members:
:show-inheritance:
:show-inheritance:



geos.mesh.utils.pyvistaTools module
-----------------------------------------------

.. automodule:: geos.mesh.utils.pyvistaTools
:members:
:undoc-members:
:show-inheritance:
44 changes: 0 additions & 44 deletions docs/geos_posp_docs/home.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/geos_posp_docs/modules.rst

This file was deleted.

13 changes: 0 additions & 13 deletions docs/geos_posp_docs/pyvistaTools.rst

This file was deleted.

2 changes: 0 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ Packages

geos-mesh

geos-posp

geos-processing

geos-pv
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.

"""


Expand All @@ -31,46 +30,51 @@ 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.

"""
timeToPropertyMap: dict[ str, pd.DataFrame ] = {}
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 )
inputMesh: pv.Multiblock = reader.read()

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 )

Expand All @@ -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
Loading