geoh5vista 0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ **/.DS_Store
2
+ **/*.pyc
3
+ **/__pycache__/
4
+ # pixi environments
5
+ .pixi/
6
+ .vscode/
7
+ .github/
8
+ .envrc
9
+ .coverage
10
+ coverage.xml
11
+ pixi.lock
12
+ assets/
13
+ build/
14
+ dist/
15
+ docs/
16
+ examples/
17
+ tests/
18
+ archive/
19
+ src/geoh5vista.egg-info/
geoh5vista-0.2/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, Derek Kinakin
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,133 @@
1
+ Metadata-Version: 2.4
2
+ Name: geoh5vista
3
+ Version: 0.2
4
+ Summary: A Python library for converting geoh5py objects to PyVista data objects for 3D visualization and geometry processing.
5
+ Project-URL: Documentation, https://github.com/derek-kinakin/geoh5vista#readme
6
+ Project-URL: Issues, https://github.com/derek-kinakin/geoh5vista/issues
7
+ Project-URL: Source, https://github.com/derek-kinakin/geoh5vista
8
+ Author: Derek Kinakin
9
+ License-Expression: BSD-3-Clause
10
+ License-File: LICENSE
11
+ Keywords: 3d-visualization,geoh5,geology,geoscience,pyvista
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: BSD License
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: Implementation :: CPython
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: geoh5py>=0.13
22
+ Requires-Dist: numpy>=1.26
23
+ Requires-Dist: pyvista>=0.48
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest-cov>=4; extra == 'dev'
26
+ Requires-Dist: pytest>=7; extra == 'dev'
27
+ Requires-Dist: ruff>=0.6; extra == 'dev'
28
+ Requires-Dist: twine>=5; extra == 'dev'
29
+ Provides-Extra: test
30
+ Requires-Dist: pytest-cov>=4; extra == 'test'
31
+ Requires-Dist: pytest>=7; extra == 'test'
32
+ Description-Content-Type: text/markdown
33
+
34
+ geoh5vista: a Geoh5 <> PyVista (VTK) interface
35
+ ===========================================
36
+
37
+ A PyVista (and VTK) interface for the `Geoh5` file format providing Python 3D visualization and useable data structures for processing datasets in the geoh5 specification. This library allows geologists to access the powerful tools available in the PyVista ecosystem for their data stored in the `Geoh5` format.
38
+
39
+ The structure and interfaces of this project are heavily inspired by the 'omfvista' package, which provides a similar interface for the 'omf' format.
40
+
41
+ omfvista package: <https://github.com/OpenGeoVis/omfvista>
42
+
43
+ Geoh5 Python interface package: <https://mirageoscience-geoh5py.readthedocs-hosted.com/en/stable/index.html>
44
+
45
+ Documentation is hosted at <https://github.com/derek-kinakin/geoh5vista>
46
+
47
+ Installation
48
+ ------------
49
+
50
+ From PyPi (coming soon)
51
+
52
+ ```python
53
+ pip install geoh5vista
54
+ ```
55
+
56
+ From Github
57
+
58
+ ```python
59
+ pip install git+https://github.com/derek-kinakin/geoh5vista.git
60
+ ```
61
+
62
+ Current Status of Supported Geoh5 Entities
63
+ -------------------
64
+
65
+ This table provides the list of supported entities. Read from and write
66
+ to Geoh5 support is the goal for each entity.
67
+
68
+ | Geoh5 Entity | PyVista Object | Read from Geoh5 | Write to Geoh5 | Notes |
69
+ | -------------|----------------------------|-----------------|----------------|---------------------------------------------------------------|
70
+ | Workspace | MultiBlock | Yes | Yes | A multiblock containing several object can be written to Geoh5|
71
+ | Points | PointSet | Yes | Yes | |
72
+ | Curve | PolyData | Yes | Yes | |
73
+ | Surface | PolyData | Yes | Yes | |
74
+ | 2D Grid | ImageData | Yes | Yes | 2D grid with dimensions nU x nV x 1 |
75
+ | Block model | ImageData or StructuredGrid| Yes | Yes | 3D grid with dimensions nU x nV x nZ |
76
+ | Drillholes | PolyData | Yes | No | Drillholes can be round-tripped back to geoh5 as curves |
77
+ | Slicer | PolyData | Yes | No | Geometry available as object metadata |
78
+
79
+ Example Use
80
+ -----------
81
+
82
+ ```python
83
+ import pyvista as pv
84
+ import geoh5vista
85
+
86
+ project = geoh5vista.read_geoh5('test_file.geoh5')
87
+ project
88
+ ```
89
+
90
+ Once the data is loaded as a ``pyvista.MultiBlock`` dataset from ``geoh5vista``,
91
+ that object can be directly used for interactive 3D visualization from PyVista:
92
+
93
+ An interactive scene can be created and manipulated to create a figure.
94
+ First, grab the elements from the project:
95
+
96
+ ```python
97
+ # Grab a few elements of interest and plot em up!
98
+ vol = project["Block Model"]
99
+ topo = project["Topography"]
100
+ dacite = project["Dacite"]
101
+ ```
102
+
103
+ Then create a 3D scene with these spatial data and apply a filtering tool from
104
+ PyVista to the volumetric data:
105
+
106
+ ```python
107
+ # Create a plotting window
108
+ p = pv.Plotter(notebook=False)
109
+ # Add our datasets
110
+ p.add_mesh(topo, cmap="gist_earth", opacity=0.5)
111
+ p.add_mesh(dacite, color=dacite["gh5_colour"], opacity=0.6)
112
+ # Add the volumetric dataset with a thresholding tool
113
+ p.add_mesh_threshold(vol)
114
+ # Add the bounds axis
115
+ p.show_bounds()
116
+ # Render the scene in a pop out window
117
+ p.show()
118
+ ```
119
+
120
+ Writing PyVista objects to a Geoh5 file can be as simple as:
121
+
122
+ ```python
123
+
124
+ # Write a single object to geoh5
125
+ geoh5vista.write_geoh5(topo, "new_gh5_topo_file.geoh5")
126
+
127
+ # Write a multiblock to geoh5
128
+ new_project = pv.MultiBlock()
129
+ new_project["Topo"] = topo
130
+ new_project["Dacite"] = dacite
131
+
132
+ geoh5vista.write_geoh5(new_project, "new_project.geoh5")
133
+ ```
@@ -0,0 +1,100 @@
1
+ geoh5vista: a Geoh5 <> PyVista (VTK) interface
2
+ ===========================================
3
+
4
+ A PyVista (and VTK) interface for the `Geoh5` file format providing Python 3D visualization and useable data structures for processing datasets in the geoh5 specification. This library allows geologists to access the powerful tools available in the PyVista ecosystem for their data stored in the `Geoh5` format.
5
+
6
+ The structure and interfaces of this project are heavily inspired by the 'omfvista' package, which provides a similar interface for the 'omf' format.
7
+
8
+ omfvista package: <https://github.com/OpenGeoVis/omfvista>
9
+
10
+ Geoh5 Python interface package: <https://mirageoscience-geoh5py.readthedocs-hosted.com/en/stable/index.html>
11
+
12
+ Documentation is hosted at <https://github.com/derek-kinakin/geoh5vista>
13
+
14
+ Installation
15
+ ------------
16
+
17
+ From PyPi (coming soon)
18
+
19
+ ```python
20
+ pip install geoh5vista
21
+ ```
22
+
23
+ From Github
24
+
25
+ ```python
26
+ pip install git+https://github.com/derek-kinakin/geoh5vista.git
27
+ ```
28
+
29
+ Current Status of Supported Geoh5 Entities
30
+ -------------------
31
+
32
+ This table provides the list of supported entities. Read from and write
33
+ to Geoh5 support is the goal for each entity.
34
+
35
+ | Geoh5 Entity | PyVista Object | Read from Geoh5 | Write to Geoh5 | Notes |
36
+ | -------------|----------------------------|-----------------|----------------|---------------------------------------------------------------|
37
+ | Workspace | MultiBlock | Yes | Yes | A multiblock containing several object can be written to Geoh5|
38
+ | Points | PointSet | Yes | Yes | |
39
+ | Curve | PolyData | Yes | Yes | |
40
+ | Surface | PolyData | Yes | Yes | |
41
+ | 2D Grid | ImageData | Yes | Yes | 2D grid with dimensions nU x nV x 1 |
42
+ | Block model | ImageData or StructuredGrid| Yes | Yes | 3D grid with dimensions nU x nV x nZ |
43
+ | Drillholes | PolyData | Yes | No | Drillholes can be round-tripped back to geoh5 as curves |
44
+ | Slicer | PolyData | Yes | No | Geometry available as object metadata |
45
+
46
+ Example Use
47
+ -----------
48
+
49
+ ```python
50
+ import pyvista as pv
51
+ import geoh5vista
52
+
53
+ project = geoh5vista.read_geoh5('test_file.geoh5')
54
+ project
55
+ ```
56
+
57
+ Once the data is loaded as a ``pyvista.MultiBlock`` dataset from ``geoh5vista``,
58
+ that object can be directly used for interactive 3D visualization from PyVista:
59
+
60
+ An interactive scene can be created and manipulated to create a figure.
61
+ First, grab the elements from the project:
62
+
63
+ ```python
64
+ # Grab a few elements of interest and plot em up!
65
+ vol = project["Block Model"]
66
+ topo = project["Topography"]
67
+ dacite = project["Dacite"]
68
+ ```
69
+
70
+ Then create a 3D scene with these spatial data and apply a filtering tool from
71
+ PyVista to the volumetric data:
72
+
73
+ ```python
74
+ # Create a plotting window
75
+ p = pv.Plotter(notebook=False)
76
+ # Add our datasets
77
+ p.add_mesh(topo, cmap="gist_earth", opacity=0.5)
78
+ p.add_mesh(dacite, color=dacite["gh5_colour"], opacity=0.6)
79
+ # Add the volumetric dataset with a thresholding tool
80
+ p.add_mesh_threshold(vol)
81
+ # Add the bounds axis
82
+ p.show_bounds()
83
+ # Render the scene in a pop out window
84
+ p.show()
85
+ ```
86
+
87
+ Writing PyVista objects to a Geoh5 file can be as simple as:
88
+
89
+ ```python
90
+
91
+ # Write a single object to geoh5
92
+ geoh5vista.write_geoh5(topo, "new_gh5_topo_file.geoh5")
93
+
94
+ # Write a multiblock to geoh5
95
+ new_project = pv.MultiBlock()
96
+ new_project["Topo"] = topo
97
+ new_project["Dacite"] = dacite
98
+
99
+ geoh5vista.write_geoh5(new_project, "new_project.geoh5")
100
+ ```
@@ -0,0 +1,102 @@
1
+ [project]
2
+ name = "geoh5vista"
3
+ version = "0.2"
4
+ description = "A Python library for converting geoh5py objects to PyVista data objects for 3D visualization and geometry processing."
5
+ readme = { file = "README.md", content-type = "text/markdown" }
6
+ requires-python = ">=3.12"
7
+ license = "BSD-3-Clause"
8
+
9
+ keywords = ["geoscience", "geoh5", "pyvista", "3d-visualization", "geology"]
10
+
11
+ authors = [
12
+ { name = "Derek Kinakin" },
13
+ ]
14
+
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Science/Research",
18
+ "License :: OSI Approved :: BSD License",
19
+ "Programming Language :: Python",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: Implementation :: CPython",
23
+ "Topic :: Scientific/Engineering",
24
+ ]
25
+
26
+ dependencies = [
27
+ "geoh5py>=0.13",
28
+ "numpy>=1.26",
29
+ "pyvista>=0.48",
30
+ ]
31
+
32
+ [project.optional-dependencies]
33
+ test = ["pytest>=7", "pytest-cov>=4"]
34
+ dev = ["ruff>=0.6", "pytest>=7", "pytest-cov>=4", "twine>=5"]
35
+
36
+ [project.urls]
37
+ Documentation = "https://github.com/derek-kinakin/geoh5vista#readme"
38
+ Issues = "https://github.com/derek-kinakin/geoh5vista/issues"
39
+ Source = "https://github.com/derek-kinakin/geoh5vista"
40
+
41
+ [build-system]
42
+ requires = ["hatchling>=1.25"]
43
+ build-backend = "hatchling.build"
44
+
45
+ [tool.hatch.build.targets.wheel]
46
+ packages = ["src/geoh5vista"]
47
+
48
+ [tool.hatch.build.targets.sdist]
49
+ include = [
50
+ "src/geoh5vista",
51
+ "tests",
52
+ "README.md",
53
+ "LICENSE",
54
+ "pyproject.toml",
55
+ ]
56
+
57
+ [tool.hatch.envs.default]
58
+ features = ["dev"]
59
+ python = "3.12"
60
+
61
+ [tool.hatch.envs.default.scripts]
62
+ test = "pytest"
63
+ test-cov = "pytest --cov=src/geoh5vista --cov-report=term-missing"
64
+ check-dist = "python -m twine check dist/*"
65
+
66
+ [tool.hatch.envs.test]
67
+ features = ["test"]
68
+ python = "3.12"
69
+
70
+ [tool.hatch.envs.test.scripts]
71
+ run = "pytest"
72
+
73
+ [tool.pytest.ini_options]
74
+ minversion = "7.0"
75
+ addopts = "-ra -q --strict-markers"
76
+ testpaths = ["tests"]
77
+ pythonpath = ["src"]
78
+
79
+ [tool.coverage.run]
80
+ source_pkgs = ["geoh5vista", "tests"]
81
+ branch = true
82
+ parallel = true
83
+ omit = [
84
+ "src/geoh5vista/__about__.py",
85
+ ]
86
+
87
+ [tool.coverage.paths]
88
+ geoh5vista = ["src/geoh5vista", "*/geoh5vista/src/geoh5vista"]
89
+ tests = ["tests", "*/geoh5vista/tests"]
90
+
91
+ [tool.coverage.report]
92
+ exclude_lines = [
93
+ "no cov",
94
+ "if __name__ == .__main__.:",
95
+ "if TYPE_CHECKING:",
96
+ ]
97
+
98
+ [tool.isort]
99
+ profile = "ruff"
100
+ line_length = 100
101
+ force_sort_within_sections = true
102
+ combine_as_imports = true
@@ -0,0 +1,19 @@
1
+ """``geoh5vista``: 3D visualization and geometry processing for Geoh5 format (geoh5) objects.
2
+ """
3
+
4
+ from importlib.metadata import PackageNotFoundError, version
5
+ from .wrapper import geoh5wrap, read_geoh5, vtkwrap, write_geoh5
6
+
7
+ try:
8
+ __version__ = version("geoh5vista")
9
+ except PackageNotFoundError:
10
+ # Fallback for non-installed, source-only execution contexts.
11
+ __version__ = "unknown"
12
+
13
+
14
+ __all__ = (
15
+ "geoh5wrap",
16
+ "read_geoh5",
17
+ "vtkwrap",
18
+ "write_geoh5"
19
+ )