svir.dialogs package

Submodules

svir.dialogs.attribute_selection_dialog module

class svir.dialogs.attribute_selection_dialog.AttributeSelectionDialog(loss_layer, zonal_layer)[source]

Bases: PyQt4.QtGui.QDialog, Ui_AttributeSelctionDialog

Modal dialog giving to the user the possibility to select what are the attributes, in the loss layer and in the region layer, that contain the loss data and the region id

accept()[source]
on_zone_id_attr_name_zone_cbox_currentIndexChanged(new_index)[source]
set_ok_button()[source]

svir.dialogs.download_layer_dialog module

class svir.dialogs.download_layer_dialog.DownloadLayerDialog(iface, downloader)[source]

Bases: PyQt4.QtGui.QDialog, Ui_DownloadLayerDialog

Modal dialog giving to the user the possibility to select and download one of the projects available on the OQ-Platform

accept()[source]
get_capabilities()[source]
on_layers_lst_itemDoubleClicked(item)[source]
on_layers_lst_itemSelectionChanged()[source]
parse_get_capabilities(xml)[source]
set_ok_button()[source]

svir.dialogs.drive_oq_engine_server_dialog module

class svir.dialogs.drive_oq_engine_server_dialog.DriveOqEngineServerDialog(iface, viewer_dock)[source]

Bases: PyQt4.QtGui.QDialog, Ui_DriveEngineServerDialog

Non-modal dialog to drive the OpenQuake Engine Server’s API. Through this, it is possible to run calculations, delete them, list them, visualize their outputs and loading them as vector layers.

attempt_login()[source]
check_engine_compatibility()[source]
clear_output_list()[source]
connect_button_to_action(button, action, output, outtype)[source]
download_output(output_id, outtype, dest_folder=None)[source]
get_calc_log(calc_id)[source]
get_calc_status(calc_id)[source]
get_engine_version()[source]
get_output_list(calc_id)[source]
get_row_by_calc_id(calc_id)[source]
highlight_and_scroll_to_calc_id(calc_id)[source]
is_lockdown()[source]
login()[source]
on_calc_action_btn_clicked(calc_id, action)[source]
on_calc_list_tbl_cellClicked(row, column)[source]
on_download_datastore_btn_clicked()[source]
on_output_action_btn_clicked(output, action, outtype)[source]
on_run_calc_btn_clicked()[source]
on_same_fs(checksum_file_path, ipt_checksum)[source]
on_show_calc_params_btn_clicked()[source]
refresh_calc_list()[source]
reject()[source]
remove_calc(calc_id)[source]
run_calc(calc_id=None, file_names=None, directory=None)[source]

Run a calculation. If calc_id is given, it means we want to run a calculation re-using the output of the given calculation

set_calc_list_widths(widths)[source]
show_output_list(output_list, calculation_mode)[source]
start_polling()[source]
stop_polling()[source]
update_output_list(calc_id)[source]

svir.dialogs.load_dmg_by_asset_as_layer_dialog module

class svir.dialogs.load_dmg_by_asset_as_layer_dialog.LoadDmgByAssetAsLayerDialog(iface, viewer_dock, output_type='dmg_by_asset', path=None, mode=None, zonal_layer_path=None)[source]

Bases: svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog

Modal dialog to load dmg_by_asset from an oq-engine output, as layer

add_field_to_layer(field_name)[source]
build_layer_name(rlz_or_stat, **kwargs)[source]
get_field_names(**kwargs)[source]
group_by_site(npz, rlz_or_stat, loss_type, dmg_state, taxonomy='All')[source]
load_from_npz()[source]
on_loss_type_changed()[source]
on_rlz_or_stat_changed()[source]
populate_dmg_state_cbx()[source]
populate_taxonomy_cbx(taxonomies)[source]
read_npz_into_layer(field_names, **kwargs)[source]
set_ok_button()[source]

svir.dialogs.load_gmf_data_as_layer_dialog module

class svir.dialogs.load_gmf_data_as_layer_dialog.LoadGmfDataAsLayerDialog(iface, viewer_dock, output_type='gmf_data', path=None, mode=None)[source]

Bases: svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog

Modal dialog to load gmf_data from an oq-engine output, as layer

add_field_to_layer(field_name)[source]
build_layer_name(rlz_or_stat, **kwargs)[source]
get_field_names(**kwargs)[source]
load_from_npz()[source]
on_imt_changed()[source]
on_rlz_or_stat_changed()[source]
populate_rlz_or_stat_cbx()[source]
read_npz_into_layer(field_names, **kwargs)[source]
set_ok_button()[source]

