Git Product home page Git Product logo

archpy's Introduction

ArchPy

Documentation Status logo

A hierarchical stochastic geological modeling tool in Python

Installation

ArchPy can be installed with pip :

pip install geoarchpy

This will install all ArchPy dependencies (even the optional ones) and the package itself.

OR

ArchPy can be installed with

pip install .

when in the main directory.

Alternatively, it is possible to add ArchPy path directly in the python script with sys :

sys.path.append("path where ArchPy is") 

and then import ArchPy. In such case, it is necessary to install all the dependencies manually.

โš ๏ธ Issues with widgets: For some reasons, widgets does not work properly, probably due to the recent version of jupyter-server. For now these issues are not solved and widgets are not working, except partially with inline backend.

Concerning the interactivity of the plots, it is necessary to install trame as well as some trame subpackages. This can be done with the following command :

pip install trame
pip install trame-vuetify
pip install trame-vtk

Requirements

Works and tested with 3.8 <= python <= 3.11

The following python packages are absolutely necessary:

  • Geone
  • matplotlib
  • numpy (tested with 1.23.5)
  • SciPy
  • sklearn
  • pandas
  • shapely
  • scikit-learn

These are not required but highly recommanded. They are installed with ArchPy by default.

  • PyVista
  • pyyaml (for export uses)
  • Rasterio (to use rasters)
  • Geopandas (to use shapefile)
  • ipywidgets

Examples

There is some example notebooks :

  • 01_basic : a folder where simple and basics ArchPy functionnalities are described
  • 02_3D_ArchPy : a complete 3D ArchPy model example
  • 03_Article_example : a synthetical example shown in ArchPy article
  • 04_hierarchies : an exemple with many hierarchical units to test ArchPy capabilities
  • 05_mps_surfaces : an example how to use MPS to simulate the units surfaces
  • 06_cross_validation : a notebook that present how to perform a cross-validation directly with ArchPy
  • 07_geological_map : this notebook presents how to integrate and use a geological in an ArchPy model
  • 08_inference : little guide how to use archpy inference tools to estimate surface parameters (no facies parameters for now) --> Note that for now, the interface is not working due to incompatibilities issues with ipywidgets.
  • 09_interface : little exemple of an interface to call an preexisting archpy model as well as drawing a new model extension.

Paper

A paper was published on the ArchPy concept and its different capabilities. The paper was written with the version 0.1 of ArchPy. It is available with the following link.

Contact

For any questions regarding ArchPy, please contact me at [email protected]

archpy's People

Contributors

alecomunian avatar alexsnev avatar ludovicschorpp avatar philipperenard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

archpy's Issues

Facies computations

Hi,
Using Archpy, I'm encountering an error while computing the facies realizations. I suspected that the covariance model I defined for Unit B is somehow not a good fit resulting in this issue because Unit C works just fine. I'm following the examples of ArchPy so I thought at the beginning let's take a simple approach to just see if the model works with my borehole dataset and then optimize the methods and covariance models. Any idea what might be the root causes?

image

Making units

Hello! I'd like to ask you info about the meaning of the parameters in this screenshot, I didn't get it totally and I think it's crucial to model our study case in the best way
image
For example which is the difference between dic_s_D and dic_f_D, what is the meaning of the arguments called inside the function "Unit" ecc., thanks a lot for your help!

Adding gaps

Hi Ludovic,
I have some questions that should help me to better understand the function add_gap in inputs.py.
If I understand correctly, when there is some missing information in your data, then add_gap tries to fill the gap by adding a "None" unit/facies in that segment of borehole.
Hereinafter my questions:

  1. Maybe in the previous merge I asked you, I was too strict by suggesting an "Error" when the top of a facies is below the top of a borehole. Therefore, if you want I have just committed a new version with a "warning" in place of an "error message". If you want I can ask you another "merge" for this.
  2. When I edit inputs.py in Spyder, Pyflakes warns about the fact that the variable bot is undefined (on the line if i > 0 and bot != top: and the one just below). There might be the risk that when you call add_gap with this variable bot undefined this could create some trouble?
  3. In some cases with my data I have SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. This complaints often comes from add_gap, at the line lay=idata.iloc[0]. If I replace this with something like lay=copy.deepcopy(idata.iloc[0]) the warning disappears. Do you think doing this edit might make sense?
  4. To further test add_gap I intentionally raised the $z$ coordinate of one well above the first top definition. What should be the behavior of the code in this case?

Thank you in advance.
Bests,
Alessandro

[Suggestion] rename getXX methods to get_XX

I noted some of the "get" methods are inconsistently named, e.g., T1.getprop instead of T1.get_prop like most of the other methods. It would be nice if all these get-methods are named consistently :)

Cheers,
Raoul

shannon entropy plots

This was the plot I got from plotting the entropy, I dont think it's correct. So what are your recommendations to get the right plot?

image

Additionally, I plotted the 3d shannon entropy but observed no heterogeneity as well. What could I be doing wrongly?

