Skip to content

Commit

Permalink
Fixed import from hazardlib.tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Sep 25, 2024
1 parent ba31d20 commit 0ce529d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openquake/commands/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import pandas
from openquake.hazardlib import (
valid, nrml, sourceconverter, sourcewriter, logictree)
from openquake.hazardlib.tests.gsim.utils import reduce_gsim_test
from openquake.baselib import general


Expand Down Expand Up @@ -98,6 +97,8 @@ def main(fname, reduction_factor: valid.probability,
print('Extracted %d rows out of %d' % (len(arr), len(array)))
return
elif fname.endswith('_test.py'):
# tests are not installed, so this import cannot stay at top-level
from openquake.hazardlib.tests.gsim.utils import reduce_gsim_test
print(reduce_gsim_test(fname, reduction_factor))
return
node = nrml.read(fname)
Expand Down

0 comments on commit 0ce529d

Please sign in to comment.