Skip to content

Commit

Permalink
jz - UX supported IM type in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyan1214 committed Aug 26, 2024
1 parent 869c699 commit 0ab0129
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ def __init__(self):

def setIMT(self, imt): # noqa: N802, D102
if imt not in self.supportedImt:
sys.exit(f'The imt {imt} is not supported by Chiou and Young (2014)')
# supported_imt = []
# for i in self.supportedImt:
# if i is float:
# supported_imt.append(i)
supported_imt = [f'SA{x}s' if isinstance(x, float) else x for x in self.supportedImt]
sys.exit(f'The IM type {imt} is not supported by Chiou and Young (2014). \n The supported IM types are {supported_imt}')
return False
self.c1 = self.coeff['c1'][imt]
self.c1a = self.coeff['c1a'][imt]
Expand Down Expand Up @@ -337,8 +342,9 @@ def __init__(self):

def setIMT(self, imt): # noqa: N802, D102
if imt not in self.supportedImt:
supported_imt = [f'SA{x}s' if isinstance(x, float) else x for x in self.supportedImt]
sys.exit(
f'The imt {imt} is not supported by Abrahamson, Silva, and Kamai (2014)'
f'The IM type {imt} is not supported by Abrahamson, Silva, and Kamai (2014). \n The supported IM types are {supported_imt}'
)
return
self.imt = imt
Expand Down Expand Up @@ -636,8 +642,9 @@ def __init__(self):

def setIMT(self, imt): # noqa: N802, D102
if imt not in self.supportedImt:
supported_imt = [f'SA{x}s' if isinstance(x, float) else x for x in self.supportedImt]
sys.exit(
f'The imt {imt} is not supported by Boore, Stewart, Seyhan & Atkinson (2014)'
f'The IM type {imt} is not supported by Boore, Stewart, Seyhan & Atkinson (2014). \n The supported IM types are {supported_imt}'
)
return
self.imt = imt
Expand Down Expand Up @@ -863,8 +870,9 @@ def __init__(self):

def setIMT(self, imt): # noqa: N802, D102
if imt not in self.supportedImt:
supported_imt = [f'SA{x}s' if isinstance(x, float) else x for x in self.supportedImt]
sys.exit(
f'The imt {imt} is not supported by Campbell & Bozorgnia (2014)'
f'The IM type {imt} is not supported by Campbell & Bozorgnia (2014). \n The supported IM types are {supported_imt}'
)
return
self.imt = imt
Expand Down

0 comments on commit 0ab0129

Please sign in to comment.