Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Aug 5, 2024
1 parent ef50c46 commit 0e75342
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def from_file(cls, file):
logger.error("Cannot import from file, dill not installed")
return None
model = pickle.load(open(file, "rb"))
if type(model) == GeologicalModel:
if isinstance(model, GeologicalModel):
logger.info("GeologicalModel initialised from file")
return model
else:
Expand Down Expand Up @@ -423,7 +423,7 @@ def faults(self):
"""
faults = []
for f in self.features:
if type(f) == FaultSegment:
if isinstance(f, FaultSegment):
faults.append(f)

return faults
Expand Down Expand Up @@ -556,7 +556,7 @@ def data(self, data: pd.DataFrame):
"""
if data is None:
return
if type(data) != pd.DataFrame:
if not issubclass(type(data), pd.DataFrame):
logger.warning("Data is not a pandas data frame, trying to read data frame " "from csv")
try:
data = pd.read_csv(data)
Expand Down Expand Up @@ -821,7 +821,7 @@ def create_and_add_folded_foliation(
if fold_frame is None:
logger.info("Using last feature as fold frame")
fold_frame = self.features[-1]
assert type(fold_frame) == FoldFrame, "Please specify a FoldFrame"
assert isinstance(fold_frame, FoldFrame), "Please specify a FoldFrame"

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

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

interpolatortypes = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def model(self, model):
from LoopStructural import GeologicalModel

# causes circular import, could delay import?
if type(model) == GeologicalModel:
if isinstance(model, GeologicalModel):
self._model = model
elif not model:
self._model = None
Expand Down

0 comments on commit 0e75342

Please sign in to comment.