image

plot facies error

Please help,

I wanted to plot the facies as in tuorial 2 using my dataset, but the following was the error I kept getting.

image
image

Compute Surface

Please could you help with this error? I chenged my working directory yet, it kept returing the same error.

image

Probability map

Hello! I need an help with the probability plot, as you can see in the picture all the values plotted are 1 even if the facies and the unit are computed and plotted properly.
image
Could you help pls? I'm using SIS interpolation method, thanks a lot.

borehole X, Y and Z coordinate initialization

Dear all,

Please, I need help with borehole coordinate initialization. I have real world coordinates shown below. However, I saw something like coordinate of origins in archpy documentation. I dont know how this real world coordinate can be converted for archpy used. please help.

image

The error I got when I wanted to add borehole class

image

[Suggestion] add plot_grid method

It would be nice to have a T1.plot_grid method to visually check the grid after initialising the Arch_table object.

I think this would help novice users check there input and improve understanding.

Import of ArchPy fails (windows 11 - miniconda) - Missing geos_c.dll?

After doing a "pip install geoarchpy" I get the following error (related to a missing geos_c.dll I believe) when importing ArchPy:

          (archpy) c:\Users\thoma\miniconda3\envs\archpy>python
          Python 3.9.16 (main, Jan 11 2023, 16:16:36) [MSC v.1916 64 bit (AMD64)] on win32
          Type "help", "copyright", "credits" or "license" for more information.
          >>> import ArchPy
          Traceback (most recent call last):
            File "<stdin>", line 1, in <module>
            File "c:\Users\thoma\miniconda3\envs\archpy\lib\site-packages\ArchPy\__init__.py", line 1, in <module>
              import ArchPy.base
            File "c:\Users\thoma\miniconda3\envs\archpy\lib\site-packages\ArchPy\base.py", line 11, in <module>
              import shapely.geometry
            File "c:\Users\thoma\miniconda3\envs\archpy\lib\site-packages\shapely\geometry\__init__.py", line 4, in <module>
              from .base import CAP_STYLE, JOIN_STYLE
            File "c:\Users\thoma\miniconda3\envs\archpy\lib\site-packages\shapely\geometry\base.py", line 19, in <module>
              from shapely.coords import CoordinateSequence
            File "c:\Users\thoma\miniconda3\envs\archpy\lib\site-packages\shapely\coords.py", line 8, in <module>
              from shapely.geos import lgeos
            File "c:\Users\thoma\miniconda3\envs\archpy\lib\site-packages\shapely\geos.py", line 149, in <module>
              _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll'))
            File "c:\Users\thoma\miniconda3\envs\archpy\lib\ctypes\__init__.py", line 374, in __init__
              self._handle = _dlopen(self._name, mode)
          FileNotFoundError: Could not find module 'c:\Users\thoma\miniconda3\envs\archpy\Library\bin\geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.

Computing facies

Hello,
I'd like to ask for an help with the following issue
image
what could be the meaning of this error? I'm following the tutorial and everything seems done according to the procedure.

plotting units and cross_sections

Dear all,

I am tried to follow tutorial 2, luckily I was able follow all the steps however, I have an issue with my plots as the top unit is extremely exaggerated as in the pictures below. How can I correct this.

p = pv.Plotter(1)
v_ex=1
T1.plot_units(iu=0, plotter=p, slicex=(0.3), slicey=(0.3),v_ex=v_ex)
p.show()
image

p = pv.Plotter()
T1.plot_facies(plotter=p, slicex=(0.5), slicey=(0.5),v_ex=1)
T1.plot_bhs("facies", plotter=p, v_ex=1)
p.show()
image

#cross section
#first a list of points must be defined
p1 = [1,15]
p2 = [15,25]
p3 = [20,5]
T1.plot_cross_section([p1,p3],typ='facies',iu=0)
image

Going forward, I tried using my own dataset how ever my plots are not coming out fine as I expected, particularly my cross-section is just too simple. What can I do to reactify this issue? Thank you

image

image

Segmentation fault (core dumped) running 1_the_very_basic

Hi Ludovic,
when I try to run the "1_the_very_basic" notebook, I first found a RuntimeWarning and then a "segmentation fault".

The "RuntimeWarning" is due to an "invalid value encountered in long_scalars" in base.py, around line 4169
p=np.sum(facies == fa.ID)/len(facies == fa.ID)
There I tried to print out the value of facies, and it seems to be an empty list. However, the units defined in the code contain correctly the definition of some facies.
I suppose this is probably due to the fact that facies is initialized from data coming from the "hard data", and in the case those are missing... then the problem arises.

If I continue to execute the script after this warning, then I get a "Segmentation fault (code dumped)".
However, I also tried the 2nd example (the one with conditioning data, "2_Hard_data"), and that works fine.

Therefore, I think this could be a bug in the "1_the_very_basic" notebook, probably due to the missing hard data.

Hope this helps,
Bests,

Alessandro

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.