gimli-org / gimli

Geophysical Inversion and Modeling Library :earth_africa:
https://www.pygimli.org
Other
377 stars 137 forks source link

colab and /tmp #750

Open mariosgeo opened 3 months ago

mariosgeo commented 3 months ago

Problem description

/tmp mesh files are not found

Your environment

Please provide the output of print(pygimli.Report()) here. If that does not work, please give provide some additional information on your:

Operating system: e.g. Colab Python version: 3.10, pyGIMLi version: 1.5.1 Way of installation: pip.

from pygimli.physics import ert
import pygimli as pg
import pygimli.meshtools as mt

data=ert.load('trial4.pyg')
plc = mt.createParaMeshPLC3D(data, paraDepth=-1, paraMaxCellSize=00.0,
                             surfaceMeshQuality=34)
mesh = mt.createMesh(plc, quality=1.3)

...

Expected behavior

Make a mesh

Actual behavior

I think the tempfile directory is different in colab and local installs. Is there any flag we can save the tempfiles to e.g. googledrive install of /tmp?. The mesh is created when run locally.

[/usr/local/lib/python3.10/dist-packages/pygimli/meshtools/mesh.py](https://localhost:8080/#) in readTetgen(fName, comment, verbose, defaultCellMarker, loadFaces, quadratic)
    961 
    962     # Part 1/3: Nodes, essential
--> 963     with open(fName + '.node', 'r') as node_in:
    964         node_lines = pg.utils.filterLinesByCommentStr(node_in.readlines(),
    965                                                       comment)

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpqu_t6iw8-1.node'
mariosgeo commented 3 months ago

follow up. The .poly files are on the /tmp folder. Not the .node ones

halbmy commented 3 months ago

It seems like instead of the command-line based tetgen the installed pacakge is a wrapper for connecting pyVista: https://pypi.org/project/tetgen/

halbmy commented 3 months ago

We would have to change things to work with that. However, I am not sure about potential licensing issues as tetgen was always kind of restrictive.