Skip to content

Commit 0e75342

Browse files
committed
fix: linting
1 parent ef50c46 commit 0e75342

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

LoopStructural/modelling/core/geological_model.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def from_file(cls, file):
371371
logger.error("Cannot import from file, dill not installed")
372372
return None
373373
model = pickle.load(open(file, "rb"))
374-
if type(model) == GeologicalModel:
374+
if isinstance(model, GeologicalModel):
375375
logger.info("GeologicalModel initialised from file")
376376
return model
377377
else:
@@ -423,7 +423,7 @@ def faults(self):
423423
"""
424424
faults = []
425425
for f in self.features:
426-
if type(f) == FaultSegment:
426+
if isinstance(f, FaultSegment):
427427
faults.append(f)
428428

429429
return faults
@@ -556,7 +556,7 @@ def data(self, data: pd.DataFrame):
556556
"""
557557
if data is None:
558558
return
559-
if type(data) != pd.DataFrame:
559+
if not issubclass(type(data), pd.DataFrame):
560560
logger.warning("Data is not a pandas data frame, trying to read data frame " "from csv")
561561
try:
562562
data = pd.read_csv(data)
@@ -821,7 +821,7 @@ def create_and_add_folded_foliation(
821821
if fold_frame is None:
822822
logger.info("Using last feature as fold frame")
823823
fold_frame = self.features[-1]
824-
assert type(fold_frame) == FoldFrame, "Please specify a FoldFrame"
824+
assert isinstance(fold_frame, FoldFrame), "Please specify a FoldFrame"
825825

826826
fold = FoldEvent(fold_frame, name=f"Fold_{foliation_data}", invert_norm=invert_fold_norm)
827827

@@ -908,7 +908,7 @@ def create_and_add_folded_fold_frame(
908908
if fold_frame is None:
909909
logger.info("Using last feature as fold frame")
910910
fold_frame = self.features[-1]
911-
assert type(fold_frame) == FoldFrame, "Please specify a FoldFrame"
911+
assert isinstance(fold_frame, FoldFrame), "Please specify a FoldFrame"
912912
fold = FoldEvent(fold_frame, name=f"Fold_{fold_frame_data}")
913913

914914
interpolatortypes = [

LoopStructural/modelling/features/_base_geological_feature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def model(self, model):
110110
from LoopStructural import GeologicalModel
111111

112112
# causes circular import, could delay import?
113-
if type(model) == GeologicalModel:
113+
if isinstance(model, GeologicalModel):
114114
self._model = model
115115
elif not model:
116116
self._model = None

0 commit comments

Comments
 (0)