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).
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 ofxtgeo.common.sys
and toxtgeo.io._file_wrapper
as aFileWrapper
class (or something similar).