Convert strings into literal Python objects
- openquake.commands.db.main(cmd, args=())¶
Run a database command
- openquake.commands.dbserver.main(cmd, dbhostport=None, foreground=False, *, loglevel='INFO')¶
start/stop/restart the database server, or return its status
- openquake.commands.engine.del_calculation(job_id, confirmed=False)¶
Delete a calculation and all associated outputs.
- openquake.commands.engine.get_job_id(job_id, username=None)¶
- openquake.commands.engine.main(no_distribute=False, yes=False, upgrade_db=False, db_version=False, what_if_I_upgrade=False, list_hazard_calculations=False, list_risk_calculations=False, delete_uncompleted_calculations=False, multi=False, reuse_input=False, *, log_file=None, make_html_report=None, run=None, delete_calculation: Optional[int] = None, hazard_calculation_id: Optional[int] = None, list_outputs: Optional[int] = None, show_log=None, export_output=None, export_outputs=None, param='', config_file=None, exports='', log_level='info')¶
Run a calculation using the traditional command line API
- openquake.commands.export.main(datastore_key, calc_id: int = - 1, *, exports='csv', export_dir='.')¶
Export an output from the datastore. To see the available datastore keys, use the command oq info exports.
Walk the directory and builds pre-calculation reports for all the job.ini files found.
True if the name of the function starts with an uppercase character
- openquake.commands.info.main(what, report=False)¶
Give information about the passed keyword or filename
Extract information about source models. Returns a table with TRTs as rows and source classes as columns.
- openquake.commands.plot.main(what, calc_id: int = - 1, others: int = , webapi=False, local=False)¶
Generic plotter for local and remote calculations.
- openquake.commands.plot.make_figure_agg_curves(extractors, what)¶
$ oq plot “agg_curves?kind=mean&loss_type=structural” -1
- openquake.commands.plot.make_figure_avg_gmf(extractors, what)¶
$ oq plot “avg_gmf?imt=PGA”
- openquake.commands.plot.make_figure_csq_curves(extractors, what)¶
$ oq plot “csq_curves?agg_id=0&loss_type=structural&consequence=losses” -1
- openquake.commands.plot.make_figure_disagg(extractors, what)¶
$ oq plot “disagg?kind=Mag&imt=PGA&poe_id=0”
- openquake.commands.plot.make_figure_dist_by_mag(extractors, what)¶
$ oq plot “dist_by_mag?”
- openquake.commands.plot.make_figure_effect(extractors, what)¶
$ oq plot “effect?”
- openquake.commands.plot.make_figure_effect_by_mag(extractors, what)¶
$ oq plot “effect_by_mag?”
- openquake.commands.plot.make_figure_gridded_sources(extractors, what)¶
$ oq plot “gridded_sources?task_no=0”
- openquake.commands.plot.make_figure_hcurves(extractors, what)¶
$ oq plot “hcurves?kind=mean&imt=PGA&site_id=0”
- openquake.commands.plot.make_figure_hmaps(extractors, what)¶
$ oq plot “hmaps?kind=mean&imt=PGA”
- openquake.commands.plot.make_figure_memory(extractors, what)¶
$ oq plot “memory?”
- openquake.commands.plot.make_figure_rups_by_mag_dist(extractors, what)¶
$ oq plot “rups_by_mag_dist?”
- openquake.commands.plot.make_figure_rupture_info(extractors, what)¶
$ oq plot “rupture_info?min_mag=6”
- openquake.commands.plot.make_figure_source_data(extractors, what)¶
$ oq plot “source_data?taskno=XX”
- openquake.commands.plot.make_figure_sources(extractors, what)¶
$ oq plot “sources?limit=100” $ oq plot “sources?source_id=1&source_id=2” $ oq plot “sources?code=A&code=N”
- openquake.commands.plot.make_figure_task_info(extractors, what)¶
$ oq plot “task_info?kind=classical”
- openquake.commands.plot.make_figure_tot_curves(extractors, what)¶
$ oq plot “tot_curves?loss_type=structural&kind=rlz-000&absolute=1”
- openquake.commands.plot.make_figure_uhs(extractors, what)¶
$ oq plot “uhs?kind=mean&site_id=0”
- openquake.commands.plot.make_figure_uhs_cluster(extractors, what)¶
$ oq plot “uhs_cluster?k=12”
- openquake.commands.plot.make_figure_vs30(extractors, what)¶
$ oq plot “vs30?”
Plot a WKT string describing a polygon
- openquake.commands.plot.stacked_bar(ax, x, ys, width)¶
- openquake.commands.purge.main(calc_id: int, force=False)¶
Remove the given calculation. If you want to remove all calculations, use oq reset.
Remove all calculations of the given user
- openquake.commands.purge.purge_one(calc_id, user, force)¶
Remove one calculation ID from the database and remove its datastore
- openquake.commands.sample.main(fname, reduction_factor: <openquake.hazardlib.valid.FloatRange object at 0x7f57718e1460>)¶
Produce a submodel from fname by sampling the nodes randomly. Supports source models, site models and exposure models. As a special case, it is also able to reduce .csv files by sampling the lines. This is a debugging utility to reduce large computations to small ones.
- openquake.commands.sample.reduce_source_model(fname, reduction_factor)¶
- openquake.commands.sample.save_bak(fname, node, num_nodes, total)¶
Remove all the datastores and the database of the current user
- class openquake.commands.run.PStatData(ncalls, tottime, percall, cumtime, percall2, path)¶
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
- openquake.commands.run.get_pstats(pstatfile, n)¶
Return profiling information as an ORG table.
pstatfile – path to a .pstat file
n – the maximum number of stats to retrieve
- openquake.commands.run.main(job_ini, pdb=False, reuse_input=False, *, slowest: typing.Optional[int] = None, hc: typing.Optional[int] = None, param='', concurrent_tasks: typing.Optional[int] = None, exports: <openquake.hazardlib.valid.Choices object at 0x7f5786b792b0> = '', loglevel='info')¶
Run a calculation
- openquake.commands.show.main(what='contents', calc_id: openquake.commands.show.str_or_int = - 1, extra=())¶
Show the content of a datastore (by default the last one).
- openquake.commands.show_attrs.main(key, calc_id: int = - 1)¶
Show the attributes of a HDF5 dataset in the datastore.
Reformat a NRML file in a canonical form. That also means reducing the precision of the floats to a standard value. If the file is invalid, a clear error message is shown.
- openquake.commands.to_hdf5.convert_npz_hdf5(input_file, output_file)¶
- openquake.commands.to_hdf5.convert_xml_hdf5(input_file, output_file)¶
Convert .xml and .npz files to .hdf5 files.
Parse the vulnerability model in NRML 0.4 format.
fname – path of the vulnerability file
a dictionary imt, taxonomy -> vulnerability function + vset
- openquake.commands.upgrade_nrml.main(directory, dry_run=False, multipoint=False)¶
Upgrade all the NRML files contained in the given directory to the latest NRML version. Works by walking all subdirectories. WARNING: there is no downgrade!
- openquake.commands.upgrade_nrml.upgrade_file(path, multipoint)¶
Upgrade to the latest NRML version