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
109 stars 56 forks source link

Establish an `xtgeo.io` module #1126

Closed mferrera closed 6 months ago

mferrera commented 6 months ago

Currently reading and writing logic is sat next to value manipulation/inference logic. With supporting so many different file formats and more to come in the future, it makes sense to work toward separating reading and writing out to its own module. This should reduce the apparent complexity of the code and let some abstractions fall out of it.

It should also help to generalize, or at least wrap, some of the current complexity related to supporting both imported files and memory streams in a generic manner.

A reasonable first step is probably moving _XTGeoFile out of xtgeo.common.sys and to xtgeo.io._file_wrapper as a FileWrapper class (or something similar).