Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added command oq info apply_uncertainty #10431

Merged
merged 1 commit into from
Mar 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[Michele Simionato]
* Added command `oq info apply_uncertainty`
* Added an extractor `losses_by_site`
* Improved `oq info sources` and `oq show relevant_sources:<IMT>`
* Internal: accepted `source_model_file` in place of
Expand Down
18 changes: 11 additions & 7 deletions openquake/commands/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from openquake.baselib import config, hdf5
from openquake.baselib.general import groupby, gen_subclasses, humansize
from openquake.baselib.performance import Monitor
from openquake.hazardlib import nrml, imt, logictree, site, geo
from openquake.hazardlib import nrml, imt, logictree, site, geo, lt
from openquake.hazardlib.geo.packager import fiona
from openquake.hazardlib.gsim.base import registry
from openquake.hazardlib.mfd.base import BaseMFD
Expand Down Expand Up @@ -286,10 +286,14 @@ def main(what, report=False):
print(param)
print(docs[param])
elif what == 'loss_types':
ltypes = [lt for lt in scientific.LOSSTYPE
if '+' not in lt and '_ins' not in lt]
for lt in sorted(ltypes):
print(lt)
ltypes = [ltype for ltype in scientific.LOSSTYPE
if '+' not in ltype and '_ins' not in ltype]
for ltype in sorted(ltypes):
print(ltype)
elif what == 'apply_uncertainty':
uncs = [unc for unc in lt.apply_uncertainty if unc != 'dummy']
for i, unc in enumerate(sorted(uncs), 1):
print('%02d' % i, unc)
elif what.startswith('mfd'):
print_subclass(what, BaseMFD)
elif what.startswith('msr'):
Expand Down Expand Up @@ -374,12 +378,12 @@ def main(what, report=False):
print('Generated', reportwriter.build_report(what))
else:
oq = readinput.get_oqparam(what)
lt = readinput.get_logic_tree(oq)
ltree = readinput.get_logic_tree(oq)
size = humansize(oq.get_input_size())
print('calculation_mode: %s' % oq.calculation_mode)
print('description: %s' % oq.description)
print('input size: %s' % size)
for bset in lt.branchsets:
for bset in ltree.branchsets:
pprint(bset.to_list())
if mon.duration > 1:
print(mon)
Expand Down