svir.dialogs.load_hcurves_as_layer_dialog module

class svir.dialogs.load_hcurves_as_layer_dialog.LoadHazardCurvesAsLayerDialog(iface, viewer_dock, output_type='hcurves', path=None, mode=None)[source]

Bases: svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog

Modal dialog to load hazard curves from an oq-engine output, as layer

add_field_to_layer(field_name)[source]
build_layer_name(**kwargs)[source]
get_field_names(**kwargs)[source]
load_from_npz()[source]
populate_dataset()[source]
populate_out_dep_widgets()[source]
read_npz_into_layer(field_names, **kwargs)[source]
set_ok_button()[source]
show_num_sites()[source]

svir.dialogs.load_hmaps_as_layer_dialog module

class svir.dialogs.load_hmaps_as_layer_dialog.LoadHazardMapsAsLayerDialog(iface, viewer_dock, output_type='hmaps', path=None, mode=None)[source]

Bases: svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog

Modal dialog to load hazard maps from an oq-engine output, as layer

add_field_to_layer(field_name)[source]
build_layer_name(rlz_or_stat, **kwargs)[source]
get_field_names(**kwargs)[source]
load_from_npz()[source]
on_imt_changed()[source]
on_rlz_or_stat_changed()[source]
populate_rlz_or_stat_cbx()[source]
read_npz_into_layer(field_names, **kwargs)[source]
set_ok_button()[source]
show_num_sites()[source]

svir.dialogs.load_losses_by_asset_as_layer_dialog module

class svir.dialogs.load_losses_by_asset_as_layer_dialog.LoadLossesByAssetAsLayerDialog(iface, viewer_dock, output_type='losses_by_asset', path=None, mode=None, zonal_layer_path=None)[source]

Bases: svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog

Modal dialog to load losses by asset from an oq-engine output, as layer

add_field_to_layer(field_name)[source]
build_layer_name(rlz_or_stat, **kwargs)[source]
get_field_names(**kwargs)[source]
group_by_site(npz, rlz_or_stat, loss_type, taxonomy='All')[source]
load_from_npz()[source]
on_rlz_or_stat_changed()[source]
populate_taxonomy_cbx(taxonomies)[source]
read_npz_into_layer(field_names, **kwargs)[source]
set_ok_button()[source]

svir.dialogs.load_output_as_layer_dialog module

class svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog(iface, viewer_dock, output_type=None, path=None, mode=None, zonal_layer_path=None)[source]

Bases: PyQt4.QtGui.QDialog, Ui_LoadOutputAsLayerDialog

Modal dialog to load an oq-engine output as layer

accept()[source]
add_field_to_layer(field_name)[source]
build_layer(rlz_or_stat=None, taxonomy=None, poe=None, loss_type=None, dmg_state=None)[source]
build_layer_name(rlz_or_stat, **kwargs)[source]
create_dmg_state_selector()[source]
create_eid_selector()[source]
create_imt_selector()[source]
create_load_selected_only_ckb()[source]
create_loss_type_selector()[source]
create_num_sites_indicator()[source]
create_poe_selector()[source]
create_rlz_or_stat_selector()[source]
create_save_as_shp_ckb()[source]
create_taxonomy_selector()[source]
create_zonal_layer_selector()[source]
get_field_names(**kwargs)[source]
get_investigation_time()[source]
get_taxonomies()[source]
load_from_npz()[source]
load_zonal_layer(zonal_layer_path, make_a_copy=False)[source]
on_dmg_state_changed()[source]
on_eid_changed()[source]
on_file_browser_tbn_clicked()[source]
on_imt_changed()[source]
on_loss_type_changed()[source]
on_output_type_changed()[source]
on_poe_changed()[source]
on_rlz_or_stat_changed()[source]
on_zonal_layer_cbx_currentIndexChanged(new_index)[source]
on_zonal_layer_tbn_clicked()[source]
open_file_dialog()[source]

Open a file dialog to select the data file to be loaded

open_zonal_layer_dialog()[source]

Open a file dialog to select the zonal layer to be loaded :returns: the zonal layer

populate_loss_type_cbx(loss_types)[source]
populate_out_dep_widgets()[source]
populate_rlz_or_stat_cbx()[source]
populate_zonal_layer_cbx(zonal_layer_plus_stats)[source]
pre_populate_zonal_layer_cbx()[source]
read_npz_into_layer(field_names, **kwargs)[source]
reject()[source]
set_ok_button()[source]
show_num_sites()[source]
style_curves()[source]
style_maps()[source]

