Skip to content

Commit 97122a5

Browse files
committed
fix: allow model to set any type of feature using basefeature subclass check
1 parent 6972062 commit 97122a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

LoopStructural/modelling/core/geological_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
UnconformityFeature,
2222
StructuralFrame,
2323
GeologicalFeature,
24+
BaseFeature,
2425
FeatureType,
2526
)
2627
from ...modelling.features.fold import (
@@ -341,7 +342,7 @@ def __setitem__(self, feature_name, feature):
341342
feature : GeologicalFeature
342343
the geological feature to set
343344
"""
344-
if not isinstance(feature, GeologicalFeature):
345+
if not issubclass(type(feature), BaseFeature):
345346
raise TypeError("feature must be a GeologicalFeature")
346347
if feature.name != feature_name:
347348
raise ValueError("feature name does not match key")

0 commit comments

Comments
 (0)