openquake.commands package

db command


Convert strings into literal Python objects

dbserver command

engine command

openquake.commands.engine.del_calculation(job_id, confirmed=False)[source]

Delete a calculation and all associated outputs.

openquake.commands.engine.get_job_id(job_id, username=None)[source]
openquake.commands.engine.run_job(cfg_file, log_level='info', log_file=None, exports='', hazard_calculation_id=None, username='jenkins', **kw)[source]

Run a job using the specified config file and other options.

  • cfg_file (str) – Path to calculation config (INI-style) files.
  • log_level (str) – ‘debug’, ‘info’, ‘warn’, ‘error’, or ‘critical’
  • log_file (str) – Path to log file.
  • exports – A comma-separated string of export types requested by the user.
  • hazard_calculation_id – ID of the previous calculation or None
  • username – Name of the user running the job
openquake.commands.engine.run_tile(job_ini, sites_slice)[source]

Used in tiling calculations

export command

from_shapefile command

info command[source]

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

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

Extract information about NRML/0.5 source models. Returns a table with TRTs as rows and source classes as columns.

plot_agg_curve command


plot command

openquake.commands.plot.get_pmaps(dstore, indices)[source]
openquake.commands.plot.make_figure(indices, n, imtls, spec_curves, curves=(), label='')[source]
  • indices – the indices of the sites under analysis
  • n – the total number of sites
  • 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

plot_sites command

openquake.commands.plot_sites.cross(lonlat, width, height)[source]
openquake.commands.plot_sites.fix_polygon(poly, idl)[source]

plot_uhs command

openquake.commands.plot_uhs.make_figure(indices, n_sites, imtls, poes, pmaps)[source]
  • indices – the indices of the sites under analysis
  • n_sites – total number of sites
  • imtls – DictArray with the IMTs and levels
  • poes – PoEs used to compute the hazard maps
  • pmaps – a list of probability maps per realization

purge command

openquake.commands.purge.purge_all(user=None, fast=False)[source]

Remove all calculations of the given user

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

Remove one calculation ID from the database and remove its datastore

reduce command

reset command

run command

class, tottime, percall, cumtime, percall2, path)

Bases: tuple


Alias for field number 3


Alias for field number 0


Alias for field number 5


Alias for field number 2


Alias for field number 4


Alias for field number 1, n)[source]

Return profiling information as an RST table.

  • pstatfile – path to a .pstat file
  • n – the maximum number of stats to retrieve, job_risk, concurrent_tasks, pdb, exports, params)[source]

Run both hazard and risk, one after the other

run_tiles command

show command[source]

Extract hcurves from the datastore and compute their means.

Returns:curves_by_rlz, mean_curves

show_attrs command

tidy command

to_hdf5 command

openquake.commands.to_hdf5.convert_npz_hdf5(input_file, output_file)[source]
openquake.commands.to_hdf5.convert_xml_hdf5(input_file, output_file)[source]

to_shapefile command

upgrade_nrml command


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, multipoint)[source]

Upgrade to the latest NRML version

webui command

openquake.commands.webui.rundjango(subcmd, hostport=None, skip_browser=False)[source]