diff --git a/eis_qgis_plugin/utils/settings_manager.py b/eis_qgis_plugin/utils/settings_manager.py index 44291358..1bd430ff 100644 --- a/eis_qgis_plugin/utils/settings_manager.py +++ b/eis_qgis_plugin/utils/settings_manager.py @@ -27,7 +27,6 @@ def default(self, obj: QgsGradientColorRamp): def decode(dct: dict): for key, value in dct.items(): - print(key, value) if isinstance(value, str) and value.startswith('#') and len(value) == 7: try: dct[key] = QColor(value) # Convert hex string back to QColor @@ -309,5 +308,3 @@ def reset_all(self): self.reset_continuous_palette_selection() self.reset_layer_group_selection() self.reset_default_base_raster() - - print("All EIS settings reset.") diff --git a/eis_qgis_plugin/wizard/modeling/fuzzy_modeling/fuzzy.py b/eis_qgis_plugin/wizard/modeling/fuzzy_modeling/fuzzy.py index b67d8d13..ee6468d9 100644 --- a/eis_qgis_plugin/wizard/modeling/fuzzy_modeling/fuzzy.py +++ b/eis_qgis_plugin/wizard/modeling/fuzzy_modeling/fuzzy.py @@ -250,10 +250,6 @@ def plot(self): y_values = membership.membership_function(x_values, *params) if isinstance(y_values, pd.DataFrame) or isinstance(y_values, pd.Series): y_values = y_values.to_numpy() - print("X-values type: ", type(x_values)) - print("Y-values type: ", type(y_values)) - print("X-values: ", x_values) - print("Y-values: ", y_values) sns.lineplot( x=x_values, diff --git a/eis_qgis_plugin/wizard/modeling/machine_learning/application.py b/eis_qgis_plugin/wizard/modeling/machine_learning/application.py index 251fa44f..38c05e29 100644 --- a/eis_qgis_plugin/wizard/modeling/machine_learning/application.py +++ b/eis_qgis_plugin/wizard/modeling/machine_learning/application.py @@ -188,6 +188,5 @@ def apply_model(self): self.executor.configure(self.REGRESSOR_ALG, self.application_feedback) self.executor.run(params) else: - print(f"Unknown model kind: {self.model_info.model_kind}") + iface.messageBar().pushCritical("Error: " f"Unknown model kind: {self.model_info.model_kind}") return - diff --git a/eis_qgis_plugin/wizard/modeling/machine_learning/testing.py b/eis_qgis_plugin/wizard/modeling/machine_learning/testing.py index 05d388c2..47ee11c0 100644 --- a/eis_qgis_plugin/wizard/modeling/machine_learning/testing.py +++ b/eis_qgis_plugin/wizard/modeling/machine_learning/testing.py @@ -249,7 +249,7 @@ def test_model(self): self.executor.run(params) else: - print(f"Unknown model kind: {self.model_info.model_kind}") + iface.messageBar().pushCritical("Error: ", f"Unknown model kind: {self.model_info.model_kind}") return diff --git a/eis_qgis_plugin/wizard/modeling/model_data_table.py b/eis_qgis_plugin/wizard/modeling/model_data_table.py index 438f50a0..d812879e 100644 --- a/eis_qgis_plugin/wizard/modeling/model_data_table.py +++ b/eis_qgis_plugin/wizard/modeling/model_data_table.py @@ -4,6 +4,7 @@ from qgis.gui import QgsMapLayerComboBox from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtWidgets import QHeaderView, QLabel, QLineEdit, QPushButton, QSizePolicy, QTableWidget +from qgis.utils import iface class ModelDataTable(QTableWidget): @@ -98,7 +99,7 @@ def reset_table(self): def load_model(self, tags: List[str], evidence_data: List[Tuple[str, str]]): """Load information about the selected model (number of rows/layers and corresponding tags).""" if len(tags) != len(evidence_data): - print("Length of evidence data should match the number of given tags!") + iface.messageBar().pushCritical("Error: ", "Length of evidence data should match the number of given tags!") return # Remove all previous rows diff --git a/eis_qgis_plugin/wizard/modeling/model_manager.py b/eis_qgis_plugin/wizard/modeling/model_manager.py index 8099b031..e20d2722 100644 --- a/eis_qgis_plugin/wizard/modeling/model_manager.py +++ b/eis_qgis_plugin/wizard/modeling/model_manager.py @@ -2,6 +2,7 @@ from qgis.core import QgsProject from qgis.PyQt.QtCore import QObject, pyqtSignal +from qgis.utils import iface from eis_qgis_plugin.wizard.modeling.ml_model_info import MLModelInfo @@ -57,7 +58,7 @@ def save_model_info(self, info: MLModelInfo, overwrite: bool = True): id = info.model_instance_name models = self.get_all_models() if id in models and not overwrite: - print("ID found and overwrite is False.") + iface.messageBar().pushCritical("Error: ", "Model with given ID was found and overwrite setting is False.") return key = self._get_key(id) diff --git a/eis_qgis_plugin/wizard/wizard_history.py b/eis_qgis_plugin/wizard/wizard_history.py index b055ceeb..ec7bfe1b 100644 --- a/eis_qgis_plugin/wizard/wizard_history.py +++ b/eis_qgis_plugin/wizard/wizard_history.py @@ -12,6 +12,7 @@ QVBoxLayout, QWidget, ) +from qgis.utils import iface from eis_qgis_plugin.qgis_plugin_tools.tools.resources import load_ui from eis_qgis_plugin.utils.misc_utils import clear_layout, set_filter @@ -154,7 +155,7 @@ def clear_parameter_data(self): def _on_export_clicked(self): - print("Model history exporting not implemented yet!") + iface.messageBar().pushWarning("Warning: ", "Model history exporting not implemented yet!") def _on_delete_clicked(self): @@ -162,10 +163,10 @@ def _on_delete_clicked(self): new_index = min(self.model_selection.currentIndex(), self.model_selection.count() - 2) self.model_manager.remove_model_info(model) self.update_list_of_models(index=new_index) - print(f"Model {model} deleted") + iface.messageBar().pushSuccess("Success: ", f"Model {model} deleted.") def _on_delete_all_clicked(self): self.model_manager.remove_model_info_all() self.update_list_of_models() - print("All models deleted") \ No newline at end of file + iface.messageBar().pushSuccess("Success: ", "All models deleted.") diff --git a/eis_qgis_plugin/wizard/wizard_settings.py b/eis_qgis_plugin/wizard/wizard_settings.py index 332be901..42b39bed 100644 --- a/eis_qgis_plugin/wizard/wizard_settings.py +++ b/eis_qgis_plugin/wizard/wizard_settings.py @@ -192,7 +192,7 @@ def save_settings(self): EISSettingsManager.set_layer_group_selection(self.layer_group_selection.isChecked()) EISSettingsManager.set_default_base_raster(self.default_base_raster.currentLayer()) - iface.messageBar().pushSuccess("Success:", "Saved EIS QGIS plugin settings.") + iface.messageBar().pushSuccess("Success: ", "Saved EIS QGIS plugin settings.") def reset_settings_to_default(self): @@ -214,4 +214,4 @@ def reset_settings_to_default(self): self.layer_group_selection.setChecked(defaults[EISSettingsManager.LAYER_GROUP_SETTING] == "true") self.default_base_raster.setLayer(defaults[EISSettingsManager.DEFAULT_BASE_RASTER]) - iface.messageBar().pushInfo("Info:", "EIS QGIS plugin settings reset.") + iface.messageBar().pushInfo("Info: ", "EIS QGIS plugin settings reset.")