Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance checker in void mat #267

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/geouned/GEOUNED/utils/data_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,17 +769,18 @@ def voidMat(self):
def voidMat(self, voidMat: list):
if not isinstance(voidMat, list):
raise TypeError(f"geouned.Settings.voidMat should be a list, not a {type(voidMat)}")
if len(voidMat) == 0:
self._voidMat = voidMat
else:
if not isinstance(voidMat[0], int):
raise TypeError(f"first entry of geouned.Settings.voidMat should be an int, not a {type(entry)}")
if not isinstance(voidMat[1], int):
if not isinstance(voidMat[1], float):
raise TypeError(f"second entry of geouned.Settings.voidMat should be an int or float, not a {type(entry)}")
if not isinstance(voidMat[2], str):
raise TypeError(f"third entry of geouned.Settings.voidMat should be a str, not a {type(entry)}")
self._voidMat = voidMat
if len(voidMat) == 3:
entry0, entry1, entry2 = voidMat
if not isinstance(entry0, int):
raise TypeError(f"first entry of geouned.Settings.voidMat should be an int, not a {type(entry0)}")
if not isinstance(entry1, int):
if not isinstance(entry1, float):
raise TypeError(f"second entry of geouned.Settings.voidMat should be an int or float, not a {type(entry1)}")
if not isinstance(entry2, str):
raise TypeError(f"third entry of geouned.Settings.voidMat should be a str, not a {type(entry2)}")
elif len(voidMat) > 0:
raise TypeError(f"geouned.Settings.voidMat should be a list with 3 elements or void list")
self._voidMat = voidMat

@property
def voidExclude(self):
Expand Down
Loading