From 7a0172531655523323c2a2aad7f40e596563bd60 Mon Sep 17 00:00:00 2001 From: Patrick Sauvan Date: Tue, 6 Aug 2024 22:19:08 +0200 Subject: [PATCH 1/2] Update data_classes.py fix bad black format of PR #265 and add small modifications --- src/geouned/GEOUNED/utils/data_classes.py | 25 ++++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/geouned/GEOUNED/utils/data_classes.py b/src/geouned/GEOUNED/utils/data_classes.py index 6891224d..45b0a876 100644 --- a/src/geouned/GEOUNED/utils/data_classes.py +++ b/src/geouned/GEOUNED/utils/data_classes.py @@ -769,18 +769,19 @@ 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): return self._voidExclude From 849786b90fa6c71dc4d6fb21e9c7da64f310561a Mon Sep 17 00:00:00 2001 From: Patrick Sauvan Date: Tue, 6 Aug 2024 22:23:16 +0200 Subject: [PATCH 2/2] Update data_classes.py black is black --- src/geouned/GEOUNED/utils/data_classes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geouned/GEOUNED/utils/data_classes.py b/src/geouned/GEOUNED/utils/data_classes.py index 45b0a876..1c5fd15f 100644 --- a/src/geouned/GEOUNED/utils/data_classes.py +++ b/src/geouned/GEOUNED/utils/data_classes.py @@ -781,7 +781,7 @@ def voidMat(self, voidMat: list): 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): return self._voidExclude