diff --git a/README.md b/README.md index d44e858a..9d45d82f 100644 --- a/README.md +++ b/README.md @@ -19,33 +19,84 @@ 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: - - * `geos-utils`: basic utilities - * `geos-geomecanics`: geomechanics functions and data model - - - 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 - - - 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 packages contain basic utilities used by the other ones: + +* `geos-utils`: basic utilities +* `geos-geomecanics`: geomechanics functions and data model + + +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 + + +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` + +GEOS Python packages dependency tree (inter-dependency and main external dependencies) is the following: + +``` +|-- geos-ats +|-- pygeos-tools +|-- geos-utils +|-- geos-geomechanics +| |-- geos-utils +| +|-- hdf5-wrapper +| |-- h5py +| +|-- geos-xml-tools +| |-- lxml +| +|-- geos-mesh +| |-- geos-utils +| |-- vtk +| +|-- geos-prep +| |-- geos-mesh +| |-- geos-xml-tools +| +|-- geos-posp +| |-- geos-mesh +| |-- geos-geomechanics +| +|-- time-history +| |-- hdf5-wrapper +| +|-- mesh-doctor +| |-- geos-prep +| |-- pyvista +| +|-- geos-trame +| |-- geos-xml-tools +| |-- geos-mesh +| |-- pyvista +| |-- trame +| +|-- geos-xml-viewer +| |-- geos-xml-tools +| |-- geos-mesh +| |-- pyvista +| +|-- geos-pv + |-- geos-prep + |-- geos-posp + |-- geos-xml-tools + |-- paraview +``` 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. @@ -59,80 +110,25 @@ Installation * *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-ats - |-- pygeos-tools - |-- geos-utils - |-- geos-geomechanics - | |-- geos-utils - | - |-- hdf5-wrapper - | |-- h5py - | - |-- geos-xml-tools - | |-- lxml - | - |-- geos-mesh - | |-- geos-utils - | |-- vtk - | - |-- geos-prep - | |-- geos-mesh - | |-- geos-xml-tools - | - |-- geos-posp - | |-- geos-mesh - | |-- geos-geomechanics - | - |-- time-history - | |-- hdf5-wrapper - | - |-- mesh-doctor - | |-- geos-prep - | |-- pyvista - | - |-- geos-trame - | |-- geos-xml-tools - | |-- geos-mesh - | |-- pyvista - | |-- trame - | - |-- geos-xml-viewer - | |-- geos-xml-tools - | |-- geos-mesh - | |-- pyvista - | - |-- geos-pv - |-- geos-prep - |-- geos-posp - |-- geos-xml-tools - |-- paraview - ``` + GEOS Python packages can be manually installed with pip using `python` >= 3.10. - For the complete installation of GEOS pre- and post-processing packages, run the following commands from the geosPythonPackage directory: + 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 @@ -150,6 +146,46 @@ 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_name = "geos-utils" + geos_utils_path: str = (Path(__file__).parent.parent / package_name).as_uri() + + setup( + install_requires=[ + "vtk >= 9.3", + "numpy >= 1.26", + "pandas >= 2.2", + "typing_extensions >= 4.12", + f"{package_name} @ {geos_utils_path}", + ] + ) + ``` + Release ------- diff --git a/docs/conf.py b/docs/conf.py index a6dd5d05..8e22d041 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' ) ) ) @@ -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.rst b/docs/geos-posp.rst index 076b76e5..19e5c205 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 00000000..5f59ddd8 --- /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 91% rename from docs/posp_rst/modules.rst rename to docs/geos_posp_docs/modules.rst index 889843d5..476a7c57 100644 --- a/docs/posp_rst/modules.rst +++ b/docs/geos_posp_docs/modules.rst @@ -11,5 +11,3 @@ Processing processing pyvistaTools - - utils diff --git a/docs/posp_rst/processing.rst b/docs/geos_posp_docs/processing.rst similarity index 77% rename from docs/posp_rst/processing.rst rename to docs/geos_posp_docs/processing.rst index 65d6e83d..9da336b9 100644 --- a/docs/posp_rst/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/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 73% rename from docs/posp_rst/visu.mohrCircles.rst rename to docs/geos_posp_docs/visu.mohrCircles.rst index 988e4c4c..30e9a721 100644 --- a/docs/posp_rst/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/posp_rst/visu.pythonViewUtils.rst b/docs/geos_posp_docs/visu.pythonViewUtils.rst similarity index 74% rename from docs/posp_rst/visu.pythonViewUtils.rst rename to docs/geos_posp_docs/visu.pythonViewUtils.rst index 0442aae6..68047cfb 100644 --- a/docs/posp_rst/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/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/index.rst b/docs/index.rst index a5e7598d..363634c9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -86,6 +86,8 @@ Packages geos-timehistory + geos-utils + geos-xml-tools pygeos-tools diff --git a/docs/posp_rst/utils.rst b/docs/posp_rst/utils.rst deleted file mode 100644 index c46c6891..00000000 --- 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/docs/requirements.txt b/docs/requirements.txt index 19ab47d3..773420cf 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,15 @@ 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 +pyvista diff --git a/geos-posp/pyproject.toml b/geos-posp/pyproject.toml index 3bdbbd26..fe85ebc8 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 00000000..d933e5f6 --- /dev/null +++ b/geos-posp/setup.py @@ -0,0 +1,16 @@ +from pathlib import Path +from setuptools import setup + +# This is where you add any fancy path resolution to the local lib: +package_name = "geos-utils" +geos_utils_path: str = (Path(__file__).parent.parent / package_name).as_uri() + +setup( + install_requires=[ + "vtk >= 9.3", + "numpy >= 1.26", + "pandas >= 2.2", + "typing_extensions >= 4.12", + f"{package_name} @ {geos_utils_path}", + ] +) \ No newline at end of file diff --git a/geos-posp/src/PVplugins/PVAttributeMapping.py b/geos-posp/src/PVplugins/PVAttributeMapping.py index c8387acf..d8234423 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 2f948b91..bb8fbbdf 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 15d06021..5423bbe9 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 efb0d2c0..62d35ea4 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 362c921e..4ab7010a 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 28326a21..2c1c5652 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 7d8662a3..25b6f9d5 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 62545870..92c0142a 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 e835b1fd..d498d767 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 45334d1d..bbfdd053 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 74e722d7..f2c01541 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 b35cb1c6..a5dd35dd 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 034bc7dd..4b8a7c86 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 ca5a438f..583777c9 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 b789e900..2ff1b4f5 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 9ecd7a15..2bc6e1ca 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 a8933765..2ebc17e4 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 6e28bb3f..4e267853 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 0f8e9ba1..f376a661 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 1718bc3a..26cab3bc 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 4cf51346..3d358995 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 d1e2d8a9..2c541469 100644 --- a/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py +++ b/geos-posp/src/geos_posp/filters/SurfaceGeomechanics.py @@ -18,25 +18,25 @@ ) import geos_posp.processing.geomechanicsCalculatorFunctions as fcts -import geos_posp.processing.geometryFunctions as geom from geos_posp.processing.vtkUtils import ( createAttribute, getArrayInObject, getAttributeSet, isAttributeInObject, ) -from geos_posp.utils.GeosOutputsConstants import ( +import geos.utils.geometryFunctions as geom +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 69324083..072dcca8 100644 --- a/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py +++ b/geos-posp/src/geos_posp/filters/TransferAttributesVolumeSurface.py @@ -16,14 +16,14 @@ 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_posp.utils.GeosOutputsConstants import GeosMeshSuffixEnum -from geos_posp.utils.Logger import Logger, getLogger +from geos.utils.ConnectionSet import ConnectionSetCollection +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 8fe51316..2dabcade 100644 --- a/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py +++ b/geos-posp/src/geos_posp/filters/VolumeSurfaceMeshMapper.py @@ -19,14 +19,14 @@ ) 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_posp.utils.GeosOutputsConstants import PostProcessingOutputsEnum -from geos_posp.utils.Logger import Logger, getLogger -from geos_posp.utils.PhysicalConstants import ( +from geos.utils.geometryFunctions import getCellSideAgainstPlane +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 e50cadd8..c1f700d0 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 fc708a3e..888629f2 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 9849fbf1..7370d276 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 d1ed0a88..04410813 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 50abc432..4b2a596f 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 506cf736..5375e1cc 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 af420e30..dec99ed2 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 7de0995b..6d4c4b63 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 c3a19d11..29257aa8 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 b585922a..1233e616 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 e211c72a..b973f66a 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 9a8b2ead..fcad9e0d 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 1f3ac1a7..78f68c48 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 b3d8e7ed..803ee244 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 f8749fc9..dc56540f 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 ba8c3113..bcc8a464 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 dd2bbb57..1f6621fa 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 new file mode 100644 index 00000000..742cce76 --- /dev/null +++ b/geos-utils/pyproject.toml @@ -0,0 +1,66 @@ +[build-system] +requires = ["setuptools>=61.2"] +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.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 = ["geos/utils"] + + +[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 98% rename from geos-posp/src/geos_posp/utils/GeosOutputsConstants.py rename to geos-utils/src/geos/utils/GeosOutputsConstants.py index 374d3fd7..84771f93 100644 --- a/geos-posp/src/geos_posp/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-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 5984bff9..2f53d35e 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/geosUtils.py b/geos-utils/src/geos/utils/algebraFunctions.py similarity index 100% rename from geos-posp/src/geos_posp/utils/geosUtils.py rename to geos-utils/src/geos/utils/algebraFunctions.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 0c480fd9..4614ac67 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/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 ef7f108d..c1ae4b73 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-posp/tests/testsFunctionsGeosUtils.py b/geos-utils/tests/testsFunctionsGeosUtils.py similarity index 78% rename from geos-posp/tests/testsFunctionsGeosUtils.py rename to geos-utils/tests/testsFunctionsGeosUtils.py index 7de59de6..933f02ad 100644 --- a/geos-posp/tests/testsFunctionsGeosUtils.py +++ b/geos-utils/tests/testsFunctionsGeosUtils.py @@ -10,18 +10,13 @@ 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_posp.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-posp/tests/testsGeometryFunctions.py b/geos-utils/tests/testsGeometryFunctions.py similarity index 96% rename from geos-posp/tests/testsGeometryFunctions.py rename to geos-utils/tests/testsGeometryFunctions.py index 3f7ddb0b..c1f04993 100644 --- a/geos-posp/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_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]