equinor / xtgeo

XTGeo Python class library for subsurface Surfaces, Cubes, Wells, Grids, Points, etc
https://xtgeo.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
110 stars 56 forks source link

Refactor `Grid.get_geometrics` and remove private `_ver` argument from public method #1090

Open tnatt opened 9 months ago

tnatt commented 9 months ago

The Grid.get_geometrics method has two alternative methods that can be run to extract grid geometry information. Which one to run is controlled by the _ver argument inside the method. The _ver argument is intended to be private and should be removed from the public method.

https://github.com/equinor/xtgeo/blob/896de3b466cce33fcbed7c1a6bdd09801d6ef16c/src/xtgeo/grid3d/grid.py#L2179

Version 1 is the primary/default method to use, but version 2 was made as there seems to be a bug in the first version for a specific set of arguments. However version 2 will also only work for a specific set of arguments allcells=True and cellcenter=True ...

Currently the only place inside XTGeo where version 2 is used is when creating surfaces from 3d grid and no template surface has been provided. https://github.com/equinor/xtgeo/blob/896de3b466cce33fcbed7c1a6bdd09801d6ef16c/src/xtgeo/surface/_regsurf_grid3d.py#L152-L154

It should be looked into if the bug can be fixed, which would eliminate the need for two different methods.