equinor/xtgeo

Refactor `XYZ` base class methods dependent on derived classes

mferrera opened this issue · 0 comments

Some methods in XYZ have a dependency on instances of classes derived from it. For example,

def operation_polygons_v2(self, poly, value, opname="add", inside=True, where=True):

This function is "part of" the XYZ class but expects poly to be a Polygons instance, which is a class derived from XYZ.

Not clear if just making these abstract methods in XYZ is the best choice, there might be a better one.

There might be other cases of this in which _xyz_something.py modules are imported into subclass modules.