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
145 changes: 64 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,53 +49,53 @@ The following package defines [Paraview](https://docs.paraview.org/) plugins tha
GEOS Python packages dependency tree (inter-dependency and main external dependencies) is the following:

```
|-- geos-ats
|-- pygeos-tools
|-- geos-utils
|-- geos-geomechanics
| |-- geos-utils
|
|-- hdf5-wrapper
| |-- h5py
|
|-- geos-xml-tools
| |-- lxml
|
|-- geos-mesh
| |-- geos-utils
| |-- vtk
|
|-- geos-prep
| |-- geos-mesh
| |-- geos-xml-tools
|
|-- geos-posp
| |-- geos-mesh
| |-- geos-geomechanics
|
|-- time-history
| |-- hdf5-wrapper
|
|-- mesh-doctor
| |-- geos-prep
| |-- pyvista
|
|-- geos-trame
| |-- geos-xml-tools
| |-- geos-mesh
| |-- pyvista
| |-- trame
|
|-- geos-xml-viewer
| |-- geos-xml-tools
| |-- geos-mesh
| |-- pyvista
|
|-- geos-pv
|-- geos-prep
|-- geos-posp
|-- geos-xml-tools
|-- paraview
├── geos-ats
├── pygeos-tools
├── geos-utils
├── geos-geomechanics
├── geos-utils
├── hdf5-wrapper
├── h5py
├── geos-xml-tools
├── lxml
├── geos-mesh
├── geos-utils
├── vtk
├── geos-prep
├── geos-mesh
├── geos-xml-tools
├── geos-posp
├── geos-mesh
├── geos-geomechanics
├── time-history
├── hdf5-wrapper
├── mesh-doctor
├── geos-prep
├── pyvista
├── geos-trame
├── geos-xml-tools
├── geos-mesh
├── pyvista
├── trame
├── geos-xml-viewer
├── geos-xml-tools
├── geos-mesh
├── pyvista
├── geos-pv
├── geos-prep
├── geos-posp
├── geos-xml-tools
├── paraview
```

See the [documentation](https://geosx-geosx.readthedocs-hosted.com/projects/geosx-geospythonpackages/en/latest/) for additional details about the packages and how to use them.
Expand Down Expand Up @@ -149,43 +149,26 @@ If you do not have the rights to push the code and open new PRs, consider openin
Any new package must have the following architecture:

```
package-name
|-- pyproject.toml
|-- setup.py
|-- src
| |-- geos
| |-- package_name
| |-- file1.py
| |-- file1.py
|-- tests
|-- test1.py
|-- test2.py
package-name/
├── pyproject.toml
├── src
│ ├── geos
│ ├── package_name
│ ├── file1.py
│ ├── file1.py
├── tests
├── test1.py
├── test2.py
```

The *setup.py* file is optional. It is required if the package depends on another GEOS Python package located in the root directory. If you want a package1 to depend on package2, follow this [procedure](https://stackoverflow.com/questions/75159453/specifying-local-relative-dependency-in-pyproject-toml):

* in the *package1/pyproject.py*, replace the tag `dependencies = ["external_packageX", "external_packageY",]` with `dynamic = ["dependencies"]`
* create the *package1/setup.py* file
* copy the following lines in the *setup.py* and update the dependencies
```
from pathlib import Path
from setuptools import setup

# This is where you add any fancy path resolution to the local lib:
package_name = "geos-utils"
geos_utils_path: str = (Path(__file__).parent.parent / package_name).as_uri()

setup(
install_requires=[
"vtk >= 9.3",
"numpy >= 1.26",
"pandas >= 2.2",
"typing_extensions >= 4.12",
f"{package_name} @ {geos_utils_path}",
]
)
```
If you want a package to depend on another GEOS Python package (let's say `geos-utils`), in the pyproject.toml the dependency takes the form:

```
dependencies = [
...
"geos-utils @ file:./geos-utils",
]
```

Release
-------
Expand Down
8 changes: 7 additions & 1 deletion geos-geomechanics/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python"
]
dynamic = ["dependencies"]
dependencies=[
"vtk >= 9.3",
"numpy >= 1.26",
"pandas >= 2.2",
"typing_extensions >= 4.12",
"geos-utils @ file:./geos-utils",
]
requires-python = ">= 3.10"

[project.optional-dependencies]
Expand Down
13 changes: 0 additions & 13 deletions geos-geomechanics/setup.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def specificGravity( density: npt.NDArray[ np.float64 ], specificDensity: float

if abs( specificDensity ) < EPSILON:
return np.full_like( density, np.nan )
return ( density / specificDensity ).astype( np.float64 )

return ( density / specificDensity ).astype( float )


# https://en.wikipedia.org/wiki/Elastic_modulus
Expand Down Expand Up @@ -626,7 +627,7 @@ def criticalPorePressure(
stressVector: npt.NDArray[ np.float64 ],
rockCohesion: float,
frictionAngle: float = 0.0,
) -> npt.NDArray[ np.float64 ]:
) -> npt.NDArray[ np.floating[ Any ] ]:
r"""Compute the critical pore pressure.

Fracturing can occur in areas where Critical pore pressure is greater than
Expand Down Expand Up @@ -665,9 +666,10 @@ def criticalPorePressure(
maximumPrincipalStress[ i ] = p1

# assertion frictionAngle < np.pi/2., so sin(frictionAngle) != 1
cohesiveTerm: npt.NDArray[ np.float64 ] = ( rockCohesion * np.cos( frictionAngle ) /
( 1 - np.sin( frictionAngle ) ) )
residualTerm: npt.NDArray[ np.floating[ Any ] ] = ( 3 * minimumPrincipalStress - maximumPrincipalStress ) / 2.0
cohesiveTerm: npt.NDArray[ np.floating[ Any ] ] = ( rockCohesion * np.cos( frictionAngle ) /
( 1.0 - np.sin( frictionAngle ) ) )
residualTerm: npt.NDArray[ np.floating[ Any ] ] = ( 3.0 * minimumPrincipalStress - maximumPrincipalStress ) / 2.0

return cohesiveTerm + residualTerm


Expand Down Expand Up @@ -852,14 +854,14 @@ def shearCapacityUtilization( traction: npt.NDArray[ np.float64 ], rockCohesion:
for i in range( traction.shape[ 0 ] ):
tractionVec: npt.NDArray[ np.float64 ] = traction[ i ]
# use -1 to agree with Geos convention (i.e., compression with negative stress)
stressNormal: npt.NDArray[ np.float64 ] = -1.0 * tractionVec[ 0 ]
stressNormal: float = -1.0 * tractionVec[ 0 ]

# compute failure envelope
mohrCoulomb: MohrCoulomb = MohrCoulomb( rockCohesion, frictionAngle )
tauFailure: float = float( mohrCoulomb.computeShearStress( stressNormal ) )
scu_i: float = np.nan
if tauFailure > 0:
scu_i = np.abs( tractionVec[ 1 ] ) / tauFailure
scu_i = abs( tractionVec[ 1 ] ) / tauFailure
# compute SCU
scu[ i ] = scu_i
return scu
Expand Down
14 changes: 12 additions & 2 deletions geos-posp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,18 @@ keywords = [
"GEOS",
"Simulation",
]
dynamic = ["dependencies"]
requires-python = ">= 3.9"

requires-python = ">= 3.10"

dependencies = [
"vtk >= 9.3",
"numpy >= 1.26",
"pandas >= 2.2",
"typing_extensions >= 4.12",
"geos-utils @ file:./geos-utils",
"geos-geomechanics @ file:./geos-geomechanics",
]


[project.urls]
Homepage = "https://github.com/GEOS-DEV/geosPythonPackages"
Expand Down
17 changes: 0 additions & 17 deletions geos-posp/setup.py

This file was deleted.

7 changes: 6 additions & 1 deletion geos-timehistory/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ classifiers = [
]

requires-python = ">=3.9"
dynamic = ["dependencies"]
dependencies = [
"matplotlib",
"h5py",
"numpy",
"hdf5-wrapper @ file:./hdf5-wrapper",
]

[project.scripts]
plot-timehistory = "geos.timehistory.plot:main"
Expand Down
13 changes: 0 additions & 13 deletions geos-timehistory/setup.py

This file was deleted.