Skip to content

Refactoring pygeosx to geos-python-interface #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
max-parallel: 3
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
package-name: ["geos-ats", "geos-mesh", "geos-timehistory", "geos-xml-tools", "hdf5-wrapper", "pygeos-tools"]
package-name: ["geos-ats", "geos-mesh", "geos-timehistory", "geos-xml-tools", "hdf5-wrapper", "geos-python-interface-tools"]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Add python modules to be documented
python_root = '..'
python_modules = ( 'geos-xml-tools', 'geos-mesh', 'geos-ats', 'hdf5-wrapper', 'pygeos-tools', 'geos-timehistory' )
python_modules = ( 'geos-xml-tools', 'geos-mesh', 'geos-ats', 'hdf5-wrapper', 'geos-python-interface-tools', 'geos-timehistory' )
for m in python_modules:
sys.path.insert( 0, os.path.abspath( os.path.join( python_root, m, 'src' ) ) )

Expand Down Expand Up @@ -47,7 +47,7 @@
'sphinxarg.ext', 'sphinx.ext.napoleon', 'sphinxcontrib.programoutput'
]

autodoc_mock_imports = [ "pygeosx", "pylvarray", "meshio", "lxml", "mpi4py", "h5py", "ats", "scipy" ]
autodoc_mock_imports = [ "geos_python_interface", "pylvarray", "meshio", "lxml", "mpi4py", "h5py", "ats", "scipy" ]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
Expand Down
24 changes: 24 additions & 0 deletions docs/geos-python-interface-tools.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

GEOS Python Interface Tools
-----------------------------

The `geos-python-interface-tools` python package adds a variety of tools for working with geos_python_interface objects.
These include common operations such as setting the value of geosx wrappers with python functions, parallel communication, and file IO.
Examples using these tools can be found here: `geos_python_interface Examples <https://geosx-geosx.readthedocs-hosted.com/en/latest/docs/sphinx/advancedExamples/geos_python_interfaceExamples/Index.html>`_ .


API
^^^^^

.. automodule:: geos.geos_python_interface_tools.wrapper
:members:

.. automodule:: geos.geos_python_interface_tools.file_io
:members:

.. automodule:: geos.geos_python_interface_tools.mesh_interpolation
:members:

.. automodule:: geos.geos_python_interface_tools.well_log
:members:

4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The ats setup command also sets up the python tools:
make ats_environment


These will attempt to install the required packages into the python distribution indicated via the `Python3_EXECUTABLE` cmake variable (also used by pygeosx).
These will attempt to install the required packages into the python distribution indicated via the `Python3_EXECUTABLE` cmake variable (also used by geos_python_interface).
If any package dependencies are missing, then the install script will attempt to fetch them from the internet using pip.
After installation, these packages will be available for import within the associated python distribution, and a set of console scripts will be available within the GEOS build bin directory.

Expand Down Expand Up @@ -84,6 +84,6 @@ Packages

geos-xml-tools

pygeos-tools
geos-python-interface-tools

geos-timehistory
24 changes: 0 additions & 24 deletions docs/pygeos-tools.rst

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "pygeos-tools"
name = "geos-python-interface-tools"
version = "0.1.0"
description = "Tools for interacting with pygeosx"
description = "Tools for interacting with geos_python_interface"
maintainers = [
{name = "Christopher Sherman", email = "[email protected]" }
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from mpi4py import MPI
import matplotlib.pyplot as plt
import pylvarray
import pygeosx
import geos_python_interface

# Get the MPI rank
comm = MPI.COMM_WORLD
Expand All @@ -16,7 +16,7 @@ def get_wrapper( problem, target_key, write_flag=False ):

Args:
filename (str): Catalog file name
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
target_key (str): Key for the target wrapper
write_flag (bool): Sets write mode (default=False)

Expand Down Expand Up @@ -44,7 +44,7 @@ def get_wrapper_par( problem, target_key, allgather=False, ghost_key='' ):
Note: if ghost_key is set, it will try to remove any ghost elements

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
target_key (str): Key for the target wrapper
allgather (bool): Flag to trigger allgather across ranks (False)
ghost_key (str): Key for the corresponding ghost wrapper (default='')
Expand Down Expand Up @@ -112,7 +112,7 @@ def gather_wrapper( problem, key, ghost_key='' ):
Get a global copy of a wrapper as a numpy ndarray on rank 0

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
target_key (str): Key for the target wrapper

Returns:
Expand All @@ -126,7 +126,7 @@ def allgather_wrapper( problem, key, ghost_key='' ):
Get a global copy of a wrapper as a numpy ndarray on all ranks

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
target_key (str): Key for the target wrapper

Returns:
Expand All @@ -140,7 +140,7 @@ def get_global_value_range( problem, key ):
Get the range of a target value across all processes

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
target_key (str): Key for the target wrapper

Returns:
Expand Down Expand Up @@ -182,7 +182,7 @@ def print_global_value_range( problem, key, header, scale=1.0, precision='%1.4f'
Print the range of a target value across all processes

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
target_key (str): Key for the target wrapper
header (str): Header to print with the range
scale (float): Multiply the range with this value before printing (default = 1.0)
Expand Down Expand Up @@ -214,7 +214,7 @@ def set_wrapper_to_value( problem, key, value ):
Set the value of a wrapper

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
target_key (str): Key for the target wrapper
value (float): Value to set the wrapper
"""
Expand All @@ -227,7 +227,7 @@ def set_wrapper_with_function( problem, target_key, input_keys, fn, target_index
Set the value of a wrapper using a function

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
target_key (str): Key for the target wrapper
input_keys (str, list): The input key(s)
fn (function): Vectorized function used to calculate target values
Expand Down Expand Up @@ -275,7 +275,7 @@ def search_datastructure_wrappers_recursive( group, filters, matching_paths, lev
Recursively search the group and its children for wrappers that match the filters

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
filters (list): a list of strings
matching_paths (list): a list of matching values
"""
Expand Down Expand Up @@ -303,7 +303,7 @@ def get_matching_wrapper_path( problem, filters ):
'a/b/c', 'c/b/a', 'd/e/c/f/b/a/a'

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
filters (list): a list of strings

Returns:
Expand Down Expand Up @@ -336,7 +336,7 @@ def run_queries( problem, records ):
'fhandle': plt.figure() # A figure handle }}

Args:
problem (pygeosx.Group): GEOSX problem handle
problem (geos_python_interface.Group): GEOSX problem handle
records (dict): A dict of dicts that specifies the queries to run
"""
for k in records.keys():
Expand Down
2 changes: 1 addition & 1 deletion geos-xml-tools/src/geos/xml_tools/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def preprocess_serial() -> None:
compiled_name = args.compiled_name
else:
raise Exception(
'When applying the preprocessor in parallel (outside of pygeosx), the --compiled_name argument is required'
'When applying the preprocessor in parallel (outside of geos_python_interface), the --compiled_name argument is required'
)

# Note: the return value may be passed to sys.exit, and cause bash to report an error
Expand Down
Loading