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], username=None)[source]
  • calc_id – a calculation ID
  • username – if given, restrict the search to the user’s calculations

the associated DataStore instance

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

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

  • job_ini (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.
  • username – Name of the user running the job
  • kw – Extra parameters like hazard_calculation_id and calculation_mode
openquake.commands.engine.run_tile(job_ini, sites_slice)[source]

Used in tiling calculations

openquake.commands.engine.smart_run(job_ini, oqparam, log_level, log_file, exports, reuse_hazard)[source]

Run calculations by storing their hazard checksum and reusing previous calculations if requested.

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

plot_uhs command

openquake.commands.plot_uhs.make_figure(indices, n_sites, oq, pmaps)[source]
  • indices – the indices of the sites under analysis
  • n_sites – total number of sites
  • oq – instance of OqParam
  • 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

openquake.commands.reduce.reduce_source_model(fname, reduction_factor)[source]
openquake.commands.reduce.save_bak(fname, node, num_nodes, total)[source]

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, calc_id, concurrent_tasks, pdb, loglevel, exports, params)[source]

Run both hazard and risk, one after the other

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]