diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ac015f3e..a05ba8de 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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 diff --git a/docs/conf.py b/docs/conf.py index ea094f75..33ac8bea 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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' ) ) ) @@ -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: diff --git a/docs/geos-python-interface-tools.rst b/docs/geos-python-interface-tools.rst new file mode 100644 index 00000000..39a972a1 --- /dev/null +++ b/docs/geos-python-interface-tools.rst @@ -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 `_ . + + +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: + diff --git a/docs/index.rst b/docs/index.rst index 4a56ec79..225bd3e9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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. @@ -84,6 +84,6 @@ Packages geos-xml-tools - pygeos-tools + geos-python-interface-tools geos-timehistory diff --git a/docs/pygeos-tools.rst b/docs/pygeos-tools.rst deleted file mode 100644 index b3484f38..00000000 --- a/docs/pygeos-tools.rst +++ /dev/null @@ -1,24 +0,0 @@ - -PyGEOS Tools --------------------------- - -The `pygeos-tools` python package adds a variety of tools for working with pygeosx 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: `PYGEOSX Examples `_ . - - -API -^^^^^ - -.. automodule:: geos.pygeos_tools.wrapper - :members: - -.. automodule:: geos.pygeos_tools.file_io - :members: - -.. automodule:: geos.pygeos_tools.mesh_interpolation - :members: - -.. automodule:: geos.pygeos_tools.well_log - :members: - diff --git a/pygeos-tools/pyproject.toml b/geos-python-interface-tools/pyproject.toml similarity index 83% rename from pygeos-tools/pyproject.toml rename to geos-python-interface-tools/pyproject.toml index 2a6f5dec..9a9a5105 100644 --- a/pygeos-tools/pyproject.toml +++ b/geos-python-interface-tools/pyproject.toml @@ -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 = "sherman27@llnl.gov" } ] diff --git a/pygeos-tools/src/geos/pygeos_tools/__init__.py b/geos-python-interface-tools/src/geos/geos_python_interface_tools/__init__.py similarity index 100% rename from pygeos-tools/src/geos/pygeos_tools/__init__.py rename to geos-python-interface-tools/src/geos/geos_python_interface_tools/__init__.py diff --git a/pygeos-tools/src/geos/pygeos_tools/file_io.py b/geos-python-interface-tools/src/geos/geos_python_interface_tools/file_io.py similarity index 100% rename from pygeos-tools/src/geos/pygeos_tools/file_io.py rename to geos-python-interface-tools/src/geos/geos_python_interface_tools/file_io.py diff --git a/pygeos-tools/src/geos/pygeos_tools/mesh_interpolation.py b/geos-python-interface-tools/src/geos/geos_python_interface_tools/mesh_interpolation.py similarity index 100% rename from pygeos-tools/src/geos/pygeos_tools/mesh_interpolation.py rename to geos-python-interface-tools/src/geos/geos_python_interface_tools/mesh_interpolation.py diff --git a/pygeos-tools/src/geos/pygeos_tools/py.typed b/geos-python-interface-tools/src/geos/geos_python_interface_tools/py.typed similarity index 100% rename from pygeos-tools/src/geos/pygeos_tools/py.typed rename to geos-python-interface-tools/src/geos/geos_python_interface_tools/py.typed diff --git a/pygeos-tools/src/geos/pygeos_tools/well_log.py b/geos-python-interface-tools/src/geos/geos_python_interface_tools/well_log.py similarity index 100% rename from pygeos-tools/src/geos/pygeos_tools/well_log.py rename to geos-python-interface-tools/src/geos/geos_python_interface_tools/well_log.py diff --git a/pygeos-tools/src/geos/pygeos_tools/wrapper.py b/geos-python-interface-tools/src/geos/geos_python_interface_tools/wrapper.py similarity index 94% rename from pygeos-tools/src/geos/pygeos_tools/wrapper.py rename to geos-python-interface-tools/src/geos/geos_python_interface_tools/wrapper.py index 0c154c90..070b452b 100644 --- a/pygeos-tools/src/geos/pygeos_tools/wrapper.py +++ b/geos-python-interface-tools/src/geos/geos_python_interface_tools/wrapper.py @@ -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 @@ -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) @@ -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='') @@ -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: @@ -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: @@ -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: @@ -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) @@ -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 """ @@ -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 @@ -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 """ @@ -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: @@ -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(): diff --git a/geos-xml-tools/src/geos/xml_tools/main.py b/geos-xml-tools/src/geos/xml_tools/main.py index a5cef1bd..e59de43d 100644 --- a/geos-xml-tools/src/geos/xml_tools/main.py +++ b/geos-xml-tools/src/geos/xml_tools/main.py @@ -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