Skip to content
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

Dev gemgis2 #236

Merged
merged 22 commits into from
Jan 22, 2023
Merged
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
22 changes: 20 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# The full version, including alpha/beta/rc tags
release = '1.0.3'
version = release

# -- GemGIS configuration ---------------------------------------------------
sys.path.append('../../gemgis')
Expand All @@ -37,7 +38,7 @@
# ones.
extensions = [
'nbsphinx',
'sphinx_rtd_theme',
"sphinx_book_theme",
#'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.doctest',
Expand All @@ -63,13 +64,24 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_book_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []

html_title = "GemGIS - Spatial data processing for geomodeling"
html_logo = "https://raw.githubusercontent.com/cgre-aachen/gemgis/main/docs/getting_started/images/Modern1.png"
html_favicon = "https://raw.githubusercontent.com/cgre-aachen/gemgis/main/docs/getting_started/images/facvon.ico"

#html_theme_options = {
# "repository_url": "https://github.com/cgre-aachen/gemgis",
# "use_repository_button": True,
# "use_issues_button": True,
# "use_edit_page_button": True,
#}

nbsphinx_execute = 'never'

nbsphinx_execute_arguments = [
Expand All @@ -79,3 +91,9 @@

copybutton_prompt_text = ">>> "



# General information about the project.
project = "GemGIS"
copyright = "2020–2023, GemGIS Developers"

3 changes: 2 additions & 1 deletion docs/getting_started/about.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.. gemgis documentation master file, created by
.. _about_ref:
gemgis documentation master file, created by
sphinx-quickstart on Mon Nov 2 22:04:17 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Expand Down
6 changes: 3 additions & 3 deletions docs/getting_started/example/example30.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Adding additional orientations"
"## Adding additional orientations"
]
},
{
Expand Down Expand Up @@ -2257,7 +2257,7 @@
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -2271,7 +2271,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.10.8"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/example/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Example Models
There is a series of examples available for GemGIS. In order to keep the size of the main GemGIS package as small as possible, the data is provided through a separated repository `gemgis-data <https://github.com/cgre-aachen/gemgis_data/tree/main>`_. You can also download the data directly following `this link <https://github.com/cgre-aachen/gemgis_data/archive/main.zip>`_.

.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: Examples

example01
Expand Down
Binary file added docs/getting_started/images/favicon.ico
Binary file not shown.
21 changes: 10 additions & 11 deletions docs/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,6 @@ In order to visualize and work with meshes, the `PyVista <https://docs.pyvista.o
conda install -c conda-forge pyvista">=0.37.0"


Installing GemPy (Optional)
~~~~~~~~~~~~~~~~~~~~~~~~~~~

The current modeling package that is supported by GemGIS is `GemPy <https://docs.gempy.org/>`_. GemPy can easily be installed with ``pip``/PyPi::

pip install gempy

.. image:: images/cmd7.png


Installing GemGIS via PyPi
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -148,7 +138,7 @@ Use the following command to go up one level in your folder structure::

cd ..

Now, a new git repository needs to be initiated within the gemgis folder:
Now, a new git repository needs to be initiated within the gemgis folder::

git init

Expand All @@ -164,6 +154,15 @@ You should now have the latest GemGIS files in your gemgis folder.

.. image:: images/cmd10.png

Installing GemPy (Optional)
~~~~~~~~~~~~~~~~~~~~~~~~~~~

The current modeling package that is supported by GemGIS is `GemPy <https://docs.gempy.org/>`_. GemPy can easily be installed with ``pip``/PyPi::

pip install gempy

.. image:: images/cmd7.png

Checking the Installation
~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
706 changes: 706 additions & 0 deletions docs/getting_started/tutorial/58_creating_hexagonal_grid.ipynb

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions docs/getting_started/tutorial/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Each set of functions of GemGIS is collected in a different module. The function


.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: Tutorials

00_generating_data_qgis
Expand Down Expand Up @@ -74,7 +74,7 @@ Each set of functions of GemGIS is collected in a different module. The function
35_plotting_borehole_data_with_pyvista
36_creating_proj_crs_objects_for_gemgis
37_delaunay_triangulation_for_isoline_maps
38_interactive_plotting_with_bokeh_ingemgis
38_interactive_plotting_with_bokeh_in_gemgis
39_shapely_base_geometries_with_z_component
40_working_with_gpx_data_in_gemgis
41_working_with_kml_data
Expand All @@ -93,4 +93,5 @@ Each set of functions of GemGIS is collected in a different module. The function
54_converting_pyvista_mesh_to_zmap_grid
55_extracting_well_tops_from_pyvista_meshes
56_Displaying_Seismic_Data_in_Pyvista
57_creating_spaghetti_plots_in_gempy
57_creating_spaghetti_plots_in_gempy
58_creating_hexagonal_grid
26 changes: 14 additions & 12 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to documentation page of GemGIS - GemPy Geographic!
Welcome to the documentation page of GemGIS |version|!
===========================================================


GemGIS is a Python-based, open-source geographic information processing library. It is capable of preprocessing spatial data such as vector data (shape files, geojson files, geopackages,...), raster data (tif, png,...), data obtained from online services (WCS, WMS, WFS) or XML/KML files (soon). Preprocessed data can be stored in a dedicated Data Class to be passed to the geomodeling package `GemPy <https://github.com/cgre-aachen/gempy>`_ in order to accelerate the model building process. Postprocessing of model results will allow export from GemPy to geoinformation systems such as QGIS and ArcGIS or to Google Earth for further use.

GemGIS uses and combines the full functionality of `GeoPandas <https://geopandas.org/>`_, `rasterio <https://rasterio.readthedocs.io/en/latest/>`_, `OWSLib <https://geopython.github.io/OWSLib/>`_, `Pandas <https://pandas.pydata.org/docs/>`_, `Shapely <https://shapely.readthedocs.io/en/latest/manual.html>`_, `PyVista <https://docs.pyvista.org/>`_ and `NumPy <https://numpy.org/>`_ to simplify, accelerate and automate the workflows used to preprocess spatial data for geomodeling.


.. container:: button

:doc:`About GemGIS <getting_started/about>` | :doc:`Installation <getting_started/installation>` |
:doc:`Tutorials <getting_started/tutorial/index>` | :doc:`Examples <getting_started/example/index>`

.. toctree::
:maxdepth: 3
:hidden:
:maxdepth: 2
:caption: Getting Started
:glob:

Expand All @@ -21,16 +33,6 @@ Welcome to documentation page of GemGIS - GemPy Geographic!
getting_started/tutorial/index
getting_started/example/index











Indices and tables
==================

Expand Down
1 change: 1 addition & 0 deletions environment_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies:
- sphinx_markdown_tables
- sphinx_gallery
- sphinx_rtd_theme
- sphinx_book_theme
- sphinx_copybutton
- sphinx_automodapi
- sphinx_numfig
Expand Down
16 changes: 12 additions & 4 deletions gemgis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def show_number_of_data_points(geo_model): # gp.core.model.Project):
# Add columns to geo_model surface table
gdf['No. of Interfaces'] = no_int
gdf['No. of Orientations'] = no_ori

return gdf


Expand Down Expand Up @@ -1811,7 +1811,7 @@ def convert_to_petrel_points_with_attributes(mesh: pv.core.pointset.PolyData,
print('CSV-File successfully saved')


def ray_trace_one_surface(surface: pv.core.pointset.PolyData,
def ray_trace_one_surface(surface: Union[pv.core.pointset.PolyData, pv.core.pointset.UnstructuredGrid],
origin: Union[np.ndarray, list],
end_point: Union[np.ndarray, list],
first_point: bool = False) -> tuple:
Expand All @@ -1820,8 +1820,8 @@ def ray_trace_one_surface(surface: pv.core.pointset.PolyData,
Parameters:
___________

surface: pv.core.pointset.PolyData
Calculated GemPy surface
surface: Union[pv.core.pointset.PolyData, pv.core.pointset.UnstructuredGrid]
Calculated or clipped GemPy surface

origin:
Coordinates of the top of the well
Expand All @@ -1834,6 +1834,14 @@ def ray_trace_one_surface(surface: pv.core.pointset.PolyData,

"""

# Checking that the provided surface is of type PoyData or UnstructuredGrid
if not isinstance(surface, (pv.core.pointset.PolyData, pv.core.pointset.UnstructuredGrid)):
raise TypeError('Surface must be provided as PolyData or UnstructuredGrid')

# Converting UnstructuredGrid to PolyData
if isinstance(surface, pv.core.pointset.UnstructuredGrid):
surface = surface.extract_surface()

# Extracting the intersection between a PolyData set and a mesh
intersection_points, intersection_cells = surface.ray_trace(origin=origin,
end_point=end_point,
Expand Down
Loading