Skip to content

Commit

Permalink
Fixed valid.dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Oct 21, 2024
1 parent 729324b commit 2db8459
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions openquake/hazardlib/valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,20 +980,11 @@ def dictionary(value):
raise ValueError('%r is not a valid Python dictionary' % value)

for key, val in dic.items():
try:
has_logscale = (val[0] == 'logscale')
except IndexError: # no val[0]
continue
if has_logscale:
dic[key] = list(logscale(*val[1:]))

try:
has_linscale = (val[0] == 'linscale')
except IndexError: # no val[0]
continue
if has_linscale:
dic[key] = list(linscale(*val[1:]))

if isinstance(val, tuple):
if val[0] == 'logscale':
dic[key] = list(logscale(*val[1:]))
elif val[0] == 'linscale':
dic[key] = list(linscale(*val[1:]))
return dic


Expand Down

0 comments on commit 2db8459

Please sign in to comment.