Skip to content

Commit 53a49dd

Browse files
committed
fix: adding case when strat column hasn't been set
1 parent ceeee02 commit 53a49dd

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

LoopStructural/modelling/core/geological_model.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,8 @@ def get_stratigraphic_surfaces(self, units: List[str] = [], bottoms: bool = True
17781778
## TODO change the stratigraphic column to its own class and have methods to get the relevant surfaces
17791779
surfaces = []
17801780
units = []
1781+
if self.stratigraphic_column is None:
1782+
return []
17811783
for group in self.stratigraphic_column.keys():
17821784
if group == "faults":
17831785
continue
@@ -1842,14 +1844,15 @@ def save(
18421844
else:
18431845
grid.save(f'{name}_block_model.{extension}')
18441846
if stratigraphic_data:
1845-
for group in self.stratigraphic_column.keys():
1846-
if group == "faults":
1847-
continue
1848-
for series in self.stratigraphic_column[group].keys():
1849-
if extension == ".geoh5":
1850-
self.__getitem__(series).save(filename)
1851-
else:
1852-
self.__getitem__(series).save(f'{name}_{series}.{extension}')
1847+
if self.stratigraphic_column is not None:
1848+
for group in self.stratigraphic_column.keys():
1849+
if group == "faults":
1850+
continue
1851+
for series in self.stratigraphic_column[group].keys():
1852+
if extension == ".geoh5":
1853+
self.__getitem__(series).save(filename)
1854+
else:
1855+
self.__getitem__(series).save(f'{name}_{series}.{extension}')
18531856
if fault_data:
18541857
for f in self.fault_names():
18551858
if extension == ".geoh5":

0 commit comments

Comments
 (0)