openquake.commands package¶
db command¶
dbserver command¶
engine command¶
-
openquake.commands.engine.
del_calculation
(job_id, confirmed=False)[source]¶ Delete a calculation and all associated outputs.
-
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: int = None, hazard_calculation_id: int = None, list_outputs: int = None, show_log=None, export_output=None, export_outputs=None, param='', config_file=None, exports='', log_level='info')[source]¶ Run a calculation using the traditional command line API
export command¶
from_shapefile command¶
info command¶
-
openquake.commands.info.
do_build_reports
(directory)[source]¶ Walk the directory and builds pre-calculation reports for all the job.ini files found.
plot command¶
-
class
openquake.commands.plot.
PolygonPlotter
(ax)[source]¶ Bases:
object
Add polygons to a given axis object
-
openquake.commands.plot.
main
(what, calc_id: int = -1, others: int = [], webapi=False, local=False)[source]¶ Generic plotter for local and remote calculations.
-
openquake.commands.plot.
make_figure_agg_curves
(extractors, what)[source]¶ $ oq plot “agg_curves?kind=mean&loss_type=structural” -1
-
openquake.commands.plot.
make_figure_avg_gmf
(extractors, what)[source]¶ $ oq plot “avg_gmf?imt=gmv_0”
-
openquake.commands.plot.
make_figure_disagg
(extractors, what)[source]¶ $ oq plot “disagg?kind=Mag&imt=PGA”
-
openquake.commands.plot.
make_figure_effect_by_mag
(extractors, what)[source]¶ $ oq plot “effect_by_mag?”
-
openquake.commands.plot.
make_figure_gridded_sources
(extractors, what)[source]¶ $ oq plot “gridded_sources?task_no=0”
-
openquake.commands.plot.
make_figure_hcurves
(extractors, what)[source]¶ $ oq plot “hcurves?kind=mean&imt=PGA&site_id=0”
-
openquake.commands.plot.
make_figure_hmaps
(extractors, what)[source]¶ $ oq plot “hmaps?kind=mean&imt=PGA”
-
openquake.commands.plot.
make_figure_rups_by_mag_dist
(extractors, what)[source]¶ $ oq plot “rups_by_mag_dist?”
-
openquake.commands.plot.
make_figure_rupture_info
(extractors, what)[source]¶ $ oq plot “rupture_info?min_mag=6”
-
openquake.commands.plot.
make_figure_sources
(extractors, what)[source]¶ $ 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)[source]¶ $ oq plot “task_info?kind=classical”
-
openquake.commands.plot.
make_figure_tot_curves
(extractors, what)[source]¶ $ oq plot “tot_curves?loss_type=structural&kind=rlz-000&absolute=1”
purge command¶
sample command¶
-
openquake.commands.sample.
main
(fname, reduction_factor: <openquake.hazardlib.valid.FloatRange object at 0x7fc9f1014a90>)[source]¶ 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.
reset command¶
run command¶
-
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.
main
(job_ini, pdb=False, reuse_input=False, *, slowest: int = None, hc: int = None, param='', concurrent_tasks: int = None, exports: <openquake.hazardlib.valid.Choices object at 0x7fc9f0f96080> = '', loglevel='info', calc_id='nojob')[source]¶ Run a calculation bypassing the database layer
show command¶
show_attrs command¶
tidy command¶
to_hdf5 command¶
to_shapefile command¶
-
openquake.commands.to_shapefile.
main
(input_nrml_file, validate=False, *, output=None)[source]¶ Convert a NRML source model file to ESRI Shapefile(s).
For each type of source geometry defined in the NRML file (point, area, simple fault, complex fault, planar) a separate shapefile is created. Each shapefile is differentiated by a specific ending(‘_point’, ‘_area’, ‘_simple’, ‘_complex’, ‘_planar’).
NB: nonparametric sources are not supported.
upgrade_nrml command¶
-
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