# svir.dialogs package

## Submodules

## svir.dialogs.download_layer_dialog module

class `svir.dialogs.download_layer_dialog.``DownloadLayerDialog`(iface, downloader)

  Bases: `PyQt5.QtWidgets.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`()
  `get_capabilities`()
  `on_layers_lst_itemDoubleClicked`(item)
  `on_layers_lst_itemSelectionChanged`()
  `parse_get_capabilities`(xml)
  `set_ok_button`()

## svir.dialogs.drive_oq_engine_server_dialog module

class `svir.dialogs.drive_oq_engine_server_dialog.``DriveOqEngineServerDialog`(iface, viewer_dock, hostname=None)

  Bases: `PyQt5.QtWidgets.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`()
  `check_engine_compatibility`()
  `clear_output_list`()
  `connect_button_to_action`(button, action, output, outtype)
  `del_dlg`(dlg_id)
  `del_task`(task_id)
  `get_calc_info`(calc_id)
  `get_calc_log`(calc_id)
  `get_calc_status`(calc_id)
  `get_engine_version`()
  `get_output_list`(calc_id)
  `get_row_by_calc_id`(calc_id)
  `highlight_and_scroll_to_calc_id`(calc_id)
  `login`()
  `notify_downloaded`(output_id=None, output_type=None, filepath=None)
  `notify_error`(exc)
  `on_calc_action_btn_clicked`(calc_id, action)
  `on_calc_list_tbl_cellClicked`(row, column)
  `on_download_datastore_btn_clicked`()
  `on_output_action_btn_clicked`(output, action, outtype)
  `on_reconnect_btn_clicked`()
  `on_run_calc_btn_clicked`()
  `on_same_fs`(checksum_file_path, ipt_checksum)
  `on_show_calc_params_btn_clicked`()
  `on_zip_downloaded`(output_id=None, output_type=None, filepath=None)
  `open_full_report`(output_id=None, output_type=None, filepath=None)
  `open_output`(output_id=None, output_type=None, filepath=None)
  `refresh_calc_list`()
  `reject`()
  `remove_calc`(calc_id, abort=False)
  `run_calc`(calc_id=None, file_names=None, directory=None, use_default_ini=False)

    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)
  `set_gui_enabled`(enabled)
  `show_output_list`(output_list, calculation_mode)
  `start_polling`()
  `stop_polling`()
  `update_output_list`(calc_id)

## svir.dialogs.load_dmg_by_asset_as_layer_dialog module

class `svir.dialogs.load_dmg_by_asset_as_layer_dialog.``LoadDmgByAssetAsLayerDialog`(iface, viewer_dock, session, hostname, calc_id, output_type='dmg_by_asset', path=None, mode=None, zonal_layer_path=None, engine_version=None)

  Bases: `svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog`

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

  `add_field_to_layer`(field_name)
  `build_layer_name`(rlz_or_stat=None, **kwargs)
  `finalize_init`(extracted_npz)
  `get_field_names`(**kwargs)
  `group_by_site`(npz, rlz_or_stat, loss_type, dmg_state, taxonomy='All')
  `load_from_npz`()
  `on_aggregate_by_site_ckb_toggled`(on)
  `on_loss_type_changed`()
  `on_rlz_or_stat_changed`()
  `on_zonal_layer_gbx_toggled`(on)
  `populate_dmg_state_cbx`()
  `populate_out_dep_widgets`()
  `populate_taxonomy_cbx`(taxonomies)
  `read_npz_into_layer`(field_names, **kwargs)
  `read_npz_into_layer_aggr_by_site`(field_names, **kwargs)
  `read_npz_into_layer_no_aggr`(field_names, **kwargs)
  `set_ok_button`()

## svir.dialogs.load_gmf_data_as_layer_dialog module

class `svir.dialogs.load_gmf_data_as_layer_dialog.``LoadGmfDataAsLayerDialog`(iface, viewer_dock, session, hostname, calc_id, output_type='gmf_data', path=None, mode=None, engine_version=None)

  Bases: `svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog`

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

  `add_field_to_layer`(field_name)
  `build_layer_name`(gsim=None, **kwargs)
  `get_field_names`(**kwargs)
  `load_from_npz`()
  `on_imt_changed`()
  `on_rlz_or_stat_changed`()
  `populate_rlz_or_stat_cbx`()
  `read_npz_into_layer`(field_names, rlz_or_stat, **kwargs)
  `set_ok_button`()
  `show_num_sites`()

## svir.dialogs.load_hcurves_as_layer_dialog module

