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

Gempy-viewer 3d #954

Open
malflink opened this issue Nov 24, 2024 · 14 comments
Open

Gempy-viewer 3d #954

malflink opened this issue Nov 24, 2024 · 14 comments

Comments

@malflink
Copy link

Hi, I am new to Gempy and recently installed the Gempy v3 issue. I am now going through the tutorials. Gempy is loaded onto my son's server overseas, while I live in SA.

So far, I have looked at the getting started module and Ch1-1.

On both occasions, I just cannot get the gempy-viewer (gpv) 3d to work. It keeps on resetting the kernel and it says gpv-3d is 'undefined'. I have installed vtk and it still does not work. Please can someone tell me how to fix it? It seems to be a common problem, well reported?

Thanks Mike

@flohorovicic
Copy link
Member

flohorovicic commented Nov 25, 2024

Hi Mike,

In order to determine what could be the cause, we need more information on your system, setup (Python), etc. please see the template for issues.

But as a quick info: here a link to an very simple model setup, which you can run in Google Colab (including 3D vis) - maybe this helps, as well:

https://colab.research.google.com/drive/1-trAjwKkGPsF6PkRxoFJ1EJzjZ-3YQZj?usp=sharing

Kind regards, Florian

@flohorovicic
Copy link
Member

(Quick addition: if you click on "Issues -> Bug Report", then you see a list of questions that could help finding an answer)

@flohorovicic
Copy link
Member

Extended answer, with some more time :-) and some more points to check:

Firstly, GemPy has recently been updated to version 3 and there might be some compatibility issues with the tutorials you are using. Please make sure the tutorials you're following are updated for the version of GemPy that you're using.

Secondly, the problem of the kernel resetting and 'gpv-3d' being undefined could be due to an issue with the installation or a missing dependency. Some users have had success solving similar problems by reinstalling GemPy in a fresh Python environment, preferably Python 3.8 or 3.9, as some issues have been reported with Python 3.9+ (see this issue).

In addition, ensure to install GemPy using pip in a fresh environment as explained in this issue. Theano is not required anymore so if you were following an old guide that suggested installing it, please disregard that step.

If these steps do not solve your problem, there might be an issue with your VTK installation. Some users have reported issues with VTK not working correctly on certain systems. Make sure you have the latest version of VTK installed and that it is correctly configured for your system.

Lastly, there are some known issues when trying to use the 3D viewer in Jupyter notebooks. The 3D viewer should open in a new window outside of the notebook. If you are not seeing this window, it could be due to an issue with your display settings or a problem with the installation of pyvista, a library that GemPy uses for 3D visualization. Please ensure that pyvista is correctly installed and working as expected. You can test this by trying to run one of the pyvista examples.

If none of these suggestions solve your problem, please provide more information about your system (operating system, Python version, how you installed GemPy) and any error messages you are seeing. This will help us diagnose the problem more accurately.

I hope this helps. Let me know if you have any other questions.

@javoha
Copy link
Member

javoha commented Nov 26, 2024

Hi @malflink,

maybe just two small additional points. Python 3.12.4 works fine with gempy, so you do not need (should not) go back to 3.8 or 3.9.
As @flohorovicic mentioned when using gpv.plot_3d(geo_model) the default behavior will open a new window (which might for some reason not work in your einvironment). Try gpv.plot_3d(geo_model, image=True) instead for a static image within your notebook.

