Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved handling of the 3Di working directory structure to threedi_mi_u… #933

Merged
merged 9 commits into from
Nov 13, 2023
Merged
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Statistics: Add two water on street presets.
- General: added some layer loading feedback.
- Passed handling of the 3Di working directory structure to `threedi_mi_utils` package.


3.1.12 (2023-10-19)
Expand Down
1 change: 1 addition & 0 deletions dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
Dependency("hydxlib", "hydxlib", "==1.5.1", False),
Dependency("h5netcdf", "h5netcdf", "", False),
Dependency("greenlet", "greenlet", "!=0.4.17", False),
Dependency("threedi-mi-utils", "threedi_mi_utils", "==0.1.2", False),
ldebek marked this conversation as resolved.
Show resolved Hide resolved
]

# On Windows, the hdf5 binary and thus h5py version depends on the QGis version
Expand Down
1 change: 1 addition & 0 deletions external-dependencies/populate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ networkx \
packaging \
pyqtgraph \
python-editor \
threedi-mi-utils \
threedi-modelchecker \
threedi-schema \
threedidepth \
Expand Down
7 changes: 4 additions & 3 deletions gui/threedi_plugin_grid_result_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from qgis.PyQt.QtWidgets import QAbstractItemView
from qgis.core import QgsSettings
from qgis.PyQt.QtGui import QStandardItemModel, QStandardItem
from threedi_results_analysis.utils.workingdir import list_local_schematisations
from threedi_mi_utils import list_local_schematisations

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -199,10 +199,11 @@ def refresh(self):
self.messageLabel.setText("Please set your 3Di working directory in the 3Di Models & Simulations settings to be able to load computational grids and results from your 3Di working directory.")
return

local_schematisations = list_local_schematisations(threedi_working_dir)
local_schematisations = list_local_schematisations(threedi_working_dir, use_config_for_revisions=False)
for schematisation_id, local_schematisation in local_schematisations.items():
# Iterate over revisions
for revision_number, local_revision in local_schematisation.revisions.items():
num_of_results = len(local_revision.results_dirs)
# Iterate over results
for result_dir in local_revision.results_dirs:
schema_item = QStandardItem(local_schematisation.name)
Expand All @@ -218,7 +219,7 @@ def refresh(self):
self.model.appendRow([schema_item, revision_item, result_item])

# In case no results are present, but a gridadmin is present, we still add the grid, but without result item
if len(local_revision.results_dirs) == 0 and os.path.exists(os.path.join(local_revision.grid_dir, "gridadmin.h5")):
if num_of_results == 0 and os.path.exists(os.path.join(local_revision.grid_dir, "gridadmin.h5")):
schema_item = QStandardItem(local_schematisation.name)
schema_item.setEditable(False)
revision_item = QStandardItem(str(revision_number))
Expand Down
227 changes: 0 additions & 227 deletions utils/workingdir.py

This file was deleted.

Loading