svir.dialogs.load_ruptures_as_layer_dialog module

class svir.dialogs.load_ruptures_as_layer_dialog.LoadRupturesAsLayerDialog(iface, viewer_dock, output_type='ruptures', path=None, mode=None)[source]

Bases: svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog

Modal dialog to load ruptures from an oq-engine output, as layer

load_from_csv()[source]
populate_out_dep_widgets()[source]
set_ok_button()[source]

svir.dialogs.load_uhs_as_layer_dialog module

class svir.dialogs.load_uhs_as_layer_dialog.LoadUhsAsLayerDialog(iface, viewer_dock, output_type='uhs', path=None, mode=None)[source]

Bases: svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog

Modal dialog to load uniform hazard spectra from an oq-engine output, as layer

add_field_to_layer(field_name)[source]
build_layer_name(**kwargs)[source]
get_field_names(**kwargs)[source]
load_from_npz()[source]
on_rlz_or_stat_changed()[source]
populate_dataset()[source]
populate_out_dep_widgets()[source]
read_npz_into_layer(field_names, **kwargs)[source]
set_ok_button()[source]
show_num_sites()[source]

svir.dialogs.plot_from_npz_dialog module

svir.dialogs.projects_manager_dialog module

class svir.dialogs.projects_manager_dialog.ProjectsManagerDialog(iface)[source]

Bases: PyQt4.QtGui.QDialog, Ui_ProjectsManagerDialog

Modal dialog allowing to select (and possibly edit) one of the project definitions available for the active layer, or for creating a new project definition

add_proj_def(title, proj_def=None)[source]
display_proj_def_raw()[source]
get_selected_proj_def()[source]
get_suppl_info()[source]
on_add_proj_def_btn_clicked()[source]
on_clone_btn_clicked()[source]
on_proj_def_cbx_currentIndexChanged()[source]
on_proj_def_descr_textChanged()[source]
on_proj_def_raw_textChanged()[source]
on_proj_def_title_textEdited()[source]
populate_proj_def_cbx()[source]
update_form()[source]
update_proj_def_descr()[source]
update_proj_def_title()[source]
update_title_in_combo()[source]

svir.dialogs.recovery_modeling_dialog module

class svir.dialogs.recovery_modeling_dialog.RecoveryModelingDialog(iface)[source]

Bases: PyQt4.QtGui.QDialog, Ui_RecoveryModelingDialog

Modal dialog to perform recovery modeling analysis.

accept()[source]
calculate_community_level_recovery_curve(point_attrs_dict, integrate_svi=True)[source]
on_approach_cbx_currentIndexChanged(selected_text)[source]
on_dmg_by_asset_layer_cbx_currentIndexChanged(selected_index)[source]
on_output_data_dir_btn_clicked()[source]
on_output_data_dir_le_textChanged(text)[source]
on_svi_layer_cbx_currentIndexChanged(selected_index)[source]
populate_layers_in_combos()[source]
restore_state()[source]

Reinstate the options based on the user’s stored session info.

save_state()[source]

Store the options into the user’s stored session info.

set_ok_button()[source]

svir.dialogs.recovery_settings_dialog module

class svir.dialogs.recovery_settings_dialog.RecoverySettingsDialog(iface)[source]

Bases: PyQt4.QtGui.QDialog, Ui_RecoverySettingsDialog

Modal dialog to set parameters for recovery modeling analysis.

accept()[source]
on_n_loss_based_dmg_states_sbx_valueChanged(n_loss_based_dmg_states)[source]
on_n_recovery_based_dmg_states_sbx_valueChanged(n_recovery_based_dmg_states)[source]
on_restore_defaults_btn_clicked()[source]
restore_setting_1d_table(name, table)[source]
restore_setting_2d_table(name, table)[source]
restore_setting_number(name, widget, val_type)[source]
restore_state(restore_defaults=False)[source]

Reinstate the options based on the user’s stored session info.

save_setting_1d_table(name, table, val_type)[source]
save_setting_2d_table(name, table, val_type, check_row_sum_to_1=False)[source]
save_setting_number(name, value, val_type)[source]
save_state()[source]

Store the options into the user’s stored session info.

set_ok_button()[source]

svir.dialogs.select_input_layers_dialog module

class svir.dialogs.select_input_layers_dialog.SelectInputLayersDialog(iface)[source]

Bases: PyQt4.QtGui.QDialog, Ui_SelectInputLayersDialog

Modal dialog allowing to select a raster or vector layer containing loss data points and a vector layer containing polygons that define the zones for which data need to be aggregated. When both are selected and are valid files, they can be loaded by clicking OK