class `svir.dialogs.load_hcurves_as_layer_dialog.``LoadHazardCurvesAsLayerDialog`(iface, viewer_dock, session, hostname, calc_id, output_type='hcurves', path=None, mode=None, engine_version=None)

  Bases: `svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog`

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

  `add_field_to_layer`(field_name)
  `build_layer_name`(**kwargs)
  `get_field_names`(**kwargs)
  `load_from_npz`()
  `on_iml_changed`()
  `on_imt_changed`()
  `on_rlz_or_stat_changed`()
  `populate_dataset`()
  `populate_out_dep_widgets`()
  `populate_rlz_or_stat_cbx`()
  `read_npz_into_layer`(field_names, **kwargs)
  `set_ok_button`()
  `show_num_sites`()

## svir.dialogs.load_hmaps_as_layer_dialog module

class `svir.dialogs.load_hmaps_as_layer_dialog.``LoadHazardMapsAsLayerDialog`(iface, viewer_dock, session, hostname, calc_id, output_type='hmaps', path=None, mode=None, engine_version=None)

  Bases: `svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog`

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

  `add_field_to_layer`(field_name)
  `build_layer_name`(rlz_or_stat=None, **kwargs)
  `get_field_names`(**kwargs)
  `load_from_npz`()
  `on_imt_changed`()
  `on_load_multicol_ckb_stateChanged`(state)
  `on_rlz_or_stat_changed`()
  `populate_rlz_or_stat_cbx`()
  `read_npz_into_layer`(field_names, **kwargs)
  `set_ok_button`()
  `show_num_sites`()

## svir.dialogs.load_losses_by_asset_as_layer_dialog module

class `svir.dialogs.load_losses_by_asset_as_layer_dialog.``LoadLossesByAssetAsLayerDialog`(iface, viewer_dock, session, hostname, calc_id, output_type=None, path=None, mode=None, zonal_layer_path=None, engine_version=None)

  Bases: `svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog`

  Dialog to load losses by asset or average asset losses from an oq-engine output, as layer

  `add_field_to_layer`(field_name)
  `build_layer_name`(rlz_or_stat=None, **kwargs)
  `finalize_init`(extracted_npz)
  `get_field_names`(**kwargs)
  `group_by_site`(npz, rlz_or_stat, loss_type, taxonomy='All')
  `load_from_npz`()
  `on_rlz_or_stat_changed`()
  `populate_out_dep_widgets`()
  `populate_taxonomy_cbx`(taxonomies)
  `read_npz_into_layer`(field_names, **kwargs)
  `set_ok_button`()

## svir.dialogs.load_output_as_layer_dialog module

class `svir.dialogs.load_output_as_layer_dialog.``LoadOutputAsLayerDialog`(iface, viewer_dock, session, hostname, calc_id, output_type=None, path=None, mode=None, zonal_layer_path=None, engine_version=None)

  Bases: `PyQt5.QtWidgets.QDialog`, `Ui_LoadOutputAsLayerDialog`

  Dialog to load an oq-engine output as layer

  `accept`()
  `add_field_to_layer`(field_name)
  `aggregate_by_zone`()
  `build_layer`(rlz_or_stat=None, taxonomy=None, poe=None, loss_type=None, dmg_state=None, gsim=None, imt=None)
  `build_layer_name`(*args, **kwargs)
  `create_aggregate_by_site_ckb`()
  `create_dmg_state_selector`()
  `create_eid_selector`()
  `create_file_hlayout`()
  `create_file_size_indicator`()
  `create_imt_selector`(all_ckb=False)
  `create_load_multicol_ckb`()
  `create_load_selected_only_ckb`()
  `create_loss_type_selector`()
  `create_num_sites_indicator`()
  `create_poe_selector`(all_ckb=False)
  `create_rlz_or_stat_selector`(all_ckb=False, label='Realization')
  `create_save_as_shp_ckb`()
  `create_selector`(name, label_text, filter_ckb=False, add_to_layout=None, on_text_changed=None)
  `create_show_return_period_ckb`()
  `create_style_by_selector`()
  `create_taxonomy_selector`()
  `create_zonal_layer_selector`(discard_nonmatching=True)
  `finalize_init`(extracted_npz)
  `get_field_names`(**kwargs)
  `get_investigation_time`()
  `get_taxonomies`()
  `init_done`
  `load_from_npz`()
  `load_zonal_layer`(zonal_layer_path)
  `loading_completed`
  `loading_exception`
  `on_calculate_zonal_stats_completed`(zonal_layer_plus_sum)
  `on_currentLayerChanged`()
  `on_dmg_state_changed`()
  `on_eid_changed`()
  `on_extract_error`(exception)
  `on_file_browser_tbn_clicked`()
  `on_imt_changed`()
  `on_load_all_imts_chk_stateChanged`(state)
  `on_load_all_poes_chk_stateChanged`(state)
  `on_load_all_rlzs_or_stats_chk_stateChanged`(state)
  `on_loss_type_changed`()
  `on_output_type_changed`()
  `on_poe_changed`()
  `on_rlz_or_stat_changed`()
  `on_zonal_layer_cbx_currentIndexChanged`(new_index)
  `on_zonal_layer_gbx_toggled`(is_checked)
  `open_file_dialog`()

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

  `open_load_zonal_layer_dialog`()

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

  `populate_loss_type_cbx`(loss_types)
  `populate_out_dep_widgets`()
  `populate_rlz_or_stat_cbx`()
  `populate_zonal_layer_cbx`(zonal_layer)
  `pre_populate_zonal_layer_cbx`()
  `read_npz_into_layer`(field_names, **kwargs)
  `reject`()
  `set_ok_button`()
  `show_file_size`()
  `show_num_sites`()
  `style_categorized`(layer=None, style_by=None)
  `style_curves`()
  static `style_maps`(layer, style_by, iface, output_type, perils=None, add_null_class=False, render_higher_on_top=False)

