• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nens / ThreeDiToolbox / #2616

22 Oct 2025 09:46AM UTC coverage: 36.554% (+1.8%) from 34.798%
#2616

push

coveralls-python

web-flow
Concentration raster algorithms & general threedidepth algorithms refactor (#1147)

Functional improvements:
- Water depth/level raster algorithm has been split into two algorithms: single and multiple time steps (#958)
- Appropriately style and name water depth/level algorithm outputs.
- New processing algorithm: Concentration raster (single time step)
- New processing algorithm: Concentration raster (multiple time steps)
- New processing algorithm: Concentration raster (maximum)
- Bugfix: Processing algorithm "Maximum water depth/level" fails when writing to a temporary result (#945)
- Bugfix: Water depth tool raises KeyError: 's1_max' when using aggregate_results_3di.nc without the correct aggregation variables (#874)

Code changes:
- All `threedidepth`-based processing algorithm now derive from the same base class
- Utilility functions moved to utils files
- Moved util functions from water depth difference algo to utils files, because they are now also used by the concentration raster algo's. Also moved the tests for these util functions to the appropriate file
- Added smoke integration test for all six threedidepth-processing algo's
- Removed TimeSliderCheckbox widget (is no longer needed because single and multiple time steps algo's have been separated

539 of 739 new or added lines in 7 files covered. (72.94%)

2 existing lines in 1 file now uncovered.

5282 of 14450 relevant lines covered (36.55%)

0.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

54.35
/processing/providers.py
1
# See https://docs.qgis.org/3.10/en/docs/pyqgis_developer_cookbook/processing.html
2
from qgis.core import QgsProcessingProvider
1✔
3
from qgis.PyQt.QtGui import QIcon
1✔
4
from threedi_results_analysis.processing.cross_sectional_discharge_algorithm import (
1✔
5
    CrossSectionalDischargeAlgorithm,
6
)
7
from threedi_results_analysis.processing.gpkg_conversion_algorithm import (
1✔
8
    ThreeDiConvertToGpkgAlgorithm,
9
)
10
from threedi_results_analysis.processing.grid_creation_algorithm import (
1✔
11
    ThreeDiGenerateCompGridAlgorithm,
12
)
13
from threedi_results_analysis.processing.leak_detector_algorithms import (
1✔
14
    DetectLeakingObstaclesAlgorithm,
15
)
16
from threedi_results_analysis.processing.leak_detector_algorithms import (
1✔
17
    DetectLeakingObstaclesWithDischargeThresholdAlgorithm,
18
)
19
from threedi_results_analysis.processing.rasters_to_netcdf_algorithm import (
1✔
20
    RastersToNetCDFAlgorithm,
21
)
22
from threedi_results_analysis.processing.schematisation_algorithms import (
1✔
23
    CheckSchematisationAlgorithm,
24
)
25
from threedi_results_analysis.processing.schematisation_algorithms import (
1✔
26
    ImportHydXAlgorithm,
27
)
28
from threedi_results_analysis.processing.schematisation_algorithms import (
1✔
29
    MigrateAlgorithm,
30
)
31
from threedi_results_analysis.processing.structure_control_action_algorithms import (
1✔
32
    StructureControlActionAlgorithm,
33
)
34
from threedi_results_analysis.processing.threedidepth_algorithms import (
1✔
35
    WaterDepthOrLevelSingleTimeStepAlgorithm,
36
)
37
from threedi_results_analysis.processing.threedidepth_algorithms import (
1✔
38
    WaterDepthOrLevelMultipleTimeStepAlgorithm,
39
)
40
from threedi_results_analysis.processing.threedidepth_algorithms import (
1✔
41
    WaterDepthOrLevelMaximumAlgorithm,
42
)
43
from threedi_results_analysis.processing.threedidepth_algorithms import (
1✔
44
    ConcentrationSingleTimeStepAlgorithm,
45
)
46
from threedi_results_analysis.processing.threedidepth_algorithms import (
1✔
47
    ConcentrationMultipleTimeStepAlgorithm,
48
)
49
from threedi_results_analysis.processing.threedidepth_algorithms import (
1✔
50
    ConcentrationMaximumAlgorithm,
51
)
52
from threedi_results_analysis.processing.water_depth_difference_algorithm import (
1✔
53
    WaterDepthDiffAlgorithm,
54
)
55

56

57
import os
1✔
58

59

60
class ThreediProvider(QgsProcessingProvider):
1✔
61
    """Loads the Processing Toolbox algorithms for 3Di"""
62

63
    def loadAlgorithms(self, *args, **kwargs):
1✔
NEW
64
        self.addAlgorithm(WaterDepthOrLevelSingleTimeStepAlgorithm())
×
NEW
65
        self.addAlgorithm(WaterDepthOrLevelMultipleTimeStepAlgorithm())
×
NEW
66
        self.addAlgorithm(WaterDepthOrLevelMaximumAlgorithm())
×
NEW
67
        self.addAlgorithm(ConcentrationSingleTimeStepAlgorithm())
×
NEW
68
        self.addAlgorithm(ConcentrationMultipleTimeStepAlgorithm())
×
NEW
69
        self.addAlgorithm(ConcentrationMaximumAlgorithm())
×
70
        self.addAlgorithm(CheckSchematisationAlgorithm())
×
71
        self.addAlgorithm(MigrateAlgorithm())
×
72
        self.addAlgorithm(ThreeDiConvertToGpkgAlgorithm())
×
73
        self.addAlgorithm(ThreeDiGenerateCompGridAlgorithm())
×
74
        self.addAlgorithm(CrossSectionalDischargeAlgorithm())
×
75
        self.addAlgorithm(DetectLeakingObstaclesAlgorithm())
×
76
        self.addAlgorithm(DetectLeakingObstaclesWithDischargeThresholdAlgorithm())
×
77
        self.addAlgorithm(RastersToNetCDFAlgorithm())
×
78
        self.addAlgorithm(StructureControlActionAlgorithm())
×
79
        self.addAlgorithm(ImportHydXAlgorithm())
×
80
        self.addAlgorithm(WaterDepthDiffAlgorithm())
×
81

82
    def id(self, *args, **kwargs):
1✔
83
        """The ID of your plugin, used for identifying the provider.
84

85
        This string should be a unique, short, character only string,
86
        eg "qgis" or "gdal". This string should not be localised.
87
        """
88
        return "threedi"
×
89

90
    def name(self, *args, **kwargs):
1✔
91
        """The human friendly name of your plugin in Processing.
92

93
        This string should be as short as possible (e.g. "Lastools", not
94
        "Lastools version 1.0.1 64-bit") and localised.
95
        """
96
        return self.tr("3Di")
×
97

98
    def icon(self):
1✔
99
        """Should return a QIcon which is used for your provider inside
100
        the Processing toolbox.
101
        """
102
        icon_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "icons", "icon.png")
×
103
        return QIcon(icon_path)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc