openquake.commands package

openquake.commands.export module

openquake.commands.info module

openquake.commands.info.do_build_reports(directory)[source]

Walk the directory and builds pre-calculation reports for all the job.ini files found.

openquake.commands.info.print_csm_info(fname)[source]

Parse the composite source model without instantiating the sources and prints information about its composition and the full logic tree

openquake.commands.plot module

openquake.commands.plot.make_figure(indices, imtls, spec_curves, curves=(), label='')[source]
Parameters:
  • indices – the indices of the sites under analysis
  • imtls – ordered dictionary with the IMTs and levels
  • spec_curves – a dictionary of curves IMT -> array(n_sites, n_levels)
  • curves – a dictionary of dictionaries IMT -> array
  • label – the label associated to spec_curves

openquake.commands.plot_sites module

openquake.commands.purge module

openquake.commands.purge.purge_one(calc_id, user)[source]

Remove one calculation ID from the database and remove its datastore

openquake.commands.reduce module

openquake.commands.reduce.random_filter(objects, reduction_factor, seed=42)[source]

Given a list of objects, returns a sublist by extracting randomly some elements. The reduction factor (< 1) tells how small is the extracted list compared to the original list.

openquake.commands.run module

class openquake.commands.run.PStatData(ncalls, tottime, percall, cumtime, percall2, path)

Bases: tuple

cumtime

Alias for field number 3

ncalls

Alias for field number 0

path

Alias for field number 5

percall

Alias for field number 2

percall2

Alias for field number 4

tottime

Alias for field number 1

openquake.commands.run.get_pstats(pstatfile, n)[source]

Return profiling information as an RST table.

Parameters:
  • pstatfile – path to a .pstat file
  • n – the maximum number of stats to retrieve
openquake.commands.run.run2(job_haz, job_risk, concurrent_tasks, pdb, exports, params, monitor)[source]

Run both hazard and risk, one after the other

openquake.commands.show module

openquake.commands.show.get_hcurves_and_means(dstore)[source]

Extract hcurves from the datastore and compute their means.

Returns:curves_by_rlz, mean_curves

openquake.commands.show_attrs module

openquake.commands.tidy module

openquake.commands.upgrade_nrml module

openquake.commands.upgrade_nrml.get_vulnerability_functions_04(fname)[source]

Parse the vulnerability model in NRML 0.4 format.

Parameters:fname – path of the vulnerability file
Returns:a dictionary imt, taxonomy -> vulnerability function + vset
openquake.commands.upgrade_nrml.upgrade_file(path)[source]

Upgrade to the latest NRML version