## svir.dialogs.load_ruptures_as_layer_dialog module

class `svir.dialogs.load_ruptures_as_layer_dialog.``LoadRupturesAsLayerDialog`(iface, viewer_dock, session, hostname, calc_id, output_type='ruptures', path=None, mode=None, engine_version=None)

  Bases: `svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog`

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

  `load_from_csv`()
  `populate_out_dep_widgets`()
  `populate_style_by_cbx`()
  `set_ok_button`()

## svir.dialogs.load_uhs_as_layer_dialog module

class `svir.dialogs.load_uhs_as_layer_dialog.``LoadUhsAsLayerDialog`(iface, viewer_dock, session, hostname, calc_id, output_type='uhs', path=None, mode=None, engine_version=None)

  Bases: `svir.dialogs.load_output_as_layer_dialog.LoadOutputAsLayerDialog`

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

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

## svir.dialogs.projects_manager_dialog module

class `svir.dialogs.projects_manager_dialog.``ProjectsManagerDialog`(iface)

  Bases: `PyQt5.QtWidgets.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)
  `display_proj_def_raw`()
  `get_selected_proj_def`()
  `get_suppl_info`()
  `on_add_proj_def_btn_clicked`()
  `on_clone_btn_clicked`()
  `on_proj_def_cbx_currentIndexChanged`()
  `on_proj_def_descr_textChanged`()
  `on_proj_def_raw_textChanged`()
  `on_proj_def_title_textEdited`()
  `populate_proj_def_cbx`()
  `update_form`()
  `update_proj_def_descr`()
  `update_proj_def_title`()
  `update_title_in_combo`()

## svir.dialogs.recovery_modeling_dialog module

class `svir.dialogs.recovery_modeling_dialog.``RecoveryModelingDialog`(iface)

  Bases: `PyQt5.QtWidgets.QDialog`, `Ui_RecoveryModelingDialog`

  Modal dialog to perform recovery modeling analysis.

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

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

  `save_state`()

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

  `set_ok_button`()

## svir.dialogs.recovery_settings_dialog module

class `svir.dialogs.recovery_settings_dialog.``RecoverySettingsDialog`(iface)

  Bases: `PyQt5.QtWidgets.QDialog`, `Ui_RecoverySettingsDialog`

  Modal dialog to set parameters for recovery modeling analysis.

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

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

  `save_setting_1d_table`(name, table, val_type)
  `save_setting_2d_table`(name, table, val_type, check_row_sum_to_1=False)
  `save_setting_number`(name, value, val_type)
  `save_state`()

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

  `set_ok_button`()

## svir.dialogs.select_sv_variables_dialog module

class `svir.dialogs.select_sv_variables_dialog.``SelectSvVariablesDialog`(downloader)

  Bases: `PyQt5.QtWidgets.QDialog`, `Ui_SelectSvVariablesDialog`

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

  `fill_countries`()
  `fill_names`()
  `fill_subthemes`(theme)
  `fill_themes`()
  `on_filter_btn_clicked`()
  `on_theme_cbx_currentIndexChanged`()
  `set_ok_button`()
  `update_indicator_info`(item)

## svir.dialogs.settings_dialog module

class `svir.dialogs.settings_dialog.``SettingsDialog`(iface, irmt_main=None, parent=None)

  Bases: `PyQt5.QtWidgets.QDialog`, `Ui_SettingsDialog`

  Dialog used to edit the plugin settings

  `accept`()

    Method invoked when OK button is clicked.

  `on_eng_edit_btn_clicked`()
  `on_eng_new_btn_clicked`()
  `on_eng_remove_btn_clicked`()
  `on_eng_test_btn_clicked`()
  `on_engine_profile_cbx_currentIndexChanged`(idx)
  `on_pla_edit_btn_clicked`()
  `on_pla_new_btn_clicked`()
  `on_pla_remove_btn_clicked`()
  `on_pla_test_btn_clicked`()
  `on_platform_profile_cbx_currentIndexChanged`(idx)
  `on_restore_default_settings_btn_clicked`()
  `on_style_color_from_clicked`()
  `on_style_color_to_clicked`()
  `refresh_profile_cbxs`(platform_or_engine, restore_defaults=False)
  `remove_selected_profile`(platform_or_engine)
  `restore_state`(restore_defaults=False)

    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_profiles`(platform_or_engine, profiles)
  `save_state`()

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

  `select_color`(button)
  `set_button_color`(button, color)

