|
33 | 33 | from openquake.baselib import config, hdf5
|
34 | 34 | from openquake.baselib.general import groupby, gen_subclasses, humansize
|
35 | 35 | from openquake.baselib.performance import Monitor
|
36 |
| -from openquake.hazardlib import nrml, imt, logictree, site, geo |
| 36 | +from openquake.hazardlib import nrml, imt, logictree, site, geo, lt |
37 | 37 | from openquake.hazardlib.geo.packager import fiona
|
38 | 38 | from openquake.hazardlib.gsim.base import registry
|
39 | 39 | from openquake.hazardlib.mfd.base import BaseMFD
|
@@ -286,10 +286,14 @@ def main(what, report=False):
|
286 | 286 | print(param)
|
287 | 287 | print(docs[param])
|
288 | 288 | elif what == 'loss_types':
|
289 |
| - ltypes = [lt for lt in scientific.LOSSTYPE |
290 |
| - if '+' not in lt and '_ins' not in lt] |
291 |
| - for lt in sorted(ltypes): |
292 |
| - print(lt) |
| 289 | + ltypes = [ltype for ltype in scientific.LOSSTYPE |
| 290 | + if '+' not in ltype and '_ins' not in ltype] |
| 291 | + for ltype in sorted(ltypes): |
| 292 | + print(ltype) |
| 293 | + elif what == 'apply_uncertainty': |
| 294 | + uncs = [unc for unc in lt.apply_uncertainty if unc != 'dummy'] |
| 295 | + for i, unc in enumerate(sorted(uncs), 1): |
| 296 | + print('%02d' % i, unc) |
293 | 297 | elif what.startswith('mfd'):
|
294 | 298 | print_subclass(what, BaseMFD)
|
295 | 299 | elif what.startswith('msr'):
|
@@ -374,12 +378,12 @@ def main(what, report=False):
|
374 | 378 | print('Generated', reportwriter.build_report(what))
|
375 | 379 | else:
|
376 | 380 | oq = readinput.get_oqparam(what)
|
377 |
| - lt = readinput.get_logic_tree(oq) |
| 381 | + ltree = readinput.get_logic_tree(oq) |
378 | 382 | size = humansize(oq.get_input_size())
|
379 | 383 | print('calculation_mode: %s' % oq.calculation_mode)
|
380 | 384 | print('description: %s' % oq.description)
|
381 | 385 | print('input size: %s' % size)
|
382 |
| - for bset in lt.branchsets: |
| 386 | + for bset in ltree.branchsets: |
383 | 387 | pprint(bset.to_list())
|
384 | 388 | if mon.duration > 1:
|
385 | 389 | print(mon)
|
|
0 commit comments