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

Split up `xtgeo.metadata.metadata` into per-object submodules #1155

Open mferrera opened 5 months ago

mferrera commented 5 months ago

Currently metadata objects for all xtgeo objects are kept in the xtgeo.metadata.metadata module. This module needs access to all the major xtgeo types to do instance checking which complicates the dependency chain.

For example, a RegularSurface needs the MetaDataRegularSurface object from xtgeo.metadata.metadata to store in RegularSurface._metadata. Thus the dependency chain looks like this

RegularSurface <- xtgeo.metadata.metadata <- Cube, Grid, Well, etc... <- RegularSurface
                             ^________________<_________________<______________v

The MetaData objects in xtgeo.metadata should be split either into their own submodules within the metadata package, or parceled out to the objects they represent respectively.

Not clear if the metadata package is relied upon elsewhere, but I don't think it is.