## svir.dialogs.show_console_dialog module

class `svir.dialogs.show_console_dialog.``ShowConsoleDialog`(driver_dialog, calc_id)

  Bases: `PyQt5.QtWidgets.QDialog`, `Ui_Dialog`

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

  `refresh_calc_log`()
  `reject`()

## svir.dialogs.show_full_report_dialog module

class `svir.dialogs.show_full_report_dialog.``ShowFullReportDialog`(filepath)

  Bases: `PyQt5.QtWidgets.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`

  Bases: `PyQt5.QtWidgets.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)

  Bases: `PyQt5.QtWidgets.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`()
  `on_algorithm_cbx_currentIndexChanged`()
  `on_calc_btn_clicked`()
  `on_new_field_name_txt_editingFinished`()
  `on_new_field_name_txt_textEdited`()
  `on_overwrite_ckb_stateChanged`()
  `on_variant_cbx_currentIndexChanged`()
  `reload_variant_cbx`()
  `set_new_field_editable`()
  `set_ok_button`()
  `update_default_fieldname`()

## svir.dialogs.upload_dialog module

class `svir.dialogs.upload_dialog.``UploadDialog`(iface, file_stem)

  Bases: `PyQt5.QtWidgets.QDialog`, `Ui_UploadMetadataDialog`

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

  `load_finished`()
  `showEvent`(event)
  `upload`()
  `upload_done`(result)
  `upload_successful`

## svir.dialogs.upload_settings_dialog module

class `svir.dialogs.upload_settings_dialog.``UploadSettingsDialog`(iface, suppl_info, file_stem)

  Bases: `PyQt5.QtWidgets.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`()
  `on_confirm_chk_stateChanged`()
  `on_license_info_btn_clicked`()
  `on_update_radio_toggled`(on)
  `on_zone_label_field_cbx_currentIndexChanged`()
  `set_labels`()
  `set_license`()
  `set_ok_button`()
  `set_zone_label_field`()

## svir.dialogs.viewer_dock module

class `svir.dialogs.viewer_dock.``ViewerDock`(iface, action)

  Bases: `PyQt5.QtWidgets.QDockWidget`, `Ui_ViewerDock`

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

    Plots the total damage distribution

  `draw_losses_by_asset_aggr`()
  `filter_agg_curves`()
  `filter_dmg_by_asset_aggr`()
  `filter_losses_by_asset_aggr`()
  `layer_changed`()
  `load_agg_curves`(calc_id, session, hostname, output_type)
  `load_dmg_by_asset_aggr`(calc_id, session, hostname, output_type)
  `load_losses_by_asset_aggr`(calc_id, session, hostname, output_type)
  `load_no_map_output`(calc_id, session, hostname, output_type, engine_version)
  `on_approach_changed`()
  `on_bw_chk_clicked`()
  `on_container_hover`(event, container)
  `on_exclude_no_dmg_ckb_state_changed`(state)
  `on_export_data_button_clicked`()
  `on_imt_changed`()
  `on_loss_type_changed`(loss_type)
  `on_n_simulations_changed`()
  `on_output_type_cbx_currentIndexChanged`(index)
  `on_plot_hover`(event)
  `on_poe_changed`()
  `on_recalculate_curve_btn_clicked`()
  `on_recalculate_on_the_fly_chk_toggled`(checked)
  `on_rlz_changed`()
  `populate_tag_values_multiselect`(item)
  `redraw`(selected, deselected, _)

    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`()
  `redraw_recovery_curve`(selected)
  `refresh_feature_selection`()
  `remove_connects`()
  `set_output_type_and_its_gui`(new_output_type)
  `update_list_selected_edt`()
  `update_selected_tag_names`()
  `update_selected_tag_values`()
  `write_export_file`(filename)

## svir.dialogs.weight_data_dialog module

class `svir.dialogs.weight_data_dialog.``WeightDataDialog`(iface, project_definition)

  Bases: `PyQt5.QtWidgets.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)
  `closeEvent`(event)
  `handle_json_updated`(data)
  `json_cleaned`
  `json_str`
  `json_updated`
  `on_print_btn_clicked`()
  `on_style_by_field_cbx_currentIndexChanged`()
  `populate_style_by_field_cbx`()
  `print_self_for_debug`()
  `reject`()
  `setup_js`()
  `show_tree`()
  `update_active_layer_numeric_fields`()
  `update_project_definition`(project_definition)

## Module contents