accept()[source]
static attribute_selection(loss_layer, zonal_layer)[source]

Open a modal dialog containing combo boxes, allowing the user to select what are the attribute names for * loss values (from loss layer) * zone id (from loss layer) * zone id (from zonal layer)

enable_ok_button_if_both_layers_are_specified()[source]
import_loss_layer_from_csv(csv_file_path, dest_shp=None, delete_lon_lat=False)[source]
load_loss_layer(loss_layer_path)[source]
load_zonal_layer(zonal_layer_path)[source]
on_loss_layer_tbn_clicked()[source]
on_purge_chk_stateChanged(state)[source]
on_zonal_layer_tbn_clicked()[source]
open_file_dialog(dialog_type)[source]

Open a file dialog to select the data file to be loaded :param string dialog_type: ‘loss_layer’ or ‘zonal_layer’ :returns: a layer

populate_cbx()[source]

svir.dialogs.select_sv_variables_dialog module

class svir.dialogs.select_sv_variables_dialog.SelectSvVariablesDialog(downloader)[source]

Bases: PyQt4.QtGui.QDialog, Ui_SelectSvVariablesDialog

Modal dialog giving to the user the possibility to select social vulnerability variables to import from the oq-platform

fill_countries()[source]
fill_names()[source]
fill_subthemes(theme)[source]
fill_themes()[source]
on_filter_btn_clicked()[source]
on_theme_cbx_currentIndexChanged()[source]
set_ok_button()[source]
update_indicator_info(item)[source]

svir.dialogs.settings_dialog module

class svir.dialogs.settings_dialog.SettingsDialog(iface, irmt_main=None, parent=None)[source]

Bases: PyQt4.QtGui.QDialog, Ui_SettingsDialog

Dialog used to specify the connection settings used to interact with the OpenQuake Platform or the OpenQuake Engine, and to toggle the developer mode option.

accept()[source]

Method invoked when OK button is clicked.

on_restore_default_settings_btn_clicked()[source]
on_style_color_from_clicked()[source]
on_style_color_to_clicked()[source]
restore_state(restore_defaults=False)[source]

Reinstate the options based on the user’s stored session info.

Parameters:restore_defaults – if True, settings will be reset to the default values, instead of reading them from the user’s stored info
save_state()[source]

Store the options into the user’s stored session info.

select_color(button)[source]
set_button_color(button, color)[source]

svir.dialogs.show_console_dialog module

class svir.dialogs.show_console_dialog.ShowConsoleDialog(driver_dialog, calc_id)[source]

Bases: PyQt4.QtGui.QDialog, Ui_Dialog

Non-modal dialog to display the console log of a OQ-Engine calculation

refresh_calc_log()[source]

svir.dialogs.show_full_report_dialog module

class svir.dialogs.show_full_report_dialog.ShowFullReportDialog(filepath)[source]

Bases: PyQt4.QtGui.QDialog, Ui_Dialog

Non-modal dialog to show the full report of a OQ-Engine calculation

svir.dialogs.show_params_dialog module

class svir.dialogs.show_params_dialog.ShowParamsDialog[source]

Bases: PyQt4.QtGui.QDialog, Ui_Dialog

Non-modal dialog to show the parameters of a OQ-Engine calculation

svir.dialogs.transformation_dialog module

class svir.dialogs.transformation_dialog.TransformationDialog(iface)[source]

Bases: PyQt4.QtGui.QDialog, Ui_TransformationDialog

Modal dialog giving to the user the possibility to transform one or multiple attributes in the active layer, using one of the available algorithms and variants.

fill_fields_multiselect()[source]
on_algorithm_cbx_currentIndexChanged()[source]
on_calc_btn_clicked()[source]
on_new_field_name_txt_editingFinished()[source]
on_new_field_name_txt_textEdited()[source]
on_overwrite_ckb_stateChanged()[source]
on_variant_cbx_currentIndexChanged()[source]
reload_variant_cbx()[source]
set_new_field_editable()[source]
set_ok_button()[source]
update_default_fieldname()[source]

svir.dialogs.upload_dialog module

class svir.dialogs.upload_dialog.UploadDialog(iface, file_stem)[source]

Bases: PyQt4.QtGui.QDialog, Ui_UploadMetadataDialog

Modal dialog allowing to upload the data to the OQ-Platform

load_finished()[source]
showEvent(event)[source]
upload()[source]
upload_done(result)[source]
upload_successful

svir.dialogs.upload_settings_dialog module