`

@EternalDeiwos
Copy link

EternalDeiwos commented Nov 26, 2024

I've been trying to help @malflink with this and I'm able to reproduce the problem in his environment, in a fresh environment (Ubuntu 22.04 VM), and in my own environment (macOS). On all of these my Ipython kernel dies after I attempt to call any variant of plot_3d.

Steps to reproduce include:

  1. Create and activate conda environment
  2. Install numpy, matplotlib, and pandas
  3. Install gempy[base] and gempy[opt] — I wasn't sure if the latter was necessary so I installed it anyway.
  4. Install PyTorch
  5. Install PyVista
  6. Install VTK
  7. Install itkwidgets
  8. Install JupyterLab
Exported Environment
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: osx-arm64
aiofiles=24.1.0=pypi_0
aiohappyeyeballs=2.4.3=pyhd8ed1ab_0
aiohttp=3.11.7=py312h998013c_0
aiosignal=1.3.1=pyhd8ed1ab_0
anyio=4.6.2.post1=pyhd8ed1ab_0
aom=3.9.1=h7bae524_0
appnope=0.1.4=pyhd8ed1ab_0
argon2-cffi=23.1.0=pyhd8ed1ab_0
argon2-cffi-bindings=21.2.0=py312h024a12e_5
arrow=1.3.0=pyhd8ed1ab_0
asciitree=0.3.3=pypi_0
asttokens=2.4.1=pyhd8ed1ab_0
async-lru=2.0.4=pyhd8ed1ab_0
attrs=24.2.0=pyh71513ae_0
babel=2.16.0=pyhd8ed1ab_0
beautifulsoup4=4.12.3=pyha770c72_0
bleach=6.2.0=pyhd8ed1ab_0
blosc=1.21.6=h5499902_0
brotli=1.1.0=hd74edd7_2
brotli-bin=1.1.0=hd74edd7_2
brotli-python=1.0.9=py312h313beb8_8
bzip2=1.0.8=h99b78c6_7
c-ares=1.34.3=h5505292_1
ca-certificates=2024.9.24=hca03da5_0
cached-property=1.5.2=hd8ed1ab_1
cached_property=1.5.2=pyha770c72_1
cairo=1.18.0=hb4a6bf7_3
certifi=2024.8.30=pyhd8ed1ab_0
cffi=1.17.1=py312h0fad829_0
charset-normalizer=3.3.2=pyhd3eb1b0_0
click=8.1.7=pypi_0
cloudpickle=3.1.0=pypi_0
comm=0.2.2=pyhd8ed1ab_0
contourpy=1.3.1=py312hb23fbb9_0
cycler=0.12.1=pyhd8ed1ab_0
cyrus-sasl=2.1.27=h60b93bd_7
dask=2024.11.2=pypi_0
dav1d=1.2.1=hb547adb_0
debugpy=1.8.9=py312hd8f9ff3_0
decorator=5.1.1=pyhd8ed1ab_0
defusedxml=0.7.1=pyhd8ed1ab_0
double-conversion=3.3.0=h13dd4ca_0
eigen=3.4.0=h1995070_0
elfinder-client=2.1.62a3=pypi_0
entrypoints=0.4=pyhd8ed1ab_0
exceptiongroup=1.2.2=pyhd8ed1ab_0
executing=2.1.0=pyhd8ed1ab_0
expat=2.6.4=h286801f_0
fastapi=0.115.5=pypi_0
fasteners=0.19=pypi_0
ffmpeg=7.1.0=gpl_h92f8dbd_105
filelock=3.13.1=py312hca03da5_0
font-ttf-dejavu-sans-mono=2.37=hab24e00_0
font-ttf-inconsolata=3.000=h77eed37_0
font-ttf-source-code-pro=2.038=h77eed37_0
font-ttf-ubuntu=0.83=h77eed37_3
fontconfig=2.15.0=h1383a14_1
fonts-conda-ecosystem=1=0
fonts-conda-forge=1=0
fonttools=4.55.0=py312h998013c_0
fqdn=1.5.1=pyhd8ed1ab_0
freetype=2.12.1=hadb7bae_2
fribidi=1.0.10=h27ca646_0
frozenlist=1.5.0=py312h0bf5046_0
fsspec=2024.10.0=pypi_0
gdk-pixbuf=2.42.12=h7ddc832_0
gempy=2024.2.0.2=pypi_0
gempy-engine=2024.2.0=pypi_0
gempy-plugins=2024.1.0=pypi_0
gempy-viewer=2024.2.0=pypi_0
giflib=5.2.2=h80987f9_0
gl2ps=1.4.2=hc97c1ff_1
glew=2.1.0=h9f76cd9_2
gmp=6.3.0=h7bae524_2
graphite2=1.3.13=hebf3989_1003
h11=0.14.0=pyhd8ed1ab_0
h2=4.1.0=pyhd8ed1ab_0
harfbuzz=9.0.0=h997cde5_1
hdf4=4.2.15=h2ee6834_7
hdf5=1.14.4=nompi_ha698983_103
hpack=4.0.0=pyh9f0ad1d_0
httpcore=1.0.7=pyh29332c3_1
httptools=0.6.4=pypi_0
httpx=0.27.2=pyhd8ed1ab_0
hyperframe=6.0.1=pyhd8ed1ab_0
icu=75.1=hfee45f7_0
idna=3.7=py312hca03da5_0
imageio=2.36.0=pypi_0
imjoy-elfinder=0.1.63=pypi_0
imjoy-jupyterlab-extension=0.2.6=pypi_0
imjoy-rpc=0.5.59=pypi_0
imjoy-utils=0.1.2=pypi_0
importlib-metadata=8.5.0=pyha770c72_0
importlib_resources=6.4.5=pyhd8ed1ab_0
ipykernel=6.29.5=pyh57ce528_0
ipython=8.29.0=pyh707e725_0
isoduration=20.11.0=pyhd8ed1ab_0
itkwasm=1.0b185=pypi_0
itkwasm-downsample=1.4.3=pypi_0
itkwasm-downsample-wasi=1.4.3=pypi_0
itkwidgets=1.0a53=pypi_0
jedi=0.19.2=pyhff2d567_0
jinja2=3.1.4=py312hca03da5_1
json5=0.9.28=pyhff2d567_0
jsoncpp=1.9.6=h7b3277c_0
jsonpointer=3.0.0=py312h81bd7bf_1
jsonschema=4.23.0=pyhd8ed1ab_0
jsonschema-specifications=2024.10.1=pyhd8ed1ab_0
jsonschema-with-format-nongpl=4.23.0=hd8ed1ab_0
jupyter-lsp=2.2.5=pyhd8ed1ab_0
jupyter-server-proxy=4.4.0=pypi_0
jupyter_client=8.6.3=pyhd8ed1ab_0
jupyter_core=5.7.2=pyh31011fe_1
jupyter_events=0.10.0=pyhd8ed1ab_0
jupyter_server=2.14.2=pyhd8ed1ab_0
jupyter_server_terminals=0.5.3=pyhd8ed1ab_0
jupyterlab=4.3.1=pyhff2d567_0
jupyterlab_pygments=0.3.0=pyhd8ed1ab_1
jupyterlab_server=2.27.3=pyhd8ed1ab_0
kiwisolver=1.4.7=py312h6142ec9_0
krb5=1.21.3=h237132a_0
lame=3.100=h1a8c8d9_1003
lazy-loader=0.4=pypi_0
lcms2=2.16=ha0e7c42_0
lerc=4.0.0=h9a09cb3_0
libabseil=20240722.0=cxx17_hf9b8971_1
libaec=1.1.3=hebf3989_0
libass=0.17.3=hf20b609_0
libblas=3.9.0=1_h9886b1c_netlib
libbrotlicommon=1.1.0=hd74edd7_2
libbrotlidec=1.1.0=hd74edd7_2
libbrotlienc=1.1.0=hd74edd7_2
libcblas=3.9.0=1_h9886b1c_netlib
libclang-cpp17=17.0.6=default_h146c034_7
libclang13=19.1.4=default_h81d93ff_0
libcurl=8.10.1=h13a7ad3_0
libcxx=19.1.4=ha82da77_0
libdeflate=1.22=hd74edd7_0
libedit=3.1.20191231=hc8eb9b7_2
libev=4.33=h93a5062_2
libexpat=2.6.4=h286801f_0
libffi=3.4.2=h3422bc3_5
libgfortran=5.0.0=13_2_0_hd922786_3
libgfortran5=13.2.0=hf226fd6_3
libglib=2.82.2=h07bd6cf_0
libhwloc=2.11.2=default_hbce5d74_1001
libiconv=1.17=h0d3ecfb_2
libintl=0.22.5=h8414b35_3
libjpeg-turbo=3.0.3=h80987f9_0
liblapack=3.9.0=1_h9886b1c_netlib
libllvm17=17.0.6=h5090b49_2
libllvm19=19.1.4=hc4b4ae8_0
libnetcdf=4.9.2=nompi_h853a48d_115
libnghttp2=1.64.0=h6d7220d_0
libntlm=1.4=h3422bc3_1002
libogg=1.3.5=h99b78c6_0
libopenblas=0.3.21=h269037a_0
libopenvino=2024.4.0=hbfeda7a_2
libopenvino-arm-cpu-plugin=2024.4.0=hbfeda7a_2
libopenvino-auto-batch-plugin=2024.4.0=hf276634_2
libopenvino-auto-plugin=2024.4.0=hf276634_2
libopenvino-hetero-plugin=2024.4.0=h03892cd_2
libopenvino-ir-frontend=2024.4.0=h03892cd_2
libopenvino-onnx-frontend=2024.4.0=h7f5a098_2
libopenvino-paddle-frontend=2024.4.0=h7f5a098_2
libopenvino-pytorch-frontend=2024.4.0=h5833ebf_2
libopenvino-tensorflow-frontend=2024.4.0=h9d544f2_2
libopenvino-tensorflow-lite-frontend=2024.4.0=h5833ebf_2
libopus=1.3.1=h27ca646_1
libpng=1.6.44=hc14010f_0
libpq=17.2=h9b1ab17_0
libprotobuf=5.28.2=h8f0b736_0
librsvg=2.58.4=h40956f1_0
libsodium=1.0.20=h99b78c6_0
libsqlite=3.47.0=hbaaea75_1
libssh2=1.11.1=h9cc3647_0
libtheora=1.1.1=h99b78c6_1006
libtiff=4.7.0=hfce79cd_1
libvorbis=1.3.7=h9f76cd9_0
libvpx=1.14.1=h7bae524_0
libwebp=1.4.0=h54798ee_0
libwebp-base=1.4.0=h93a5062_0
libxcb=1.17.0=hdb1d25a_0
libxml2=2.13.5=hbbdcc80_0
libzip=1.11.2=h1336266_0
libzlib=1.3.1=h8359307_2
llvm-openmp=14.0.6=hc6e5704_0
locket=1.0.0=pypi_0
loguru=0.7.2=py312h81bd7bf_2
lz4-c=1.9.4=hb7217d7_0
markdown-it-py=3.0.0=pypi_0
markupsafe=2.1.3=py312h80987f9_0
matplotlib-base=3.9.2=py312h9bd0bc6_2
matplotlib-inline=0.1.7=pyhd8ed1ab_0
mdurl=0.1.2=pypi_0
mistune=3.0.2=pyhd8ed1ab_0
mpmath=1.3.0=py312hca03da5_0
msgpack-python=1.1.0=py312h6142ec9_0
multidict=6.1.0=py312hdb8e49c_1
munkres=1.1.4=pyh9f0ad1d_0
mysql-common=9.0.1=h0887d5e_2
mysql-libs=9.0.1=he9bc4e1_2
nbclient=0.10.0=pyhd8ed1ab_0
nbconvert-core=7.16.4=pyhd8ed1ab_1
nbformat=5.10.4=pyhd8ed1ab_0
ncurses=6.5=h7bae524_1
nest-asyncio=1.6.0=pyhd8ed1ab_0
networkx=3.2.1=py312hca03da5_0
ngff-zarr=0.9.1=pypi_0
nlohmann_json=3.11.3=h00cdb27_1
notebook-shim=0.2.4=pyhd8ed1ab_0
numcodecs=0.14.1=pypi_0
numpy=2.1.3=py312h94ee1e1_0
openh264=2.5.0=h774163f_0
openjpeg=2.5.2=h54b8e55_0
openldap=2.6.8=h50f2afc_0
openssl=3.4.0=h39f12f2_0
overrides=7.7.0=pyhd8ed1ab_0
packaging=24.2=pyhff2d567_1
pandas=2.2.3=py312hcd31e36_1
pandocfilters=1.5.1=pypi_0
pango=1.54.0=h9ee27a3_2
parso=0.8.4=pyhd8ed1ab_0
partd=1.4.2=pypi_0
pathvalidate=3.2.1=pypi_0
pcre2=10.44=h297a79d_2
pexpect=4.9.0=pyhd8ed1ab_0
pickleshare=0.7.5=py_1003
pillow=11.0.0=py312haf37ca6_0
pip=24.3.1=pyh8b19718_0
pixman=0.43.4=hebf3989_0
pkgutil-resolve-name=1.3.10=pyhd8ed1ab_1
platformdirs=4.3.6=pyhd8ed1ab_0
pooch=1.8.2=pyhd8ed1ab_0
proj=9.5.0=h61a8e3e_0
prometheus_client=0.21.0=pyhd8ed1ab_0
prompt-toolkit=3.0.48=pyha770c72_0
propcache=0.2.0=py312h024a12e_2
psutil=6.1.0=py312h0bf5046_0
pthread-stubs=0.3=h1a28f6b_1
ptyprocess=0.7.0=pyhd3deb0d_0
pugixml=1.14=h13dd4ca_0
pure_eval=0.2.3=pyhd8ed1ab_0
pycparser=2.22=pyhd8ed1ab_0
pydantic=1.10.19=pypi_0
pygments=2.18.0=pyhd8ed1ab_0
pyobjc-core=10.3.1=py312hd24fc31_1
pyobjc-framework-cocoa=10.3.1=py312hd24fc31_1
pyparsing=3.2.0=pyhd8ed1ab_1
pysocks=1.7.1=py312hca03da5_0
python=3.12.7=h739c21a_0_cpython
python-dateutil=2.9.0.post0=pyhff2d567_0
python-dotenv=1.0.1=pypi_0
python-fastjsonschema=2.20.0=pyhd8ed1ab_0
python-json-logger=2.0.7=pyhd8ed1ab_0
python-multipart=0.0.17=pypi_0
python-tzdata=2024.2=pyhd8ed1ab_0
python_abi=3.12=5_cp312
pytorch=2.5.1=py3.12_0
pytz=2024.1=pyhd8ed1ab_0
pyvista=0.44.1=pyhd8ed1ab_0
pyyaml=6.0.2=py312h80987f9_0
pyzmq=26.2.0=py312hf8a1cbd_3
qhull=2020.2=h420ef59_5
qt6-main=6.7.3=h2fbab7f_1
readline=8.2=h92ec313_1
referencing=0.35.1=pyhd8ed1ab_0
requests=2.32.3=py312hca03da5_1
rfc3339-validator=0.1.4=pyhd8ed1ab_0
rfc3986-validator=0.1.1=pyh9f0ad1d_0
rich=13.9.4=pypi_0
rich-argparse=1.6.0=pypi_0
rpds-py=0.21.0=py312hcd83bfe_0
scikit-image=0.24.0=pypi_0
scipy=1.14.1=pypi_0
scooby=0.10.0=pyhd8ed1ab_0
send2trash=1.8.3=pyh31c8845_0
setuptools=75.6.0=pyhff2d567_1
shortuuid=1.0.13=pypi_0
simpervisor=1.0.0=pypi_0
six=1.16.0=pyh6c4a22f_0
snappy=1.2.1=hd02b534_0
sniffio=1.3.1=pyhd8ed1ab_0
soupsieve=2.6=pypi_0
sqlite=3.47.0=hcd14bea_1
stack_data=0.6.2=pyhd8ed1ab_0
starlette=0.41.3=pypi_0
svt-av1=2.3.0=hf24288c_0
sympy=1.13.2=py312hca03da5_0
tbb=2022.0.0=h0cbf7ec_0
tbb-devel=2022.0.0=h6e261d1_0
terminado=0.18.1=pyh31c8845_0
tifffile=2024.9.20=pypi_0
tinycss2=1.4.0=pyhd8ed1ab_0
tk=8.6.13=h5083fa2_1
tomli=2.1.0=pyhff2d567_0
toolz=1.0.0=pypi_0
torchaudio=2.5.1=py312_cpu
torchvision=0.20.1=py312_cpu
tornado=6.4.2=py312hea69d52_0
traitlets=5.14.3=pyhd8ed1ab_0
types-python-dateutil=2.9.0.20241003=pyhff2d567_0
typing-extensions=4.11.0=py312hca03da5_0
typing_extensions=4.11.0=py312hca03da5_0
typing_utils=0.1.0=pyhd8ed1ab_0
tzdata=2024b=hc8b5060_0
unicodedata2=15.1.0=py312h0bf5046_1
uri-template=1.3.0=pyhd8ed1ab_0
urllib3=2.2.3=py312hca03da5_0
utfcpp=4.0.6=h54c0426_0
uvicorn=0.32.1=pypi_0
uvloop=0.21.0=pypi_0
vtk=9.3.1=qt_py312h8d5bf7a_209
vtk-base=9.3.1=qt_py312h679c1d7_209
vtk-io-ffmpeg=9.3.1=qt_py312hf99a90b_209
wasmtime=27.0.2=pypi_0
watchfiles=1.0.0=pypi_0
wcwidth=0.2.13=pyhd8ed1ab_0
webcolors=24.11.1=pypi_0
webencodings=0.5.1=pyhd8ed1ab_2
websocket-client=1.8.0=pyhd8ed1ab_0
websockets=14.1=pypi_0
wheel=0.45.1=pyhd8ed1ab_0
wslink=2.2.1=pyhd8ed1ab_0
x264=1!164.3095=h57fd34a_2
x265=3.5=hbc6ce65_3
xorg-libxau=1.0.11=hd74edd7_1
xorg-libxdmcp=1.1.5=hd74edd7_0
xz=5.2.6=h57fd34a_0
yaml=0.2.5=h1a28f6b_0
yarl=1.18.0=py312hea69d52_0
zarr=2.18.3=pypi_0
zeromq=4.3.5=hc1bb282_7
zipp=3.21.0=pyhd8ed1ab_0
zlib=1.3.1=h8359307_2
zstd=1.5.6=hb46c0d2_0

EDIT:

  • I've also tried the suggested solutions above, including image=True.
  • After some further testing we were able to get the vtk example to fail as well due to the server not having an X server (fairly obvious); however this does not explain why we are seeing the same behaviour for gempy on my mac.

@flohorovicic
Copy link
Member

Thank you for the additional explanations and the details on environment, @EternalDeiwos!

I tried with a fresh install on MacOS 13.7 and it works for me with the inline plot using image=True. For the external plot: does it open at all? If so: can you try pressing "Q" in the external plot window and check if you can then access the code in the Notebook again?

Also, looking at your installs: can you try in a normal Jupyter notebook instead of JupyterLab?

Concerning the install on Ubuntu: this could be due to a problem in an external package. Can you try adding these two:

sudo apt install libgl1-mesa-glx xvfb --fix-missing

@EternalDeiwos
Copy link

EternalDeiwos commented Nov 27, 2024

Both the inline and external plots killed the kernel without any error message or explanation.

On the VM, I tried to troubleshoot the vtk demo and installed xfvb and libglx as you describe above but that produced another error. I’ll reproduce it and post it here when I can.

I did manage to get the vtk demo to work on my Mac once I installed trame, but calling plot_3d still crashed the kernel without explanation. I was also not able to reproduce running the vtk demo using trame on the VM due to the lack of an X server, also having xfvb etc. installed.

Regarding Jupyter notebook, this suggestion seems odd to me since it has been deprecated for some time. I can take another pass at this but it doesn’t seem likely to be the source of a problem.

@EternalDeiwos
Copy link

Okay, I have managed to get it to work on a fresh VM following these instructions

conda install nodejs  # required when importing pyvista in Jupyter
pip install pyvista trame
sudo apt-get update
sudo apt install libgl1-mesa-glx xvfb --fix-missing

# Can be skipped if using the helper
export DISPLAY=:99.0
export PYVISTA_OFF_SCREEN=true
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &

# Run Jupyter Lab
jupyter lab
from pyvista import demos
demos.plot_wave()

The reason why this worked is probably because I didn't set the environment variables or start xvfb. I also found that pyvista has a helper for this; @malflink you should add this to your script:

import pyvista
# Sets up env vars and starts xvfb server
pyvista.start_xvfb()
VTK demo

The warning is a non-issue; installing trame-vuetify fixes that problem but not necessary for testing.

image

@javoha
Copy link
Member

javoha commented Nov 28, 2024

Hello @EternalDeiwos,

thanks a lot for the detailed solution. It looks like this is a Pyvista/VM/Remote server issue though, correct?

@malflink can you confirm that this works for you?

@malflink
Copy link
Author

malflink commented Nov 28, 2024 via email

@flohorovicic
Copy link
Member

Thanks for the detailed answer!

However, not sure what you mean with the Jupyter notebooks - I am using them, for example, in VS Code https://code.visualstudio.com/docs/datascience/jupyter-notebooks and, as far as I know, they are still part of the Anaconda distribution, etc.

Anyway, great to see that you found a way to get pyvista working.

@malflink
Copy link
Author

Hi,
So I did the following, as suggested by @EternalDeiwos
import pyvista

Sets up env vars and starts xvfb server

pyvista.start_xvfb()

and also:

gpv.plot_3d(geo_model, image=True, plotter_type='basic')
download

hopefully, you may be able to see the image, but it works!

merci beucoup

@malflink
Copy link
Author

malflink commented Dec 1, 2024

Hi
So I have been successful in processing all of Ch1_1, except the last 'adding topography' section. Chunking is done, but the message says 'UserWarning: Matplotlib is currently using module://matplotlib_inline.backend_inline, which is a non-GUI backend, so cannot show the figure.
p.fig.show()'

Is there another method to plot the topography 3d block?
Thks mike

Adding topography
In gempy we can add more grid types for different purposes. We will explore this concept in more detail in the next tutorials (:doc:ch1_3a_grids). For now, we will just add a topography grid to our model. This grid allows us to intersect the surfaces as well as compute a high resolution geological mal.

gp.set_topography_from_random(
grid=geo_model.grid,
fractal_dimension=1.2,
d_z=np.array([350, 750]),
topography_resolution=np.array([50, 50]),
)

gp.compute_model(geo_model)
gpv.plot_2d(geo_model, show_topography=True)

gpv.plot_3d(
model=geo_model,
plotter_type='basic',
show_topography=True,
show_surfaces=True,
show_lith=True,
image=False
)
Active grids: GridTypes.NONE|TOPOGRAPHY|OCTREE
Setting Backend To: AvailableBackends.numpy
Chunking done: 20 chunks
Chunking done: 20 chunks

/user/env/lib/python3.10/site-packages/gempy_viewer/API/_plot_2d_API.py:174: UserWarning: Matplotlib is currently using module://matplotlib_inline.backend_inline, which is a non-GUI backend, so cannot show the figure.
p.fig.show()

@ikalmalik
Copy link

How to determine and calculate orientation data if, for example, I only have data points. It is an obstacle because it cannot be formed into a 3D model. Is there a solution? and what is the meaning of the data_path in the Gempy package example on Github? because an error occurred when creating a gp.model_create

image
Here's an example of a data overview from the point

Please help, because this is very important to me.

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants