From 07d42f2fc3c0d627f6b3eca553456757654b2342 Mon Sep 17 00:00:00 2001 From: Martin LEMAY Date: Thu, 27 Mar 2025 09:54:47 +0100 Subject: [PATCH 01/14] Create geos-utils package and move files --- geos-utils/pyproject.toml | 32 +++++++++++++++++++ .../src/geos_utils}/ConnectionSet.py | 0 .../src/geos_utils}/GeosOutputsConstants.py | 0 .../src/geos_utils}/Logger.py | 0 .../src/geos_utils}/PhysicalConstants.py | 0 .../src/geos_utils}/UnitRepository.py | 2 +- .../src/geos_utils}/__init__.py | 0 .../src/geos_utils}/enumUnits.py | 0 .../src/geos_utils}/geometryFunctions.py | 2 +- .../src/geos_utils}/geosUtils.py | 0 .../tests/testsFunctionsGeosUtils.py | 2 +- .../tests/testsGeometryFunctions.py | 0 12 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 geos-utils/pyproject.toml rename {geos-posp/src/geos_posp/processing => geos-utils/src/geos_utils}/ConnectionSet.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/GeosOutputsConstants.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/Logger.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/PhysicalConstants.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/UnitRepository.py (93%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/__init__.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/enumUnits.py (100%) rename {geos-posp/src/geos_posp/processing => geos-utils/src/geos_utils}/geometryFunctions.py (99%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/geosUtils.py (100%) rename {geos-posp => geos-utils}/tests/testsFunctionsGeosUtils.py (96%) rename {geos-posp => geos-utils}/tests/testsGeometryFunctions.py (100%) diff --git a/geos-utils/pyproject.toml b/geos-utils/pyproject.toml new file mode 100644 index 000000000..fc32cc914 --- /dev/null +++ b/geos-utils/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "geos-utils" +version = "0.1.0" +description = "geos-utils is a Python package that gathers utilities common to all GEOS python packages." +authors = [{name = "GEOS Contributors" }] +maintainers = [ + {name = "Martin Lemay", email = "martin.lemay@external.totalenergies.com"} +] +license = {text = "Apache-2.0"} +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python" +] + +requires-python = ">=3.9" + +dependencies = [ + "typing_extensions", + "numpy", +] + +[project.scripts] + + +[tool.mypy] +python_version = "3.9" +warn_return_any = true +warn_unused_configs = true \ No newline at end of file diff --git a/geos-posp/src/geos_posp/processing/ConnectionSet.py b/geos-utils/src/geos_utils/ConnectionSet.py similarity index 100% rename from geos-posp/src/geos_posp/processing/ConnectionSet.py rename to geos-utils/src/geos_utils/ConnectionSet.py diff --git a/geos-posp/src/geos_posp/utils/GeosOutputsConstants.py b/geos-utils/src/geos_utils/GeosOutputsConstants.py similarity index 100% rename from geos-posp/src/geos_posp/utils/GeosOutputsConstants.py rename to geos-utils/src/geos_utils/GeosOutputsConstants.py diff --git a/geos-posp/src/geos_posp/utils/Logger.py b/geos-utils/src/geos_utils/Logger.py similarity index 100% rename from geos-posp/src/geos_posp/utils/Logger.py rename to geos-utils/src/geos_utils/Logger.py diff --git a/geos-posp/src/geos_posp/utils/PhysicalConstants.py b/geos-utils/src/geos_utils/PhysicalConstants.py similarity index 100% rename from geos-posp/src/geos_posp/utils/PhysicalConstants.py rename to geos-utils/src/geos_utils/PhysicalConstants.py diff --git a/geos-posp/src/geos_posp/utils/UnitRepository.py b/geos-utils/src/geos_utils/UnitRepository.py similarity index 93% rename from geos-posp/src/geos_posp/utils/UnitRepository.py rename to geos-utils/src/geos_utils/UnitRepository.py index 5984bff9a..83f737f5f 100644 --- a/geos-posp/src/geos_posp/utils/UnitRepository.py +++ b/geos-utils/src/geos_utils/UnitRepository.py @@ -6,7 +6,7 @@ from typing_extensions import Self -from geos_posp.utils.enumUnits import Unit, getPropertyUnitEnum, getSIUnits +from geos_utils.enumUnits import Unit, getPropertyUnitEnum, getSIUnits class UnitRepository: diff --git a/geos-posp/src/geos_posp/utils/__init__.py b/geos-utils/src/geos_utils/__init__.py similarity index 100% rename from geos-posp/src/geos_posp/utils/__init__.py rename to geos-utils/src/geos_utils/__init__.py diff --git a/geos-posp/src/geos_posp/utils/enumUnits.py b/geos-utils/src/geos_utils/enumUnits.py similarity index 100% rename from geos-posp/src/geos_posp/utils/enumUnits.py rename to geos-utils/src/geos_utils/enumUnits.py diff --git a/geos-posp/src/geos_posp/processing/geometryFunctions.py b/geos-utils/src/geos_utils/geometryFunctions.py similarity index 99% rename from geos-posp/src/geos_posp/processing/geometryFunctions.py rename to geos-utils/src/geos_utils/geometryFunctions.py index 0c480fd92..f46b72888 100644 --- a/geos-posp/src/geos_posp/processing/geometryFunctions.py +++ b/geos-utils/src/geos_utils/geometryFunctions.py @@ -4,7 +4,7 @@ import numpy as np import numpy.typing as npt -from geos_posp.utils.PhysicalConstants import EPSILON +from geos_utils.PhysicalConstants import EPSILON __doc__ = """Functions to permform geometry calculations.""" diff --git a/geos-posp/src/geos_posp/utils/geosUtils.py b/geos-utils/src/geos_utils/geosUtils.py similarity index 100% rename from geos-posp/src/geos_posp/utils/geosUtils.py rename to geos-utils/src/geos_utils/geosUtils.py diff --git a/geos-posp/tests/testsFunctionsGeosUtils.py b/geos-utils/tests/testsFunctionsGeosUtils.py similarity index 96% rename from geos-posp/tests/testsFunctionsGeosUtils.py rename to geos-utils/tests/testsFunctionsGeosUtils.py index 7de59de61..a787e83dd 100644 --- a/geos-posp/tests/testsFunctionsGeosUtils.py +++ b/geos-utils/tests/testsFunctionsGeosUtils.py @@ -15,7 +15,7 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) -import geos_posp.utils.geosUtils as fcts +import geos_utils.geosUtils as fcts matrix: npt.NDArray[np.float64] = np.array([[11, 21, 31], [21, 22, 23], [31, 23, 33]]) vector: npt.NDArray[np.float64] = np.array([11, 22, 33, 23, 31, 21]) diff --git a/geos-posp/tests/testsGeometryFunctions.py b/geos-utils/tests/testsGeometryFunctions.py similarity index 100% rename from geos-posp/tests/testsGeometryFunctions.py rename to geos-utils/tests/testsGeometryFunctions.py From 82615e59daf3a9808c1aa68955e3625a4d8e2ac4 Mon Sep 17 00:00:00 2001 From: Martin LEMAY Date: Thu, 27 Mar 2025 10:42:58 +0100 Subject: [PATCH 02/14] Update doc geos-utils --- docs/geos-posp.rst | 6 +- docs/geos-utils.rst | 73 +++++++++++++++++++ .../PVplugins.rst | 0 docs/{posp_rst => geos_posp_docs}/filters.rst | 0 docs/{posp_rst => geos_posp_docs}/home.rst | 0 docs/{posp_rst => geos_posp_docs}/modules.rst | 0 .../processing.rst | 0 .../pyvistaTools.rst | 0 docs/{posp_rst => geos_posp_docs}/readers.rst | 0 .../visu.PVUtils.rst | 0 .../visu.mohrCircles.rst | 0 .../visu.pythonViewUtils.rst | 0 docs/{posp_rst => geos_posp_docs}/visu.rst | 0 .../visualization.rst | 0 docs/posp_rst/utils.rst | 55 -------------- geos-utils/pyproject.toml | 34 +++++++++ .../src/geos_utils/GeosOutputsConstants.py | 10 +++ .../{geosUtils.py => algebraFunctions.py} | 0 geos-utils/tests/testsFunctionsGeosUtils.py | 4 +- geos-utils/tests/testsGeometryFunctions.py | 2 +- 20 files changed, 123 insertions(+), 61 deletions(-) create mode 100644 docs/geos-utils.rst rename docs/{posp_rst => geos_posp_docs}/PVplugins.rst (100%) rename docs/{posp_rst => geos_posp_docs}/filters.rst (100%) rename docs/{posp_rst => geos_posp_docs}/home.rst (100%) rename docs/{posp_rst => geos_posp_docs}/modules.rst (100%) rename docs/{posp_rst => geos_posp_docs}/processing.rst (100%) rename docs/{posp_rst => geos_posp_docs}/pyvistaTools.rst (100%) rename docs/{posp_rst => geos_posp_docs}/readers.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visu.PVUtils.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visu.mohrCircles.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visu.pythonViewUtils.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visu.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visualization.rst (100%) delete mode 100644 docs/posp_rst/utils.rst rename geos-utils/src/geos_utils/{geosUtils.py => algebraFunctions.py} (100%) diff --git a/docs/geos-posp.rst b/docs/geos-posp.rst index 076b76e53..19e5c205e 100644 --- a/docs/geos-posp.rst +++ b/docs/geos-posp.rst @@ -5,8 +5,8 @@ GEOS Post-Processing tools :maxdepth: 5 :caption: Contents: - ./posp_rst/home.rst + ./geos_posp_docs/home.rst - ./posp_rst/modules.rst + ./geos_posp_docs/modules.rst - ./posp_rst/visualization.rst + ./geos_posp_docs/visualization.rst diff --git a/docs/geos-utils.rst b/docs/geos-utils.rst new file mode 100644 index 000000000..cd6e67fbf --- /dev/null +++ b/docs/geos-utils.rst @@ -0,0 +1,73 @@ + +GEOS Utilities +=============== + +The `geos-utils` python package defines utilities for all GEOS python packages including a logger, GEOS constants, basic functions, and unit management tools. + + +API +^^^ + +geos_utils.ConnectionSet module +-------------------------------- + +.. automodule:: geos_utils.ConnectionSet + :members: + :undoc-members: + :show-inheritance: + +geos_utils.enumUnits module +-------------------------------- + +.. automodule:: geos_utils.enumUnits + :members: + :undoc-members: + :show-inheritance: + +geos_utils.geometryFunctions module +-------------------------------- + +.. automodule:: geos_utils.geometryFunctions + :members: + :undoc-members: + :show-inheritance: + +geos_utils.GeosOutputsConstants module +------------------------------------------- + +.. automodule:: geos_utils.GeosOutputsConstants + :members: + :undoc-members: + :show-inheritance: + +geos_utils.algebraFunctions module +------------------------------------------- + +.. automodule:: geos_utils.algebraFunctions + :members: + :undoc-members: + :show-inheritance: + +geos_utils.Logger module +------------------------------ + +.. automodule:: geos_utils.Logger + :members: + :undoc-members: + :show-inheritance: + +geos_utils.PhysicalConstants module +----------------------------------------- + +.. automodule:: geos_utils.PhysicalConstants + :members: + :undoc-members: + :show-inheritance: + +geos_utils.UnitRepository module +------------------------------------- + +.. automodule:: geos_utils.UnitRepository + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/posp_rst/PVplugins.rst b/docs/geos_posp_docs/PVplugins.rst similarity index 100% rename from docs/posp_rst/PVplugins.rst rename to docs/geos_posp_docs/PVplugins.rst diff --git a/docs/posp_rst/filters.rst b/docs/geos_posp_docs/filters.rst similarity index 100% rename from docs/posp_rst/filters.rst rename to docs/geos_posp_docs/filters.rst diff --git a/docs/posp_rst/home.rst b/docs/geos_posp_docs/home.rst similarity index 100% rename from docs/posp_rst/home.rst rename to docs/geos_posp_docs/home.rst diff --git a/docs/posp_rst/modules.rst b/docs/geos_posp_docs/modules.rst similarity index 100% rename from docs/posp_rst/modules.rst rename to docs/geos_posp_docs/modules.rst diff --git a/docs/posp_rst/processing.rst b/docs/geos_posp_docs/processing.rst similarity index 100% rename from docs/posp_rst/processing.rst rename to docs/geos_posp_docs/processing.rst diff --git a/docs/posp_rst/pyvistaTools.rst b/docs/geos_posp_docs/pyvistaTools.rst similarity index 100% rename from docs/posp_rst/pyvistaTools.rst rename to docs/geos_posp_docs/pyvistaTools.rst diff --git a/docs/posp_rst/readers.rst b/docs/geos_posp_docs/readers.rst similarity index 100% rename from docs/posp_rst/readers.rst rename to docs/geos_posp_docs/readers.rst diff --git a/docs/posp_rst/visu.PVUtils.rst b/docs/geos_posp_docs/visu.PVUtils.rst similarity index 100% rename from docs/posp_rst/visu.PVUtils.rst rename to docs/geos_posp_docs/visu.PVUtils.rst diff --git a/docs/posp_rst/visu.mohrCircles.rst b/docs/geos_posp_docs/visu.mohrCircles.rst similarity index 100% rename from docs/posp_rst/visu.mohrCircles.rst rename to docs/geos_posp_docs/visu.mohrCircles.rst diff --git a/docs/posp_rst/visu.pythonViewUtils.rst b/docs/geos_posp_docs/visu.pythonViewUtils.rst similarity index 100% rename from docs/posp_rst/visu.pythonViewUtils.rst rename to docs/geos_posp_docs/visu.pythonViewUtils.rst diff --git a/docs/posp_rst/visu.rst b/docs/geos_posp_docs/visu.rst similarity index 100% rename from docs/posp_rst/visu.rst rename to docs/geos_posp_docs/visu.rst diff --git a/docs/posp_rst/visualization.rst b/docs/geos_posp_docs/visualization.rst similarity index 100% rename from docs/posp_rst/visualization.rst rename to docs/geos_posp_docs/visualization.rst diff --git a/docs/posp_rst/utils.rst b/docs/posp_rst/utils.rst deleted file mode 100644 index c46c68915..000000000 --- a/docs/posp_rst/utils.rst +++ /dev/null @@ -1,55 +0,0 @@ -Utils -===== - -This packages defines utilities including logger, constants, and unit management tools. - - - -geos_posp.utils.GeosOutputsConstants module -------------------------------------------- - -.. automodule:: geos_posp.utils.GeosOutputsConstants - :members: - :undoc-members: - :show-inheritance: - -geos_posp.utils.geosUtils module ---------------------------------- - -.. automodule:: geos_posp.utils.geosUtils - :members: - :undoc-members: - :show-inheritance: - -geos_posp.utils.Logger module ------------------------------- - -.. automodule:: geos_posp.utils.Logger - :members: - :undoc-members: - :show-inheritance: - -geos_posp.utils.PhysicalConstants module ------------------------------------------ - -.. automodule:: geos_posp.utils.PhysicalConstants - :members: - :undoc-members: - :show-inheritance: - -geos_posp.utils.UnitRepository module -------------------------------------- - -.. automodule:: geos_posp.utils.UnitRepository - :members: - :undoc-members: - :show-inheritance: - - -geos_posp.utils.enumUnits module --------------------------------- - -.. automodule:: geos_posp.utils.enumUnits - :members: - :undoc-members: - :show-inheritance: diff --git a/geos-utils/pyproject.toml b/geos-utils/pyproject.toml index fc32cc914..c30aff5ba 100644 --- a/geos-utils/pyproject.toml +++ b/geos-utils/pyproject.toml @@ -23,9 +23,43 @@ dependencies = [ "numpy", ] +[project.optional-dependencies] +build = [ + "build ~= 1.2" +] +dev = [ + "pylint", + "mypy", + "black", + "sphinx", + "sphinx-rtd-theme", + "sphinx-autodoc-typehints" +] +test = [ + "pytest", + "pytest-cov" +] + + [project.scripts] +[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 = ["pybend"] + + [tool.mypy] python_version = "3.9" warn_return_any = true diff --git a/geos-utils/src/geos_utils/GeosOutputsConstants.py b/geos-utils/src/geos_utils/GeosOutputsConstants.py index 374d3fd75..84771f935 100644 --- a/geos-utils/src/geos_utils/GeosOutputsConstants.py +++ b/geos-utils/src/geos_utils/GeosOutputsConstants.py @@ -8,6 +8,16 @@ __doc__ = """ GeosOutputsConstants module defines usefull constant names such as attribute names, domain names, phase types, and the lists of attribute names to process. + +.. WARNING:: + Names may need to be updated when modifications occur in the GEOS code. + + +.. todo:: + + If possible, link GEOS names directly with GEOS code instead of redefining + them here. + """ #: Phase separator in Geos output log file. diff --git a/geos-utils/src/geos_utils/geosUtils.py b/geos-utils/src/geos_utils/algebraFunctions.py similarity index 100% rename from geos-utils/src/geos_utils/geosUtils.py rename to geos-utils/src/geos_utils/algebraFunctions.py diff --git a/geos-utils/tests/testsFunctionsGeosUtils.py b/geos-utils/tests/testsFunctionsGeosUtils.py index a787e83dd..6c626d382 100644 --- a/geos-utils/tests/testsFunctionsGeosUtils.py +++ b/geos-utils/tests/testsFunctionsGeosUtils.py @@ -15,13 +15,13 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) -import geos_utils.geosUtils as fcts +import geos_utils.algebraFunctions as fcts matrix: npt.NDArray[np.float64] = np.array([[11, 21, 31], [21, 22, 23], [31, 23, 33]]) vector: npt.NDArray[np.float64] = np.array([11, 22, 33, 23, 31, 21]) -class TestsFunctionsGeosUtils(unittest.TestCase): +class TestsFunctionsalgebraFunctions(unittest.TestCase): def test_getAttributeMatrixFromVector(self: Self) -> None: """Test conversion from Matrix to Vector for Geos stress.""" diff --git a/geos-utils/tests/testsGeometryFunctions.py b/geos-utils/tests/testsGeometryFunctions.py index 3f7ddb0b0..92ca82b02 100644 --- a/geos-utils/tests/testsGeometryFunctions.py +++ b/geos-utils/tests/testsGeometryFunctions.py @@ -15,7 +15,7 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) -import geos_posp.processing.geometryFunctions as fcts +import geos_utils.geometryFunctions as fcts basisCanon: tuple[ npt.NDArray[np.float64], npt.NDArray[np.float64], npt.NDArray[np.float64] From 885d8825a839eed368d25dd48dfe0656fe645a29 Mon Sep 17 00:00:00 2001 From: mlemayTTE Date: Thu, 27 Mar 2025 15:06:08 +0100 Subject: [PATCH 03/14] harmonize package organization with existing packages --- geos-utils/src/{geos_utils => geos/utils}/ConnectionSet.py | 0 geos-utils/src/{geos_utils => geos/utils}/GeosOutputsConstants.py | 0 geos-utils/src/{geos_utils => geos/utils}/Logger.py | 0 geos-utils/src/{geos_utils => geos/utils}/PhysicalConstants.py | 0 geos-utils/src/{geos_utils => geos/utils}/UnitRepository.py | 0 geos-utils/src/{geos_utils => geos/utils}/__init__.py | 0 geos-utils/src/{geos_utils => geos/utils}/algebraFunctions.py | 0 geos-utils/src/{geos_utils => geos/utils}/enumUnits.py | 0 geos-utils/src/{geos_utils => geos/utils}/geometryFunctions.py | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename geos-utils/src/{geos_utils => geos/utils}/ConnectionSet.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/GeosOutputsConstants.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/Logger.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/PhysicalConstants.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/UnitRepository.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/__init__.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/algebraFunctions.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/enumUnits.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/geometryFunctions.py (100%) diff --git a/geos-utils/src/geos_utils/ConnectionSet.py b/geos-utils/src/geos/utils/ConnectionSet.py similarity index 100% rename from geos-utils/src/geos_utils/ConnectionSet.py rename to geos-utils/src/geos/utils/ConnectionSet.py diff --git a/geos-utils/src/geos_utils/GeosOutputsConstants.py b/geos-utils/src/geos/utils/GeosOutputsConstants.py similarity index 100% rename from geos-utils/src/geos_utils/GeosOutputsConstants.py rename to geos-utils/src/geos/utils/GeosOutputsConstants.py diff --git a/geos-utils/src/geos_utils/Logger.py b/geos-utils/src/geos/utils/Logger.py similarity index 100% rename from geos-utils/src/geos_utils/Logger.py rename to geos-utils/src/geos/utils/Logger.py diff --git a/geos-utils/src/geos_utils/PhysicalConstants.py b/geos-utils/src/geos/utils/PhysicalConstants.py similarity index 100% rename from geos-utils/src/geos_utils/PhysicalConstants.py rename to geos-utils/src/geos/utils/PhysicalConstants.py diff --git a/geos-utils/src/geos_utils/UnitRepository.py b/geos-utils/src/geos/utils/UnitRepository.py similarity index 100% rename from geos-utils/src/geos_utils/UnitRepository.py rename to geos-utils/src/geos/utils/UnitRepository.py diff --git a/geos-utils/src/geos_utils/__init__.py b/geos-utils/src/geos/utils/__init__.py similarity index 100% rename from geos-utils/src/geos_utils/__init__.py rename to geos-utils/src/geos/utils/__init__.py diff --git a/geos-utils/src/geos_utils/algebraFunctions.py b/geos-utils/src/geos/utils/algebraFunctions.py similarity index 100% rename from geos-utils/src/geos_utils/algebraFunctions.py rename to geos-utils/src/geos/utils/algebraFunctions.py diff --git a/geos-utils/src/geos_utils/enumUnits.py b/geos-utils/src/geos/utils/enumUnits.py similarity index 100% rename from geos-utils/src/geos_utils/enumUnits.py rename to geos-utils/src/geos/utils/enumUnits.py diff --git a/geos-utils/src/geos_utils/geometryFunctions.py b/geos-utils/src/geos/utils/geometryFunctions.py similarity index 100% rename from geos-utils/src/geos_utils/geometryFunctions.py rename to geos-utils/src/geos/utils/geometryFunctions.py From c3ec0741956fc872c7c84bc2bc680daca338df94 Mon Sep 17 00:00:00 2001 From: Martin LEMAY Date: Thu, 27 Mar 2025 09:54:47 +0100 Subject: [PATCH 04/14] Create geos-utils package and move files --- geos-utils/pyproject.toml | 32 +++++++++++++++++++ .../src/geos_utils}/ConnectionSet.py | 0 .../src/geos_utils}/GeosOutputsConstants.py | 0 .../src/geos_utils}/Logger.py | 0 .../src/geos_utils}/PhysicalConstants.py | 0 .../src/geos_utils}/UnitRepository.py | 2 +- .../src/geos_utils}/__init__.py | 0 .../src/geos_utils}/enumUnits.py | 0 .../src/geos_utils}/geometryFunctions.py | 2 +- .../src/geos_utils}/geosUtils.py | 0 .../tests/testsFunctionsGeosUtils.py | 2 +- .../tests/testsGeometryFunctions.py | 0 12 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 geos-utils/pyproject.toml rename {geos-posp/src/geos_posp/processing => geos-utils/src/geos_utils}/ConnectionSet.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/GeosOutputsConstants.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/Logger.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/PhysicalConstants.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/UnitRepository.py (93%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/__init__.py (100%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/enumUnits.py (100%) rename {geos-posp/src/geos_posp/processing => geos-utils/src/geos_utils}/geometryFunctions.py (99%) rename {geos-posp/src/geos_posp/utils => geos-utils/src/geos_utils}/geosUtils.py (100%) rename {geos-posp => geos-utils}/tests/testsFunctionsGeosUtils.py (96%) rename {geos-posp => geos-utils}/tests/testsGeometryFunctions.py (100%) diff --git a/geos-utils/pyproject.toml b/geos-utils/pyproject.toml new file mode 100644 index 000000000..fc32cc914 --- /dev/null +++ b/geos-utils/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "geos-utils" +version = "0.1.0" +description = "geos-utils is a Python package that gathers utilities common to all GEOS python packages." +authors = [{name = "GEOS Contributors" }] +maintainers = [ + {name = "Martin Lemay", email = "martin.lemay@external.totalenergies.com"} +] +license = {text = "Apache-2.0"} +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python" +] + +requires-python = ">=3.9" + +dependencies = [ + "typing_extensions", + "numpy", +] + +[project.scripts] + + +[tool.mypy] +python_version = "3.9" +warn_return_any = true +warn_unused_configs = true \ No newline at end of file diff --git a/geos-posp/src/geos_posp/processing/ConnectionSet.py b/geos-utils/src/geos_utils/ConnectionSet.py similarity index 100% rename from geos-posp/src/geos_posp/processing/ConnectionSet.py rename to geos-utils/src/geos_utils/ConnectionSet.py diff --git a/geos-posp/src/geos_posp/utils/GeosOutputsConstants.py b/geos-utils/src/geos_utils/GeosOutputsConstants.py similarity index 100% rename from geos-posp/src/geos_posp/utils/GeosOutputsConstants.py rename to geos-utils/src/geos_utils/GeosOutputsConstants.py diff --git a/geos-posp/src/geos_posp/utils/Logger.py b/geos-utils/src/geos_utils/Logger.py similarity index 100% rename from geos-posp/src/geos_posp/utils/Logger.py rename to geos-utils/src/geos_utils/Logger.py diff --git a/geos-posp/src/geos_posp/utils/PhysicalConstants.py b/geos-utils/src/geos_utils/PhysicalConstants.py similarity index 100% rename from geos-posp/src/geos_posp/utils/PhysicalConstants.py rename to geos-utils/src/geos_utils/PhysicalConstants.py diff --git a/geos-posp/src/geos_posp/utils/UnitRepository.py b/geos-utils/src/geos_utils/UnitRepository.py similarity index 93% rename from geos-posp/src/geos_posp/utils/UnitRepository.py rename to geos-utils/src/geos_utils/UnitRepository.py index 5984bff9a..83f737f5f 100644 --- a/geos-posp/src/geos_posp/utils/UnitRepository.py +++ b/geos-utils/src/geos_utils/UnitRepository.py @@ -6,7 +6,7 @@ from typing_extensions import Self -from geos_posp.utils.enumUnits import Unit, getPropertyUnitEnum, getSIUnits +from geos_utils.enumUnits import Unit, getPropertyUnitEnum, getSIUnits class UnitRepository: diff --git a/geos-posp/src/geos_posp/utils/__init__.py b/geos-utils/src/geos_utils/__init__.py similarity index 100% rename from geos-posp/src/geos_posp/utils/__init__.py rename to geos-utils/src/geos_utils/__init__.py diff --git a/geos-posp/src/geos_posp/utils/enumUnits.py b/geos-utils/src/geos_utils/enumUnits.py similarity index 100% rename from geos-posp/src/geos_posp/utils/enumUnits.py rename to geos-utils/src/geos_utils/enumUnits.py diff --git a/geos-posp/src/geos_posp/processing/geometryFunctions.py b/geos-utils/src/geos_utils/geometryFunctions.py similarity index 99% rename from geos-posp/src/geos_posp/processing/geometryFunctions.py rename to geos-utils/src/geos_utils/geometryFunctions.py index 0c480fd92..f46b72888 100644 --- a/geos-posp/src/geos_posp/processing/geometryFunctions.py +++ b/geos-utils/src/geos_utils/geometryFunctions.py @@ -4,7 +4,7 @@ import numpy as np import numpy.typing as npt -from geos_posp.utils.PhysicalConstants import EPSILON +from geos_utils.PhysicalConstants import EPSILON __doc__ = """Functions to permform geometry calculations.""" diff --git a/geos-posp/src/geos_posp/utils/geosUtils.py b/geos-utils/src/geos_utils/geosUtils.py similarity index 100% rename from geos-posp/src/geos_posp/utils/geosUtils.py rename to geos-utils/src/geos_utils/geosUtils.py diff --git a/geos-posp/tests/testsFunctionsGeosUtils.py b/geos-utils/tests/testsFunctionsGeosUtils.py similarity index 96% rename from geos-posp/tests/testsFunctionsGeosUtils.py rename to geos-utils/tests/testsFunctionsGeosUtils.py index 7de59de61..a787e83dd 100644 --- a/geos-posp/tests/testsFunctionsGeosUtils.py +++ b/geos-utils/tests/testsFunctionsGeosUtils.py @@ -15,7 +15,7 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) -import geos_posp.utils.geosUtils as fcts +import geos_utils.geosUtils as fcts matrix: npt.NDArray[np.float64] = np.array([[11, 21, 31], [21, 22, 23], [31, 23, 33]]) vector: npt.NDArray[np.float64] = np.array([11, 22, 33, 23, 31, 21]) diff --git a/geos-posp/tests/testsGeometryFunctions.py b/geos-utils/tests/testsGeometryFunctions.py similarity index 100% rename from geos-posp/tests/testsGeometryFunctions.py rename to geos-utils/tests/testsGeometryFunctions.py From a7a7323cddb15e6e543bebe65b3fc979fedc5a87 Mon Sep 17 00:00:00 2001 From: Martin LEMAY Date: Thu, 27 Mar 2025 10:42:58 +0100 Subject: [PATCH 05/14] Update doc geos-utils --- docs/geos-posp.rst | 6 +- docs/geos-utils.rst | 73 +++++++++++++++++++ .../PVplugins.rst | 0 docs/{posp_rst => geos_posp_docs}/filters.rst | 0 docs/{posp_rst => geos_posp_docs}/home.rst | 0 docs/{posp_rst => geos_posp_docs}/modules.rst | 0 .../processing.rst | 0 .../pyvistaTools.rst | 0 docs/{posp_rst => geos_posp_docs}/readers.rst | 0 .../visu.PVUtils.rst | 0 .../visu.mohrCircles.rst | 0 .../visu.pythonViewUtils.rst | 0 docs/{posp_rst => geos_posp_docs}/visu.rst | 0 .../visualization.rst | 0 docs/posp_rst/utils.rst | 55 -------------- geos-utils/pyproject.toml | 34 +++++++++ .../src/geos_utils/GeosOutputsConstants.py | 10 +++ .../{geosUtils.py => algebraFunctions.py} | 0 geos-utils/tests/testsFunctionsGeosUtils.py | 4 +- geos-utils/tests/testsGeometryFunctions.py | 2 +- 20 files changed, 123 insertions(+), 61 deletions(-) create mode 100644 docs/geos-utils.rst rename docs/{posp_rst => geos_posp_docs}/PVplugins.rst (100%) rename docs/{posp_rst => geos_posp_docs}/filters.rst (100%) rename docs/{posp_rst => geos_posp_docs}/home.rst (100%) rename docs/{posp_rst => geos_posp_docs}/modules.rst (100%) rename docs/{posp_rst => geos_posp_docs}/processing.rst (100%) rename docs/{posp_rst => geos_posp_docs}/pyvistaTools.rst (100%) rename docs/{posp_rst => geos_posp_docs}/readers.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visu.PVUtils.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visu.mohrCircles.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visu.pythonViewUtils.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visu.rst (100%) rename docs/{posp_rst => geos_posp_docs}/visualization.rst (100%) delete mode 100644 docs/posp_rst/utils.rst rename geos-utils/src/geos_utils/{geosUtils.py => algebraFunctions.py} (100%) diff --git a/docs/geos-posp.rst b/docs/geos-posp.rst index 076b76e53..19e5c205e 100644 --- a/docs/geos-posp.rst +++ b/docs/geos-posp.rst @@ -5,8 +5,8 @@ GEOS Post-Processing tools :maxdepth: 5 :caption: Contents: - ./posp_rst/home.rst + ./geos_posp_docs/home.rst - ./posp_rst/modules.rst + ./geos_posp_docs/modules.rst - ./posp_rst/visualization.rst + ./geos_posp_docs/visualization.rst diff --git a/docs/geos-utils.rst b/docs/geos-utils.rst new file mode 100644 index 000000000..cd6e67fbf --- /dev/null +++ b/docs/geos-utils.rst @@ -0,0 +1,73 @@ + +GEOS Utilities +=============== + +The `geos-utils` python package defines utilities for all GEOS python packages including a logger, GEOS constants, basic functions, and unit management tools. + + +API +^^^ + +geos_utils.ConnectionSet module +-------------------------------- + +.. automodule:: geos_utils.ConnectionSet + :members: + :undoc-members: + :show-inheritance: + +geos_utils.enumUnits module +-------------------------------- + +.. automodule:: geos_utils.enumUnits + :members: + :undoc-members: + :show-inheritance: + +geos_utils.geometryFunctions module +-------------------------------- + +.. automodule:: geos_utils.geometryFunctions + :members: + :undoc-members: + :show-inheritance: + +geos_utils.GeosOutputsConstants module +------------------------------------------- + +.. automodule:: geos_utils.GeosOutputsConstants + :members: + :undoc-members: + :show-inheritance: + +geos_utils.algebraFunctions module +------------------------------------------- + +.. automodule:: geos_utils.algebraFunctions + :members: + :undoc-members: + :show-inheritance: + +geos_utils.Logger module +------------------------------ + +.. automodule:: geos_utils.Logger + :members: + :undoc-members: + :show-inheritance: + +geos_utils.PhysicalConstants module +----------------------------------------- + +.. automodule:: geos_utils.PhysicalConstants + :members: + :undoc-members: + :show-inheritance: + +geos_utils.UnitRepository module +------------------------------------- + +.. automodule:: geos_utils.UnitRepository + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/posp_rst/PVplugins.rst b/docs/geos_posp_docs/PVplugins.rst similarity index 100% rename from docs/posp_rst/PVplugins.rst rename to docs/geos_posp_docs/PVplugins.rst diff --git a/docs/posp_rst/filters.rst b/docs/geos_posp_docs/filters.rst similarity index 100% rename from docs/posp_rst/filters.rst rename to docs/geos_posp_docs/filters.rst diff --git a/docs/posp_rst/home.rst b/docs/geos_posp_docs/home.rst similarity index 100% rename from docs/posp_rst/home.rst rename to docs/geos_posp_docs/home.rst diff --git a/docs/posp_rst/modules.rst b/docs/geos_posp_docs/modules.rst similarity index 100% rename from docs/posp_rst/modules.rst rename to docs/geos_posp_docs/modules.rst diff --git a/docs/posp_rst/processing.rst b/docs/geos_posp_docs/processing.rst similarity index 100% rename from docs/posp_rst/processing.rst rename to docs/geos_posp_docs/processing.rst diff --git a/docs/posp_rst/pyvistaTools.rst b/docs/geos_posp_docs/pyvistaTools.rst similarity index 100% rename from docs/posp_rst/pyvistaTools.rst rename to docs/geos_posp_docs/pyvistaTools.rst diff --git a/docs/posp_rst/readers.rst b/docs/geos_posp_docs/readers.rst similarity index 100% rename from docs/posp_rst/readers.rst rename to docs/geos_posp_docs/readers.rst diff --git a/docs/posp_rst/visu.PVUtils.rst b/docs/geos_posp_docs/visu.PVUtils.rst similarity index 100% rename from docs/posp_rst/visu.PVUtils.rst rename to docs/geos_posp_docs/visu.PVUtils.rst diff --git a/docs/posp_rst/visu.mohrCircles.rst b/docs/geos_posp_docs/visu.mohrCircles.rst similarity index 100% rename from docs/posp_rst/visu.mohrCircles.rst rename to docs/geos_posp_docs/visu.mohrCircles.rst diff --git a/docs/posp_rst/visu.pythonViewUtils.rst b/docs/geos_posp_docs/visu.pythonViewUtils.rst similarity index 100% rename from docs/posp_rst/visu.pythonViewUtils.rst rename to docs/geos_posp_docs/visu.pythonViewUtils.rst diff --git a/docs/posp_rst/visu.rst b/docs/geos_posp_docs/visu.rst similarity index 100% rename from docs/posp_rst/visu.rst rename to docs/geos_posp_docs/visu.rst diff --git a/docs/posp_rst/visualization.rst b/docs/geos_posp_docs/visualization.rst similarity index 100% rename from docs/posp_rst/visualization.rst rename to docs/geos_posp_docs/visualization.rst diff --git a/docs/posp_rst/utils.rst b/docs/posp_rst/utils.rst deleted file mode 100644 index c46c68915..000000000 --- a/docs/posp_rst/utils.rst +++ /dev/null @@ -1,55 +0,0 @@ -Utils -===== - -This packages defines utilities including logger, constants, and unit management tools. - - - -geos_posp.utils.GeosOutputsConstants module -------------------------------------------- - -.. automodule:: geos_posp.utils.GeosOutputsConstants - :members: - :undoc-members: - :show-inheritance: - -geos_posp.utils.geosUtils module ---------------------------------- - -.. automodule:: geos_posp.utils.geosUtils - :members: - :undoc-members: - :show-inheritance: - -geos_posp.utils.Logger module ------------------------------- - -.. automodule:: geos_posp.utils.Logger - :members: - :undoc-members: - :show-inheritance: - -geos_posp.utils.PhysicalConstants module ------------------------------------------ - -.. automodule:: geos_posp.utils.PhysicalConstants - :members: - :undoc-members: - :show-inheritance: - -geos_posp.utils.UnitRepository module -------------------------------------- - -.. automodule:: geos_posp.utils.UnitRepository - :members: - :undoc-members: - :show-inheritance: - - -geos_posp.utils.enumUnits module --------------------------------- - -.. automodule:: geos_posp.utils.enumUnits - :members: - :undoc-members: - :show-inheritance: diff --git a/geos-utils/pyproject.toml b/geos-utils/pyproject.toml index fc32cc914..c30aff5ba 100644 --- a/geos-utils/pyproject.toml +++ b/geos-utils/pyproject.toml @@ -23,9 +23,43 @@ dependencies = [ "numpy", ] +[project.optional-dependencies] +build = [ + "build ~= 1.2" +] +dev = [ + "pylint", + "mypy", + "black", + "sphinx", + "sphinx-rtd-theme", + "sphinx-autodoc-typehints" +] +test = [ + "pytest", + "pytest-cov" +] + + [project.scripts] +[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 = ["pybend"] + + [tool.mypy] python_version = "3.9" warn_return_any = true diff --git a/geos-utils/src/geos_utils/GeosOutputsConstants.py b/geos-utils/src/geos_utils/GeosOutputsConstants.py index 374d3fd75..84771f935 100644 --- a/geos-utils/src/geos_utils/GeosOutputsConstants.py +++ b/geos-utils/src/geos_utils/GeosOutputsConstants.py @@ -8,6 +8,16 @@ __doc__ = """ GeosOutputsConstants module defines usefull constant names such as attribute names, domain names, phase types, and the lists of attribute names to process. + +.. WARNING:: + Names may need to be updated when modifications occur in the GEOS code. + + +.. todo:: + + If possible, link GEOS names directly with GEOS code instead of redefining + them here. + """ #: Phase separator in Geos output log file. diff --git a/geos-utils/src/geos_utils/geosUtils.py b/geos-utils/src/geos_utils/algebraFunctions.py similarity index 100% rename from geos-utils/src/geos_utils/geosUtils.py rename to geos-utils/src/geos_utils/algebraFunctions.py diff --git a/geos-utils/tests/testsFunctionsGeosUtils.py b/geos-utils/tests/testsFunctionsGeosUtils.py index a787e83dd..6c626d382 100644 --- a/geos-utils/tests/testsFunctionsGeosUtils.py +++ b/geos-utils/tests/testsFunctionsGeosUtils.py @@ -15,13 +15,13 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) -import geos_utils.geosUtils as fcts +import geos_utils.algebraFunctions as fcts matrix: npt.NDArray[np.float64] = np.array([[11, 21, 31], [21, 22, 23], [31, 23, 33]]) vector: npt.NDArray[np.float64] = np.array([11, 22, 33, 23, 31, 21]) -class TestsFunctionsGeosUtils(unittest.TestCase): +class TestsFunctionsalgebraFunctions(unittest.TestCase): def test_getAttributeMatrixFromVector(self: Self) -> None: """Test conversion from Matrix to Vector for Geos stress.""" diff --git a/geos-utils/tests/testsGeometryFunctions.py b/geos-utils/tests/testsGeometryFunctions.py index 3f7ddb0b0..92ca82b02 100644 --- a/geos-utils/tests/testsGeometryFunctions.py +++ b/geos-utils/tests/testsGeometryFunctions.py @@ -15,7 +15,7 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) -import geos_posp.processing.geometryFunctions as fcts +import geos_utils.geometryFunctions as fcts basisCanon: tuple[ npt.NDArray[np.float64], npt.NDArray[np.float64], npt.NDArray[np.float64] From ab5f737efdf1b646bb4deba39d9178f78dbf81f0 Mon Sep 17 00:00:00 2001 From: mlemayTTE Date: Thu, 27 Mar 2025 15:06:08 +0100 Subject: [PATCH 06/14] harmonize package organization with existing packages --- geos-utils/src/{geos_utils => geos/utils}/ConnectionSet.py | 0 geos-utils/src/{geos_utils => geos/utils}/GeosOutputsConstants.py | 0 geos-utils/src/{geos_utils => geos/utils}/Logger.py | 0 geos-utils/src/{geos_utils => geos/utils}/PhysicalConstants.py | 0 geos-utils/src/{geos_utils => geos/utils}/UnitRepository.py | 0 geos-utils/src/{geos_utils => geos/utils}/__init__.py | 0 geos-utils/src/{geos_utils => geos/utils}/algebraFunctions.py | 0 geos-utils/src/{geos_utils => geos/utils}/enumUnits.py | 0 geos-utils/src/{geos_utils => geos/utils}/geometryFunctions.py | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename geos-utils/src/{geos_utils => geos/utils}/ConnectionSet.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/GeosOutputsConstants.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/Logger.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/PhysicalConstants.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/UnitRepository.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/__init__.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/algebraFunctions.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/enumUnits.py (100%) rename geos-utils/src/{geos_utils => geos/utils}/geometryFunctions.py (100%) diff --git a/geos-utils/src/geos_utils/ConnectionSet.py b/geos-utils/src/geos/utils/ConnectionSet.py similarity index 100% rename from geos-utils/src/geos_utils/ConnectionSet.py rename to geos-utils/src/geos/utils/ConnectionSet.py diff --git a/geos-utils/src/geos_utils/GeosOutputsConstants.py b/geos-utils/src/geos/utils/GeosOutputsConstants.py similarity index 100% rename from geos-utils/src/geos_utils/GeosOutputsConstants.py rename to geos-utils/src/geos/utils/GeosOutputsConstants.py diff --git a/geos-utils/src/geos_utils/Logger.py b/geos-utils/src/geos/utils/Logger.py similarity index 100% rename from geos-utils/src/geos_utils/Logger.py rename to geos-utils/src/geos/utils/Logger.py diff --git a/geos-utils/src/geos_utils/PhysicalConstants.py b/geos-utils/src/geos/utils/PhysicalConstants.py similarity index 100% rename from geos-utils/src/geos_utils/PhysicalConstants.py rename to geos-utils/src/geos/utils/PhysicalConstants.py diff --git a/geos-utils/src/geos_utils/UnitRepository.py b/geos-utils/src/geos/utils/UnitRepository.py similarity index 100% rename from geos-utils/src/geos_utils/UnitRepository.py rename to geos-utils/src/geos/utils/UnitRepository.py diff --git a/geos-utils/src/geos_utils/__init__.py b/geos-utils/src/geos/utils/__init__.py similarity index 100% rename from geos-utils/src/geos_utils/__init__.py rename to geos-utils/src/geos/utils/__init__.py diff --git a/geos-utils/src/geos_utils/algebraFunctions.py b/geos-utils/src/geos/utils/algebraFunctions.py similarity index 100% rename from geos-utils/src/geos_utils/algebraFunctions.py rename to geos-utils/src/geos/utils/algebraFunctions.py diff --git a/geos-utils/src/geos_utils/enumUnits.py b/geos-utils/src/geos/utils/enumUnits.py similarity index 100% rename from geos-utils/src/geos_utils/enumUnits.py rename to geos-utils/src/geos/utils/enumUnits.py diff --git a/geos-utils/src/geos_utils/geometryFunctions.py b/geos-utils/src/geos/utils/geometryFunctions.py similarity index 100% rename from geos-utils/src/geos_utils/geometryFunctions.py rename to geos-utils/src/geos/utils/geometryFunctions.py From 25c37ca0467613decb617c63ffc43d4bdddda583 Mon Sep 17 00:00:00 2001 From: mlemayTTE Date: Thu, 27 Mar 2025 17:48:23 +0100 Subject: [PATCH 07/14] Update geos-posp dependency to geos-utils --- docs/geos-utils.rst | 32 +++++++++---------- docs/geos_posp_docs/modules.rst | 2 -- geos-posp/pyproject.toml | 7 +--- geos-posp/setup.py | 15 +++++++++ geos-posp/src/PVplugins/PVAttributeMapping.py | 2 +- .../PVCreateConstantAttributePerRegion.py | 2 +- .../PVplugins/PVExtractMergeBlocksVolume.py | 4 +-- .../PVExtractMergeBlocksVolumeSurface.py | 4 +-- .../PVExtractMergeBlocksVolumeSurfaceWell.py | 4 +-- .../PVExtractMergeBlocksVolumeWell.py | 4 +-- .../src/PVplugins/PVGeomechanicsAnalysis.py | 4 +-- .../PVplugins/PVGeomechanicsWorkflowVolume.py | 4 +-- .../PVGeomechanicsWorkflowVolumeSurface.py | 4 +-- ...PVGeomechanicsWorkflowVolumeSurfaceWell.py | 4 +-- .../PVGeomechanicsWorkflowVolumeWell.py | 4 +-- geos-posp/src/PVplugins/PVGeosLogReader.py | 4 +-- .../src/PVplugins/PVMergeBlocksEnhanced.py | 2 +- geos-posp/src/PVplugins/PVMohrCirclePlot.py | 8 ++--- .../src/PVplugins/PVSurfaceGeomechanics.py | 4 +-- .../PVTransferAttributesVolumeSurface.py | 2 +- .../filters/AttributeMappingFromCellCoords.py | 2 +- .../filters/AttributeMappingFromCellId.py | 2 +- .../filters/GeomechanicsCalculator.py | 6 ++-- .../geos_posp/filters/GeosBlockExtractor.py | 4 +-- .../src/geos_posp/filters/GeosBlockMerge.py | 4 +-- .../geos_posp/filters/SurfaceGeomechanics.py | 8 ++--- .../TransferAttributesVolumeSurface.py | 4 +-- .../filters/VolumeSurfaceMeshMapper.py | 6 ++-- .../geomechanicsCalculatorFunctions.py | 4 +-- .../processing/geosLogReaderFunctions.py | 2 +- .../geos_posp/pyvistaTools/pyvistaUtils.py | 2 +- .../readers/GeosLogReaderAquifers.py | 2 +- .../readers/GeosLogReaderConvergence.py | 2 +- .../geos_posp/readers/GeosLogReaderFlow.py | 2 +- .../geos_posp/readers/GeosLogReaderWells.py | 2 +- .../visu/PVUtils/paraviewTreatments.py | 2 +- .../visu/mohrCircles/plotMohrCircles.py | 4 +-- .../visu/pythonViewUtils/Figure2DGenerator.py | 2 +- .../visu/pythonViewUtils/mainPythonView.py | 2 +- .../testsFunctionsGeomechanicsCalculator.py | 6 ++-- .../tests/testsFunctionsGeosLogReader.py | 2 +- .../tests/testsGeosLogReaderConvergence.py | 2 +- geos-posp/tests/testsGeosLogReaderFlow.py | 2 +- geos-posp/tests/testsGeosLogReaderWells.py | 2 +- geos-posp/tests/testsInvalidLogs.py | 2 +- geos-utils/pyproject.toml | 4 +-- geos-utils/src/geos/utils/UnitRepository.py | 2 +- .../src/geos/utils/geometryFunctions.py | 2 +- .../tests/testsCollectionSet.py | 7 +--- geos-utils/tests/testsFunctionsGeosUtils.py | 7 +--- geos-utils/tests/testsGeometryFunctions.py | 7 +--- 51 files changed, 108 insertions(+), 115 deletions(-) create mode 100644 geos-posp/setup.py rename {geos-posp => geos-utils}/tests/testsCollectionSet.py (97%) diff --git a/docs/geos-utils.rst b/docs/geos-utils.rst index cd6e67fbf..d78ed93f4 100644 --- a/docs/geos-utils.rst +++ b/docs/geos-utils.rst @@ -8,66 +8,66 @@ The `geos-utils` python package defines utilities for all GEOS python packages i API ^^^ -geos_utils.ConnectionSet module +geos.utils.ConnectionSet module -------------------------------- -.. automodule:: geos_utils.ConnectionSet +.. automodule:: geos.utils.ConnectionSet :members: :undoc-members: :show-inheritance: -geos_utils.enumUnits module +geos.utils.enumUnits module -------------------------------- -.. automodule:: geos_utils.enumUnits +.. automodule:: geos.utils.enumUnits :members: :undoc-members: :show-inheritance: -geos_utils.geometryFunctions module +geos.utils.geometryFunctions module -------------------------------- -.. automodule:: geos_utils.geometryFunctions +.. automodule:: geos.utils.geometryFunctions :members: :undoc-members: :show-inheritance: -geos_utils.GeosOutputsConstants module +geos.utils.GeosOutputsConstants module ------------------------------------------- -.. automodule:: geos_utils.GeosOutputsConstants +.. automodule:: geos.utils.GeosOutputsConstants :members: :undoc-members: :show-inheritance: -geos_utils.algebraFunctions module +geos.utils.algebraFunctions module ------------------------------------------- -.. automodule:: geos_utils.algebraFunctions +.. automodule:: geos.utils.algebraFunctions :members: :undoc-members: :show-inheritance: -geos_utils.Logger module +geos.utils.Logger module ------------------------------ -.. automodule:: geos_utils.Logger +.. automodule:: geos.utils.Logger :members: :undoc-members: :show-inheritance: -geos_utils.PhysicalConstants module +geos.utils.PhysicalConstants module ----------------------------------------- -.. automodule:: geos_utils.PhysicalConstants +.. automodule:: geos.utils.PhysicalConstants :members: :undoc-members: :show-inheritance: -geos_utils.UnitRepository module +geos.utils.UnitRepository module ------------------------------------- -.. automodule:: geos_utils.UnitRepository +.. automodule:: geos.utils.UnitRepository :members: :undoc-members: :show-inheritance: \ No newline at end of file diff --git a/docs/geos_posp_docs/modules.rst b/docs/geos_posp_docs/modules.rst index 889843d5e..476a7c57c 100644 --- a/docs/geos_posp_docs/modules.rst +++ b/docs/geos_posp_docs/modules.rst @@ -11,5 +11,3 @@ Processing processing pyvistaTools - - utils diff --git a/geos-posp/pyproject.toml b/geos-posp/pyproject.toml index 3bdbbd26a..fe85ebc80 100644 --- a/geos-posp/pyproject.toml +++ b/geos-posp/pyproject.toml @@ -29,12 +29,7 @@ keywords = [ "GEOS", "Simulation", ] -dependencies = [ - "vtk >= 9.3", - "numpy >= 1.26", - "pandas >= 2.2", - "typing_extensions >= 4.12", -] +dynamic = ["dependencies"] requires-python = ">= 3.9" [project.urls] diff --git a/geos-posp/setup.py b/geos-posp/setup.py new file mode 100644 index 000000000..afc06c247 --- /dev/null +++ b/geos-posp/setup.py @@ -0,0 +1,15 @@ +from pathlib import Path +from setuptools import setup + +# This is where you add any fancy path resolution to the local lib: +geos_utils_path: str = (Path(__file__).parent.parent / "geos-utils").as_uri() + +setup( + install_requires=[ + "vtk >= 9.3", + "numpy >= 1.26", + "pandas >= 2.2", + "typing_extensions >= 4.12", + f"geos-utils @ {geos_utils_path}", + ] +) \ No newline at end of file diff --git a/geos-posp/src/PVplugins/PVAttributeMapping.py b/geos-posp/src/PVplugins/PVAttributeMapping.py index c8387acf0..d8234423a 100644 --- a/geos-posp/src/PVplugins/PVAttributeMapping.py +++ b/geos-posp/src/PVplugins/PVAttributeMapping.py @@ -41,7 +41,7 @@ getNumberOfComponents, mergeBlocks, ) -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.Logger import Logger, getLogger from geos_posp.visu.PVUtils.checkboxFunction import ( # type: ignore[attr-defined] createModifiedCallback, ) diff --git a/geos-posp/src/PVplugins/PVCreateConstantAttributePerRegion.py b/geos-posp/src/PVplugins/PVCreateConstantAttributePerRegion.py index 2f948b91f..bb8fbbdf0 100644 --- a/geos-posp/src/PVplugins/PVCreateConstantAttributePerRegion.py +++ b/geos-posp/src/PVplugins/PVCreateConstantAttributePerRegion.py @@ -40,7 +40,7 @@ getBlockFromFlatIndex, ) from geos_posp.processing.vtkUtils import isAttributeInObject -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.Logger import Logger, getLogger __doc__ = """ PVCreateConstantAttributePerRegion is a Paraview plugin that allows to diff --git a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolume.py b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolume.py index 15d06021c..5423bbe90 100644 --- a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolume.py +++ b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolume.py @@ -30,11 +30,11 @@ copyAttribute, createCellCenterAttribute, ) -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.GeosOutputsConstants import ( GeosMeshOutputsEnum, getAttributeToTransferFromInitialTime, ) -from geos_posp.utils.Logger import ERROR, INFO, Logger, getLogger +from geos.utils.Logger import ERROR, INFO, Logger, getLogger from geos_posp.visu.PVUtils.paraviewTreatments import getTimeStepIndex __doc__ = """ diff --git a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurface.py b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurface.py index efb0d2c02..62d35ea48 100644 --- a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurface.py +++ b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurface.py @@ -30,11 +30,11 @@ copyAttribute, createCellCenterAttribute, ) -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.GeosOutputsConstants import ( GeosMeshOutputsEnum, getAttributeToTransferFromInitialTime, ) -from geos_posp.utils.Logger import ERROR, INFO, Logger, getLogger +from geos.utils.Logger import ERROR, INFO, Logger, getLogger from geos_posp.visu.PVUtils.paraviewTreatments import getTimeStepIndex __doc__ = """ diff --git a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurfaceWell.py b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurfaceWell.py index 362c921e4..4ab7010ab 100644 --- a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurfaceWell.py +++ b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurfaceWell.py @@ -30,11 +30,11 @@ copyAttribute, createCellCenterAttribute, ) -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.GeosOutputsConstants import ( GeosMeshOutputsEnum, getAttributeToTransferFromInitialTime, ) -from geos_posp.utils.Logger import ERROR, INFO, Logger, getLogger +from geos.utils.Logger import ERROR, INFO, Logger, getLogger from geos_posp.visu.PVUtils.paraviewTreatments import getTimeStepIndex __doc__ = """ diff --git a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeWell.py b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeWell.py index 28326a21e..2c1c5652c 100644 --- a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeWell.py +++ b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeWell.py @@ -29,11 +29,11 @@ copyAttribute, createCellCenterAttribute, ) -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.GeosOutputsConstants import ( GeosMeshOutputsEnum, getAttributeToTransferFromInitialTime, ) -from geos_posp.utils.Logger import ERROR, INFO, Logger, getLogger +from geos.utils.Logger import ERROR, INFO, Logger, getLogger from geos_posp.visu.PVUtils.paraviewTreatments import getTimeStepIndex __doc__ = """ diff --git a/geos-posp/src/PVplugins/PVGeomechanicsAnalysis.py b/geos-posp/src/PVplugins/PVGeomechanicsAnalysis.py index 7d8662a33..25b6f9d5c 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsAnalysis.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsAnalysis.py @@ -23,8 +23,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_DEG, DEFAULT_GRAIN_BULK_MODULUS, DEFAULT_ROCK_COHESION, diff --git a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolume.py b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolume.py index 62545870c..92c0142a7 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolume.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolume.py @@ -25,8 +25,8 @@ smproxy, ) -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_DEG, DEFAULT_FRICTION_ANGLE_RAD, DEFAULT_GRAIN_BULK_MODULUS, diff --git a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurface.py b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurface.py index e835b1fdd..d498d7673 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurface.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurface.py @@ -26,8 +26,8 @@ smproxy, ) -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_DEG, DEFAULT_FRICTION_ANGLE_RAD, DEFAULT_GRAIN_BULK_MODULUS, diff --git a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurfaceWell.py b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurfaceWell.py index 45334d1d5..bbfdd053c 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurfaceWell.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurfaceWell.py @@ -26,8 +26,8 @@ smproxy, ) -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_DEG, DEFAULT_FRICTION_ANGLE_RAD, DEFAULT_GRAIN_BULK_MODULUS, diff --git a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeWell.py b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeWell.py index 74e722d78..f2c015411 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeWell.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeWell.py @@ -25,8 +25,8 @@ smproxy, ) -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_DEG, DEFAULT_FRICTION_ANGLE_RAD, DEFAULT_GRAIN_BULK_MODULUS, diff --git a/geos-posp/src/PVplugins/PVGeosLogReader.py b/geos-posp/src/PVplugins/PVGeosLogReader.py index b35cb1c6b..a5dd35dd0 100644 --- a/geos-posp/src/PVplugins/PVGeosLogReader.py +++ b/geos-posp/src/PVplugins/PVGeosLogReader.py @@ -42,7 +42,7 @@ from geos_posp.readers.GeosLogReaderConvergence import GeosLogReaderConvergence from geos_posp.readers.GeosLogReaderFlow import GeosLogReaderFlow from geos_posp.readers.GeosLogReaderWells import GeosLogReaderWells -from geos_posp.utils.enumUnits import ( +from geos.utils.enumUnits import ( Mass, MassRate, Pressure, @@ -52,7 +52,7 @@ VolumetricRate, enumerationDomainUnit, ) -from geos_posp.utils.UnitRepository import UnitRepository +from geos.utils.UnitRepository import UnitRepository from geos_posp.visu.PVUtils.checkboxFunction import ( # type: ignore[attr-defined] createModifiedCallback, ) diff --git a/geos-posp/src/PVplugins/PVMergeBlocksEnhanced.py b/geos-posp/src/PVplugins/PVMergeBlocksEnhanced.py index 034bc7dd5..4b8a7c869 100644 --- a/geos-posp/src/PVplugins/PVMergeBlocksEnhanced.py +++ b/geos-posp/src/PVplugins/PVMergeBlocksEnhanced.py @@ -30,7 +30,7 @@ ) from geos_posp.processing.vtkUtils import mergeBlocks -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.Logger import Logger, getLogger __doc__ = """ Merge filter that keep partial attributes using nan values. diff --git a/geos-posp/src/PVplugins/PVMohrCirclePlot.py b/geos-posp/src/PVplugins/PVMohrCirclePlot.py index ca5a438f0..583777c90 100644 --- a/geos-posp/src/PVplugins/PVMohrCirclePlot.py +++ b/geos-posp/src/PVplugins/PVMohrCirclePlot.py @@ -36,13 +36,13 @@ import geos_posp.visu.PVUtils.paraviewTreatments as pvt from geos_posp.processing.MohrCircle import MohrCircle from geos_posp.processing.vtkUtils import getArrayInObject, mergeBlocks -from geos_posp.utils.enumUnits import Pressure, enumerationDomainUnit -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.enumUnits import Pressure, enumerationDomainUnit +from geos.utils.GeosOutputsConstants import ( FAILURE_ENVELOPE, GeosMeshOutputsEnum, ) -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_DEG, DEFAULT_FRICTION_ANGLE_RAD, DEFAULT_ROCK_COHESION, diff --git a/geos-posp/src/PVplugins/PVSurfaceGeomechanics.py b/geos-posp/src/PVplugins/PVSurfaceGeomechanics.py index b789e900f..2ff1b4f5f 100644 --- a/geos-posp/src/PVplugins/PVSurfaceGeomechanics.py +++ b/geos-posp/src/PVplugins/PVSurfaceGeomechanics.py @@ -36,8 +36,8 @@ getBlockElementIndexesFlatten, getBlockFromFlatIndex, ) -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_DEG, DEFAULT_ROCK_COHESION, ) diff --git a/geos-posp/src/PVplugins/PVTransferAttributesVolumeSurface.py b/geos-posp/src/PVplugins/PVTransferAttributesVolumeSurface.py index 9ecd7a15e..2bc6e1ca1 100644 --- a/geos-posp/src/PVplugins/PVTransferAttributesVolumeSurface.py +++ b/geos-posp/src/PVplugins/PVTransferAttributesVolumeSurface.py @@ -48,7 +48,7 @@ getBlockFromFlatIndex, ) from geos_posp.processing.vtkUtils import getAttributeSet, mergeBlocks -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.Logger import Logger, getLogger from geos_posp.visu.PVUtils.checkboxFunction import ( # type: ignore[attr-defined] createModifiedCallback, ) diff --git a/geos-posp/src/geos_posp/filters/AttributeMappingFromCellCoords.py b/geos-posp/src/geos_posp/filters/AttributeMappingFromCellCoords.py index a89337659..2ebc17e45 100644 --- a/geos-posp/src/geos_posp/filters/AttributeMappingFromCellCoords.py +++ b/geos-posp/src/geos_posp/filters/AttributeMappingFromCellCoords.py @@ -26,7 +26,7 @@ createEmptyAttribute, getVtkArrayInObject, ) -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.Logger import Logger, getLogger __doc__ = """ AttributeMappingFromCellCoords module is a vtk filter that map two identical mesh (or a mesh is diff --git a/geos-posp/src/geos_posp/filters/AttributeMappingFromCellId.py b/geos-posp/src/geos_posp/filters/AttributeMappingFromCellId.py index 6e28bb3f6..4e267853d 100644 --- a/geos-posp/src/geos_posp/filters/AttributeMappingFromCellId.py +++ b/geos-posp/src/geos_posp/filters/AttributeMappingFromCellId.py @@ -10,7 +10,7 @@ from vtkmodules.vtkCommonDataModel import vtkUnstructuredGrid from geos_posp.processing.vtkUtils import createAttribute, getArrayInObject -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.Logger import Logger, getLogger __doc__ = """ AttributeMappingFromCellId module is a vtk filter that transfer a attribute from a diff --git a/geos-posp/src/geos_posp/filters/GeomechanicsCalculator.py b/geos-posp/src/geos_posp/filters/GeomechanicsCalculator.py index 0f8e9ba1c..f376a661f 100644 --- a/geos-posp/src/geos_posp/filters/GeomechanicsCalculator.py +++ b/geos-posp/src/geos_posp/filters/GeomechanicsCalculator.py @@ -23,14 +23,14 @@ getComponentNames, isAttributeInObject, ) -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.GeosOutputsConstants import ( AttributeEnum, ComponentNameEnum, GeosMeshOutputsEnum, PostProcessingOutputsEnum, ) -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_RAD, DEFAULT_GRAIN_BULK_MODULUS, DEFAULT_ROCK_COHESION, diff --git a/geos-posp/src/geos_posp/filters/GeosBlockExtractor.py b/geos-posp/src/geos_posp/filters/GeosBlockExtractor.py index 1718bc3a0..26cab3bc0 100644 --- a/geos-posp/src/geos_posp/filters/GeosBlockExtractor.py +++ b/geos-posp/src/geos_posp/filters/GeosBlockExtractor.py @@ -10,11 +10,11 @@ getBlockIndexFromName, ) from geos_posp.processing.vtkUtils import extractBlock -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.GeosOutputsConstants import ( GeosDomainNameEnum, OutputObjectEnum, ) -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.Logger import Logger, getLogger __doc__ = """ GeosBlockExtractor module is a vtk filter that allows to extract Volume mesh, diff --git a/geos-posp/src/geos_posp/filters/GeosBlockMerge.py b/geos-posp/src/geos_posp/filters/GeosBlockMerge.py index 4cf51346c..3d3589956 100644 --- a/geos-posp/src/geos_posp/filters/GeosBlockMerge.py +++ b/geos-posp/src/geos_posp/filters/GeosBlockMerge.py @@ -35,14 +35,14 @@ getAttributeSet, mergeBlocks, ) -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.GeosOutputsConstants import ( PHASE_SEP, FluidPrefixEnum, PhaseTypeEnum, PostProcessingOutputsEnum, getRockSuffixRenaming, ) -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.Logger import Logger, getLogger __doc__ = """ GeosBlockMerge module is a vtk filter that allows to merge Geos ranks, rename diff --git a/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py b/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py index d1e2d8a9c..2dbd3ddde 100644 --- a/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py +++ b/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py @@ -25,18 +25,18 @@ getAttributeSet, isAttributeInObject, ) -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.GeosOutputsConstants import ( ComponentNameEnum, GeosMeshOutputsEnum, PostProcessingOutputsEnum, getAttributeToConvertFromLocalToXYZ, ) -from geos_posp.utils.geosUtils import ( +from geos.utils.algebraFunctions import ( getAttributeMatrixFromVector, getAttributeVectorFromMatrix, ) -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_RAD, DEFAULT_ROCK_COHESION, ) diff --git a/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py b/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py index 69324083d..c18652745 100644 --- a/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py +++ b/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py @@ -22,8 +22,8 @@ getComponentNames, isAttributeInObject, ) -from geos_posp.utils.GeosOutputsConstants import GeosMeshSuffixEnum -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.GeosOutputsConstants import GeosMeshSuffixEnum +from geos.utils.Logger import Logger, getLogger __doc__ = """ TransferAttributesVolumeSurface is a vtk filter that allows to transfer volume diff --git a/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py b/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py index 8fe51316f..9ddd9a3f7 100644 --- a/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py +++ b/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py @@ -24,9 +24,9 @@ ConnectionSetCollection, ) from geos_posp.processing.geometryFunctions import getCellSideAgainstPlane -from geos_posp.utils.GeosOutputsConstants import PostProcessingOutputsEnum -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.GeosOutputsConstants import PostProcessingOutputsEnum +from geos.utils.Logger import Logger, getLogger +from geos.utils.PhysicalConstants import ( EPSILON, ) diff --git a/geos-posp/src/geos_posp/processing/geomechanicsCalculatorFunctions.py b/geos-posp/src/geos_posp/processing/geomechanicsCalculatorFunctions.py index e50cadd8f..c1f700d0b 100644 --- a/geos-posp/src/geos_posp/processing/geomechanicsCalculatorFunctions.py +++ b/geos-posp/src/geos_posp/processing/geomechanicsCalculatorFunctions.py @@ -5,8 +5,8 @@ import numpy.typing as npt from geos_posp.processing.MohrCoulomb import MohrCoulomb -from geos_posp.utils.geosUtils import getAttributeMatrixFromVector -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.algebraFunctions import getAttributeMatrixFromVector +from geos.utils.PhysicalConstants import ( EPSILON, ) diff --git a/geos-posp/src/geos_posp/processing/geosLogReaderFunctions.py b/geos-posp/src/geos_posp/processing/geosLogReaderFunctions.py index fc708a3ee..888629f21 100644 --- a/geos-posp/src/geos_posp/processing/geosLogReaderFunctions.py +++ b/geos-posp/src/geos_posp/processing/geosLogReaderFunctions.py @@ -7,7 +7,7 @@ from copy import deepcopy from typing import Any, Union -from geos_posp.utils.enumUnits import Unit, convert +from geos.utils.enumUnits import Unit, convert __doc__ = """Functions to read and process Geos log.""" diff --git a/geos-posp/src/geos_posp/pyvistaTools/pyvistaUtils.py b/geos-posp/src/geos_posp/pyvistaTools/pyvistaUtils.py index 9849fbf17..7370d276b 100644 --- a/geos-posp/src/geos_posp/pyvistaTools/pyvistaUtils.py +++ b/geos-posp/src/geos_posp/pyvistaTools/pyvistaUtils.py @@ -14,7 +14,7 @@ ) import geos_posp.processing.vtkUtils as vtkUtils -from geos_posp.utils.GeosOutputsConstants import GeosDomainNameEnum +from geos.utils.GeosOutputsConstants import GeosDomainNameEnum __doc__ = r""" This module contains utilities to process meshes using pyvista. diff --git a/geos-posp/src/geos_posp/readers/GeosLogReaderAquifers.py b/geos-posp/src/geos_posp/readers/GeosLogReaderAquifers.py index d1ed0a884..044108132 100644 --- a/geos-posp/src/geos_posp/readers/GeosLogReaderAquifers.py +++ b/geos-posp/src/geos_posp/readers/GeosLogReaderAquifers.py @@ -7,7 +7,7 @@ from typing_extensions import Self import geos_posp.processing.geosLogReaderFunctions as fcts -from geos_posp.utils.enumUnits import Unit +from geos.utils.enumUnits import Unit class GeosLogReaderAquifers: diff --git a/geos-posp/src/geos_posp/readers/GeosLogReaderConvergence.py b/geos-posp/src/geos_posp/readers/GeosLogReaderConvergence.py index 50abc4320..4b2a596f7 100644 --- a/geos-posp/src/geos_posp/readers/GeosLogReaderConvergence.py +++ b/geos-posp/src/geos_posp/readers/GeosLogReaderConvergence.py @@ -7,7 +7,7 @@ from typing_extensions import Self import geos_posp.processing.geosLogReaderFunctions as fcts -from geos_posp.utils.enumUnits import Unit +from geos.utils.enumUnits import Unit class GeosLogReaderConvergence: diff --git a/geos-posp/src/geos_posp/readers/GeosLogReaderFlow.py b/geos-posp/src/geos_posp/readers/GeosLogReaderFlow.py index 506cf736a..5375e1cc7 100644 --- a/geos-posp/src/geos_posp/readers/GeosLogReaderFlow.py +++ b/geos-posp/src/geos_posp/readers/GeosLogReaderFlow.py @@ -8,7 +8,7 @@ from typing_extensions import Self import geos_posp.processing.geosLogReaderFunctions as fcts -from geos_posp.utils.enumUnits import Unit +from geos.utils.enumUnits import Unit class GeosLogReaderFlow: diff --git a/geos-posp/src/geos_posp/readers/GeosLogReaderWells.py b/geos-posp/src/geos_posp/readers/GeosLogReaderWells.py index af420e306..dec99ed28 100644 --- a/geos-posp/src/geos_posp/readers/GeosLogReaderWells.py +++ b/geos-posp/src/geos_posp/readers/GeosLogReaderWells.py @@ -8,7 +8,7 @@ from typing_extensions import Self import geos_posp.processing.geosLogReaderFunctions as fcts -from geos_posp.utils.enumUnits import Unit +from geos.utils.enumUnits import Unit class GeosLogReaderWells: diff --git a/geos-posp/src/geos_posp/visu/PVUtils/paraviewTreatments.py b/geos-posp/src/geos_posp/visu/PVUtils/paraviewTreatments.py index 7de0995ba..6d4c4b639 100644 --- a/geos-posp/src/geos_posp/visu/PVUtils/paraviewTreatments.py +++ b/geos-posp/src/geos_posp/visu/PVUtils/paraviewTreatments.py @@ -38,7 +38,7 @@ getArrayInObject, isAttributeInObject, ) -from geos_posp.utils.GeosOutputsConstants import ( +from geos.utils.GeosOutputsConstants import ( ComponentNameEnum, GeosMeshOutputsEnum, ) diff --git a/geos-posp/src/geos_posp/visu/mohrCircles/plotMohrCircles.py b/geos-posp/src/geos_posp/visu/mohrCircles/plotMohrCircles.py index c3a19d117..29257aa86 100644 --- a/geos-posp/src/geos_posp/visu/mohrCircles/plotMohrCircles.py +++ b/geos-posp/src/geos_posp/visu/mohrCircles/plotMohrCircles.py @@ -14,8 +14,8 @@ import geos_posp.visu.mohrCircles.functionsMohrCircle as mcf from geos_posp.processing.MohrCircle import MohrCircle from geos_posp.processing.MohrCoulomb import MohrCoulomb -from geos_posp.utils.enumUnits import Pressure, Unit, convert -from geos_posp.utils.GeosOutputsConstants import FAILURE_ENVELOPE +from geos.utils.enumUnits import Pressure, Unit, convert +from geos.utils.GeosOutputsConstants import FAILURE_ENVELOPE from geos_posp.visu.PVUtils.matplotlibOptions import ( FontStyleEnum, FontWeightEnum, diff --git a/geos-posp/src/geos_posp/visu/pythonViewUtils/Figure2DGenerator.py b/geos-posp/src/geos_posp/visu/pythonViewUtils/Figure2DGenerator.py index b585922a8..1233e6163 100644 --- a/geos-posp/src/geos_posp/visu/pythonViewUtils/Figure2DGenerator.py +++ b/geos-posp/src/geos_posp/visu/pythonViewUtils/Figure2DGenerator.py @@ -12,7 +12,7 @@ from typing_extensions import Self import geos_posp.visu.pythonViewUtils.functionsFigure2DGenerator as fcts -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.Logger import Logger, getLogger class Figure2DGenerator: diff --git a/geos-posp/src/geos_posp/visu/pythonViewUtils/mainPythonView.py b/geos-posp/src/geos_posp/visu/pythonViewUtils/mainPythonView.py index e211c72a8..b973f66ab 100644 --- a/geos-posp/src/geos_posp/visu/pythonViewUtils/mainPythonView.py +++ b/geos-posp/src/geos_posp/visu/pythonViewUtils/mainPythonView.py @@ -34,7 +34,7 @@ def render(view, width: int, height: int): # noqa return imageToReturn except Exception as e: - from geos_posp.utils.Logger import getLogger + from geos.utils.Logger import getLogger logger = getLogger("Python View Configurator") logger.critical(e, exc_info=True) diff --git a/geos-posp/tests/testsFunctionsGeomechanicsCalculator.py b/geos-posp/tests/testsFunctionsGeomechanicsCalculator.py index 9a8b2ead7..fcad9e0d2 100644 --- a/geos-posp/tests/testsFunctionsGeomechanicsCalculator.py +++ b/geos-posp/tests/testsFunctionsGeomechanicsCalculator.py @@ -18,9 +18,9 @@ sys.path.append(parent_dir_path) import geos_posp.processing.geomechanicsCalculatorFunctions as fcts -from geos_posp.utils import PhysicalConstants -from geos_posp.utils.geosUtils import getAttributeMatrixFromVector -from geos_posp.utils.UnitRepository import Unit, UnitRepository +from geos.utils import PhysicalConstants +from geos.utils.algebraFunctions import getAttributeMatrixFromVector +from geos.utils.UnitRepository import Unit, UnitRepository # geomechanical outputs - Testing variables - Unit is GPa bulkModulus: npt.NDArray[np.float64] = np.array([9.0, 50.0, 65.0, np.nan, 150.0]) diff --git a/geos-posp/tests/testsFunctionsGeosLogReader.py b/geos-posp/tests/testsFunctionsGeosLogReader.py index 1f3ac1a7e..78f68c48c 100644 --- a/geos-posp/tests/testsFunctionsGeosLogReader.py +++ b/geos-posp/tests/testsFunctionsGeosLogReader.py @@ -16,7 +16,7 @@ sys.path.append(parent_dir_path) from geos_posp.processing import geosLogReaderFunctions as utils -from geos_posp.utils.enumUnits import Unit, getSIUnits +from geos.utils.enumUnits import Unit, getSIUnits class TestsFunctionsGeosLogReader(unittest.TestCase): diff --git a/geos-posp/tests/testsGeosLogReaderConvergence.py b/geos-posp/tests/testsGeosLogReaderConvergence.py index b3d8e7ed6..803ee2441 100644 --- a/geos-posp/tests/testsGeosLogReaderConvergence.py +++ b/geos-posp/tests/testsGeosLogReaderConvergence.py @@ -15,7 +15,7 @@ sys.path.append(parent_dir_path) from geos_posp.readers.GeosLogReaderConvergence import GeosLogReaderConvergence -from geos_posp.utils.UnitRepository import Unit, UnitRepository +from geos.utils.UnitRepository import Unit, UnitRepository unitsObjSI: UnitRepository = UnitRepository() conversionFactors: dict[str, Unit] = unitsObjSI.getPropertiesUnit() diff --git a/geos-posp/tests/testsGeosLogReaderFlow.py b/geos-posp/tests/testsGeosLogReaderFlow.py index f8749fc9e..dc56540f2 100644 --- a/geos-posp/tests/testsGeosLogReaderFlow.py +++ b/geos-posp/tests/testsGeosLogReaderFlow.py @@ -17,7 +17,7 @@ sys.path.append(parent_dir_path) from geos_posp.readers.GeosLogReaderFlow import GeosLogReaderFlow -from geos_posp.utils.UnitRepository import Unit, UnitRepository +from geos.utils.UnitRepository import Unit, UnitRepository unitsObjSI: UnitRepository = UnitRepository() conversionFactors: dict[str, Unit] = unitsObjSI.getPropertiesUnit() diff --git a/geos-posp/tests/testsGeosLogReaderWells.py b/geos-posp/tests/testsGeosLogReaderWells.py index ba8c31138..bcc8a4647 100644 --- a/geos-posp/tests/testsGeosLogReaderWells.py +++ b/geos-posp/tests/testsGeosLogReaderWells.py @@ -18,7 +18,7 @@ import pandas as pd # type: ignore[import-untyped] from geos_posp.readers.GeosLogReaderWells import GeosLogReaderWells -from geos_posp.utils.UnitRepository import Unit, UnitRepository +from geos.utils.UnitRepository import Unit, UnitRepository unitsObjSI = UnitRepository() conversionFactors: dict[str, Unit] = unitsObjSI.getPropertiesUnit() diff --git a/geos-posp/tests/testsInvalidLogs.py b/geos-posp/tests/testsInvalidLogs.py index dd2bbb571..1f6621fa8 100644 --- a/geos-posp/tests/testsInvalidLogs.py +++ b/geos-posp/tests/testsInvalidLogs.py @@ -19,7 +19,7 @@ from geos_posp.readers.GeosLogReaderConvergence import GeosLogReaderConvergence from geos_posp.readers.GeosLogReaderFlow import GeosLogReaderFlow from geos_posp.readers.GeosLogReaderWells import GeosLogReaderWells -from geos_posp.utils.UnitRepository import Unit, UnitRepository +from geos.utils.UnitRepository import Unit, UnitRepository unitsObjSI: UnitRepository = UnitRepository() conversionFactors: dict[str, Unit] = unitsObjSI.getPropertiesUnit() diff --git a/geos-utils/pyproject.toml b/geos-utils/pyproject.toml index c30aff5ba..742cce764 100644 --- a/geos-utils/pyproject.toml +++ b/geos-utils/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel"] +requires = ["setuptools>=61.2"] build-backend = "setuptools.build_meta" [project] @@ -57,7 +57,7 @@ filterwarnings = [] [tool.coverage.run] branch = true -source = ["pybend"] +source = ["geos/utils"] [tool.mypy] diff --git a/geos-utils/src/geos/utils/UnitRepository.py b/geos-utils/src/geos/utils/UnitRepository.py index 83f737f5f..2f53d35e9 100644 --- a/geos-utils/src/geos/utils/UnitRepository.py +++ b/geos-utils/src/geos/utils/UnitRepository.py @@ -6,7 +6,7 @@ from typing_extensions import Self -from geos_utils.enumUnits import Unit, getPropertyUnitEnum, getSIUnits +from geos.utils.enumUnits import Unit, getPropertyUnitEnum, getSIUnits class UnitRepository: diff --git a/geos-utils/src/geos/utils/geometryFunctions.py b/geos-utils/src/geos/utils/geometryFunctions.py index f46b72888..4614ac673 100644 --- a/geos-utils/src/geos/utils/geometryFunctions.py +++ b/geos-utils/src/geos/utils/geometryFunctions.py @@ -4,7 +4,7 @@ import numpy as np import numpy.typing as npt -from geos_utils.PhysicalConstants import EPSILON +from geos.utils.PhysicalConstants import EPSILON __doc__ = """Functions to permform geometry calculations.""" diff --git a/geos-posp/tests/testsCollectionSet.py b/geos-utils/tests/testsCollectionSet.py similarity index 97% rename from geos-posp/tests/testsCollectionSet.py rename to geos-utils/tests/testsCollectionSet.py index ef7f108de..c1ae4b73b 100644 --- a/geos-posp/tests/testsCollectionSet.py +++ b/geos-utils/tests/testsCollectionSet.py @@ -8,12 +8,7 @@ from typing_extensions import Self -dir_path = os.path.dirname(os.path.realpath(__file__)) -parent_dir_path = os.path.join(os.path.dirname(dir_path), "src") -if parent_dir_path not in sys.path: - sys.path.append(parent_dir_path) - -from geos_posp.processing.ConnectionSet import ( +from geos.utils.ConnectionSet import ( ConnectionSet, ConnectionSetCollection, ) diff --git a/geos-utils/tests/testsFunctionsGeosUtils.py b/geos-utils/tests/testsFunctionsGeosUtils.py index 6c626d382..933f02ad0 100644 --- a/geos-utils/tests/testsFunctionsGeosUtils.py +++ b/geos-utils/tests/testsFunctionsGeosUtils.py @@ -10,12 +10,7 @@ import numpy.typing as npt from typing_extensions import Self -dir_path = os.path.dirname(os.path.realpath(__file__)) -parent_dir_path = os.path.join(os.path.dirname(dir_path), "src") -if parent_dir_path not in sys.path: - sys.path.append(parent_dir_path) - -import geos_utils.algebraFunctions as fcts +import geos.utils.algebraFunctions as fcts matrix: npt.NDArray[np.float64] = np.array([[11, 21, 31], [21, 22, 23], [31, 23, 33]]) vector: npt.NDArray[np.float64] = np.array([11, 22, 33, 23, 31, 21]) diff --git a/geos-utils/tests/testsGeometryFunctions.py b/geos-utils/tests/testsGeometryFunctions.py index 92ca82b02..c1f04993a 100644 --- a/geos-utils/tests/testsGeometryFunctions.py +++ b/geos-utils/tests/testsGeometryFunctions.py @@ -10,12 +10,7 @@ import numpy.typing as npt from typing_extensions import Self -dir_path = os.path.dirname(os.path.realpath(__file__)) -parent_dir_path = os.path.join(os.path.dirname(dir_path), "src") -if parent_dir_path not in sys.path: - sys.path.append(parent_dir_path) - -import geos_utils.geometryFunctions as fcts +import geos.utils.geometryFunctions as fcts basisCanon: tuple[ npt.NDArray[np.float64], npt.NDArray[np.float64], npt.NDArray[np.float64] From 67df57d8efb1691d1f68c37bc083156c8ac261b4 Mon Sep 17 00:00:00 2001 From: mlemayTTE Date: Thu, 27 Mar 2025 17:56:40 +0100 Subject: [PATCH 08/14] fix doc --- docs/conf.py | 4 ++-- docs/geos-utils.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index a6dd5d054..dfcbb8abc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,8 +17,8 @@ # Add python modules to be documented python_root = '..' -python_modules = ( 'geos-ats', 'geos-mesh', 'geos-posp', 'geos-timehistory', 'geos-xml-tools', 'hdf5-wrapper', - 'pygeos-tools' ) +python_modules = ( 'geos-ats', 'geos-mesh', 'geos-posp', 'geos-timehistory', 'geos-utils', 'geos-xml-tools', + 'hdf5-wrapper', 'pygeos-tools' ) for m in python_modules: sys.path.insert( 0, os.path.abspath( os.path.join( python_root, m, 'src' ) ) ) diff --git a/docs/geos-utils.rst b/docs/geos-utils.rst index d78ed93f4..5f59ddd83 100644 --- a/docs/geos-utils.rst +++ b/docs/geos-utils.rst @@ -25,7 +25,7 @@ geos.utils.enumUnits module :show-inheritance: geos.utils.geometryFunctions module --------------------------------- +------------------------------------ .. automodule:: geos.utils.geometryFunctions :members: From c70b92100688cfa63fc3759abd28a5d59ef69dea Mon Sep 17 00:00:00 2001 From: mlemayTTE Date: Thu, 27 Mar 2025 18:06:25 +0100 Subject: [PATCH 09/14] Update installation doc --- README.md | 76 ++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index d44e858a7..1f9a02a60 100644 --- a/README.md +++ b/README.md @@ -19,49 +19,34 @@ Package summary The next packages are dedicated to pre- and post-process GEOS inputs/outputs. - The following packages contain basic utilities used by the other ones: +The following packages contain basic utilities used by the other ones: - * `geos-utils`: basic utilities - * `geos-geomecanics`: geomechanics functions and data model +* `geos-utils`: basic utilities +* `geos-geomecanics`: geomechanics functions and data model - The following packages define data models, vtk filters, and user-oriented API: +The following packages define data models, vtk filters, and user-oriented API: - * `geos-xml-tools`: xml reader and writer dedicated to GEOS xml file - * `hdf5-wrapper`: wrapper to load hdf5 files - * `geos-mesh`: general mesh processing tools - * `geos-prep`: GEOS pre-processing tools - * `geos-posp`: GEOS post-processing tools - +* `geos-xml-tools`: xml reader and writer dedicated to GEOS xml file +* `hdf5-wrapper`: wrapper to load hdf5 files +* `geos-mesh`: general mesh processing tools +* `geos-prep`: GEOS pre-processing tools +* `geos-posp`: GEOS post-processing tools - The following packages define hands-on executables that can be used through the command line: - * `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/)) +The following packages define hands-on executables that can be used through the command line: +* `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/)) - The following package defines [Paraview](https://docs.paraview.org/) plugins that wrap GEOS Python tools - * `geos-pv` +The following package defines [Paraview](https://docs.paraview.org/) plugins that wrap GEOS Python tools +* `geos-pv` -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. - - -Installation -------------- - -* *Automatic installation for GEOS developpers:* - - GEOS Python packages can be automatically installed after having build GEOS by running `make geosx_python_tools` in the GEOS build directory. - -* *Manual installation:* - - GEOS Python packages can be manually installed with pip using `python` >= 3.10. In this case, pay attention to package inter-dependencies. Start by installing the basic utilities, then the api and vtk filters, and finally the top level executables. - - GEOS Python packages dependency tree (inter-dependency and main external dependencies) is the following: +GEOS Python packages dependency tree (inter-dependency and main external dependencies) is the following: ``` |-- geos-ats @@ -113,26 +98,37 @@ Installation |-- paraview ``` - For the complete installation of GEOS pre- and post-processing packages, run the following commands from the geosPythonPackage directory: +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. + + +Installation +------------- + +* *Automatic installation for GEOS developpers:* + + GEOS Python packages can be automatically installed after having build GEOS by running `make geosx_python_tools` in the GEOS build directory. + +* *Manual installation:* + + GEOS Python packages can be manually installed with pip using `python` >= 3.10. + + To install any package, run the following commands from the geosPythonPackage directory: ``` python -m venv .venv source .venv/bin/activate python -m pip install --upgrade pip - python -m pip install ./geos-utils - python -m pip install ./geos-geomechanics ./time-history ./geos-xml-tools ./geos-mesh - python -m pip install ./geos-prep ./geos-posp - python -m pip install ./time-history ./mesh-doctor ./geos-xml-viewer ./mesh-doctor + python -m pip install ./ ``` - You can test the installation by running the commands: + You can test installed package by running the commands: ``` python -m pip install pytest - python -m pytest ./* + python -m pytest ./ ``` -**NOTE: geos-pv package cannot be build alone, but together with Paraview ([see Paraview compilation guide](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Documentation/dev/build.md)). It is recommended to use Paraview v5.12+, which is based on python 3.10+. Alternatievly, plugins from geos-pv/PVplugins can be manually loaded into Paraview ([see documentation](https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html#python-algorithm)).** +**NOTE: geos-pv package cannot be build alone, but together with Paraview ([see Paraview compilation guide](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Documentation/dev/build.md)). It is recommended to use Paraview v5.12+, which is based on python 3.10+. Alternatively, plugins from geos-pv/PVplugins can be manually loaded into Paraview ([see documentation](https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html#python-algorithm)).** Contributions From 713052bc0cd0b83f5835df7fe766fb4ca1f75fc6 Mon Sep 17 00:00:00 2001 From: mlemayTTE Date: Thu, 27 Mar 2025 18:29:23 +0100 Subject: [PATCH 10/14] Update package dependency config instructions --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 1f9a02a60..f98d35096 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,43 @@ If you would like to contribute to GEOS Python packages, please respect the foll If you do not have the rights to push the code and open new PRs, consider opening a new issue to explain what you want to do and ask for the dev rights. +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 +``` + +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_path: str = (Path(__file__).parent.parent / "package2").as_uri() + + setup( + install_requires=[ + "external_packageX", + "external_packageY", + f"package2 @ {package_path}", + ] + ) + ``` + Release ------- From f62e1fe01f6fc8460939dbad86c505bf53bf8ed1 Mon Sep 17 00:00:00 2001 From: mlemayTTE Date: Fri, 28 Mar 2025 10:30:35 +0100 Subject: [PATCH 11/14] Update doc requirements --- docs/requirements.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 19ab47d37..13622ed11 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,3 @@ -pandas sphinx >= 7.4.7 sphinx_rtd_theme sphinx-argparse >= 0.5.2 @@ -6,8 +5,14 @@ sphinx-autodoc-typehints sphinx-design # Running CLI programs and capture outputs sphinxcontrib-programoutput>=0.17 -# Installing the mesh_doctor requirements to be able to load all the modules and run the help. +# Installing all package requirements to be able to load all the modules and run the help. vtk >= 9.1 networkx >= 2.4 tqdm numpy +pandas +typing_extensions +matplotlib>=3.9.4 +h5py +lxml>=4.5.0 +parameterized From ecbced6aa21f5cc2ad4d5d18e5a73926c957d78d Mon Sep 17 00:00:00 2001 From: Martin LEMAY Date: Fri, 28 Mar 2025 10:44:43 +0100 Subject: [PATCH 12/14] update geos_posp import and doc --- docs/geos_posp_docs/processing.rst | 16 ---------------- .../src/geos_posp/filters/SurfaceGeomechanics.py | 2 +- .../filters/TransferAttributesVolumeSurface.py | 2 +- .../geos_posp/filters/VolumeSurfaceMeshMapper.py | 4 ++-- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/docs/geos_posp_docs/processing.rst b/docs/geos_posp_docs/processing.rst index 65d6e83dc..9da336b9e 100644 --- a/docs/geos_posp_docs/processing.rst +++ b/docs/geos_posp_docs/processing.rst @@ -4,14 +4,6 @@ Processing functions This package define functions to process data. -geos_posp.processing.ConnectionSet module ---------------------------------------------- - -.. automodule:: geos_posp.processing.ConnectionSet - :members: - :undoc-members: - :show-inheritance: - geos_posp.processing.geomechanicsCalculatorFunctions module --------------------------------------------------------------- @@ -20,14 +12,6 @@ geos_posp.processing.geomechanicsCalculatorFunctions module :undoc-members: :show-inheritance: -geos_posp.processing.geometryFunctions module -------------------------------------------------- - -.. automodule:: geos_posp.processing.geometryFunctions - :members: - :undoc-members: - :show-inheritance: - geos_posp.processing.geosLogReaderFunctions module ------------------------------------------------------ diff --git a/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py b/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py index 2dbd3ddde..2c541469d 100644 --- a/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py +++ b/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py @@ -18,13 +18,13 @@ ) import geos_posp.processing.geomechanicsCalculatorFunctions as fcts -import geos_posp.processing.geometryFunctions as geom from geos_posp.processing.vtkUtils import ( createAttribute, getArrayInObject, getAttributeSet, isAttributeInObject, ) +import geos.utils.geometryFunctions as geom from geos.utils.GeosOutputsConstants import ( ComponentNameEnum, GeosMeshOutputsEnum, diff --git a/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py b/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py index c18652745..072dcca8f 100644 --- a/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py +++ b/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py @@ -16,12 +16,12 @@ from vtkmodules.vtkCommonDataModel import vtkPolyData, vtkUnstructuredGrid from geos_posp.filters.VolumeSurfaceMeshMapper import VolumeSurfaceMeshMapper -from geos_posp.processing.ConnectionSet import ConnectionSetCollection from geos_posp.processing.vtkUtils import ( getArrayInObject, getComponentNames, isAttributeInObject, ) +from geos.utils.ConnectionSet import ConnectionSetCollection from geos.utils.GeosOutputsConstants import GeosMeshSuffixEnum from geos.utils.Logger import Logger, getLogger diff --git a/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py b/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py index 9ddd9a3f7..2dabcadea 100644 --- a/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py +++ b/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py @@ -19,11 +19,11 @@ ) from vtkmodules.vtkCommonDataModel import vtkPolyData, vtkUnstructuredGrid -from geos_posp.processing.ConnectionSet import ( +from geos.utils.ConnectionSet import ( ConnectionSet, ConnectionSetCollection, ) -from geos_posp.processing.geometryFunctions import getCellSideAgainstPlane +from geos.utils.geometryFunctions import getCellSideAgainstPlane from geos.utils.GeosOutputsConstants import PostProcessingOutputsEnum from geos.utils.Logger import Logger, getLogger from geos.utils.PhysicalConstants import ( From 3c59dbb0dc04a000ffcb0d92cfdc5935f36d3a99 Mon Sep 17 00:00:00 2001 From: Martin LEMAY Date: Fri, 28 Mar 2025 10:48:53 +0100 Subject: [PATCH 13/14] add pyvista in doc requirements --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 13622ed11..773420cf0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -16,3 +16,4 @@ matplotlib>=3.9.4 h5py lxml>=4.5.0 parameterized +pyvista From 140551b333452873145db6a47ca060f2a4f8d142 Mon Sep 17 00:00:00 2001 From: Martin LEMAY Date: Fri, 28 Mar 2025 11:10:32 +0100 Subject: [PATCH 14/14] fix doc issues --- docs/conf.py | 2 +- docs/geos_posp_docs/visu.mohrCircles.rst | 8 -------- docs/geos_posp_docs/visu.pythonViewUtils.rst | 8 -------- docs/index.rst | 2 ++ 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index dfcbb8abc..8e22d041d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -72,7 +72,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path . -exclude_patterns = [ u'_build', 'Thumbs.db', '.DS_Store', 'cmake/*' ] +exclude_patterns = [ u'_build', 'Thumbs.db', '.DS_Store', 'cmake/*', '' ] todo_include_todos = True diff --git a/docs/geos_posp_docs/visu.mohrCircles.rst b/docs/geos_posp_docs/visu.mohrCircles.rst index 988e4c4ca..30e9a7216 100644 --- a/docs/geos_posp_docs/visu.mohrCircles.rst +++ b/docs/geos_posp_docs/visu.mohrCircles.rst @@ -11,14 +11,6 @@ geos_posp.visu.mohrCircles.functionsMohrCircle module :undoc-members: :show-inheritance: -geos_posp.visu.mohrCircles.mainMohrCircles module ----------------------------------------------------- - -.. automodule:: geos_posp.visu.mohrCircles.mainMohrCircles - :members: - :undoc-members: - :show-inheritance: - geos_posp.visu.mohrCircles.plotMohrCircles module -------------------------------------------------- diff --git a/docs/geos_posp_docs/visu.pythonViewUtils.rst b/docs/geos_posp_docs/visu.pythonViewUtils.rst index 0442aae6d..68047cfbc 100644 --- a/docs/geos_posp_docs/visu.pythonViewUtils.rst +++ b/docs/geos_posp_docs/visu.pythonViewUtils.rst @@ -20,12 +20,4 @@ geos_posp.visu.pythonViewUtils.functionsFigure2DGenerator module :undoc-members: :show-inheritance: -geos_posp.visu.pythonViewUtils.mainPythonView module -------------------------------------------------------- - -.. automodule:: geos_posp.visu.pythonViewUtils.mainPythonView - :members: - :undoc-members: - :show-inheritance: - diff --git a/docs/index.rst b/docs/index.rst index a5e7598dd..363634c99 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -86,6 +86,8 @@ Packages geos-timehistory + geos-utils + geos-xml-tools pygeos-tools