class svir.dialogs.upload_settings_dialog.UploadSettingsDialog(iface, suppl_info, file_stem)[source]

Bases: PyQt4.QtGui.QDialog, Ui_UploadSettingsDialog

Dialog allowing the user to set some of the fields that will be written into the metadata xml, including the selection of one of the available licenses. The user must click on a confirmation checkbox, before the uploading of the layer can be started.

accept()[source]
on_confirm_chk_stateChanged()[source]
on_license_info_btn_clicked()[source]
on_update_radio_toggled(on)[source]
on_zone_label_field_cbx_currentIndexChanged()[source]
set_labels()[source]
set_license()[source]
set_ok_button()[source]
set_zone_label_field()[source]

svir.dialogs.viewer_dock module

class svir.dialogs.viewer_dock.ViewerDock(iface, action)[source]

Bases: PyQt4.QtGui.QDockWidget, Ui_ViewerDock

change_output_type(output_type)[source]
clear_imt_cbx()[source]
clear_loss_type_cbx()[source]
clear_plot()[source]
closeEvent(event)[source]
create_approach_selector()[source]
create_exclude_no_dmg_ckb()[source]
create_fields_multiselect()[source]
create_imt_selector()[source]
create_list_selected_edt()[source]
create_loss_type_selector()[source]
create_n_simulations_spinbox()[source]
create_poe_selector()[source]
create_recalculate_curve_btn()[source]
create_rlz_selector()[source]
create_rlzs_multiselect()[source]
create_stats_multiselect()[source]
create_tag_names_multiselect()[source]
create_tag_values_multiselect()[source]
draw()[source]
draw_agg_curves(output_type)[source]
draw_dmg_by_asset_aggr()[source]

Plots the total damage distribution

draw_losses_by_asset_aggr()[source]
extract_npz(session, hostname, calc_id, output_type, params=None)[source]
filter_dmg_by_asset_aggr()[source]
filter_losses_by_asset_aggr()[source]
layer_changed()[source]
load_agg_curves(calc_id, session, hostname, output_type)[source]
load_dmg_by_asset_aggr(calc_id, session, hostname, output_type)[source]
load_losses_by_asset_aggr(calc_id, session, hostname, output_type)[source]
load_no_map_output(calc_id, session, hostname, output_type)[source]
on_approach_changed()[source]
on_bw_chk_clicked()[source]
on_container_hover(event, container)[source]
on_exclude_no_dmg_ckb_state_changed(state)[source]
on_export_data_button_clicked()[source]
on_imt_changed()[source]
on_loss_type_changed(loss_type)[source]
on_n_simulations_changed()[source]
on_output_type_cbx_currentIndexChanged(index)[source]
on_plot_hover(event)[source]
on_poe_changed()[source]
on_recalculate_curve_btn_clicked()[source]
on_rlz_changed()[source]
populate_tag_values_multiselect(item)[source]
redraw(selected, deselected, _)[source]

Accepting parameters from QgsVectorLayer selectionChanged signal

Parameters:
  • selected – newly selected feature ids NOTE - if you add features to the selection, the list contains all features, including those that were already selected before
  • deselected – ids of all features which have previously been selected but are not any more
  • _ – ignored (in case this is set to true, the old selection was dismissed and the new selection corresponds to selected
redraw_current_selection()[source]
redraw_recovery_curve(selected)[source]
refresh_feature_selection()[source]
remove_connects()[source]
set_output_type_and_its_gui(new_output_type)[source]
update_list_selected_edt()[source]
update_selected_tag_names()[source]
update_selected_tag_values()[source]
write_export_file(filename)[source]

svir.dialogs.weight_data_dialog module

class svir.dialogs.weight_data_dialog.WeightDataDialog(iface, project_definition)[source]

Bases: PyQt4.QtGui.QDialog, Ui_WeightDataDialog

Modal dialog allowing to select weights in a d3.js visualization

ACTIVE_LAYER_NUMERIC_FIELDS
ACTIVE_LAYER_NUMERIC_FIELDS_ALIASES
DEFAULT_OPERATOR
DEV_MODE
NODE_TYPES
OPERATORS
clean_json(data)[source]
closeEvent(event)[source]
handle_json_updated(data)[source]
json_cleaned
json_str
json_updated
on_print_btn_clicked()[source]
on_style_by_field_cbx_currentIndexChanged()[source]
populate_style_by_field_cbx()[source]
print_self_for_debug()[source]
reject()[source]
setup_js()[source]
show_tree()[source]
update_active_layer_numeric_fields()[source]
update_project_definition(project_definition)[source]

Module contents