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

nens / ThreeDiToolbox / #2564

28 Aug 2025 08:29AM UTC coverage: 35.245% (+0.4%) from 34.841%
#2564

push

coveralls-python

web-flow
Add water depth difference processing algorithm (#1136)

* Create water_depth_difference_algorithm.py

* wrap it up

* Update water_depth_difference_algorithm.py

* Update providers.py

* Changes after testing

* Update water_depth_difference_algorithm.py

* Add tests for water depth difference and fix a small bug in the code

* Move get_authority_code to utils and add tests for this function

* changes after review

---------

Co-authored-by: Margriet Palm <margriet.palm@nelen-schuurmans.nl>

99 of 125 new or added lines in 3 files covered. (79.2%)

4843 of 13741 relevant lines covered (35.24%)

0.35 hits per line

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

55.26
/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
    ThreediDepthAlgorithm,
36
)
37
from threedi_results_analysis.processing.threedidepth_algorithms import (
1✔
38
    ThreediMaxDepthAlgorithm,
39
)
40
from threedi_results_analysis.processing.water_depth_difference_algorithm import (
1✔
41
    WaterDepthDiffAlgorithm,
42
)
43

44

45
import os
1✔
46

47

48
class ThreediProvider(QgsProcessingProvider):
1✔
49
    """Loads the Processing Toolbox algorithms for 3Di"""
50

51
    def loadAlgorithms(self, *args, **kwargs):
1✔
52
        self.addAlgorithm(ThreediDepthAlgorithm())
×
53
        self.addAlgorithm(ThreediMaxDepthAlgorithm())
×
54
        self.addAlgorithm(CheckSchematisationAlgorithm())
×
55
        self.addAlgorithm(MigrateAlgorithm())
×
56
        self.addAlgorithm(ThreeDiConvertToGpkgAlgorithm())
×
57
        self.addAlgorithm(ThreeDiGenerateCompGridAlgorithm())
×
58
        self.addAlgorithm(CrossSectionalDischargeAlgorithm())
×
59
        self.addAlgorithm(DetectLeakingObstaclesAlgorithm())
×
60
        self.addAlgorithm(DetectLeakingObstaclesWithDischargeThresholdAlgorithm())
×
61
        self.addAlgorithm(RastersToNetCDFAlgorithm())
×
62
        self.addAlgorithm(StructureControlActionAlgorithm())
×
63
        self.addAlgorithm(ImportHydXAlgorithm())
×
NEW
64
        self.addAlgorithm(WaterDepthDiffAlgorithm())
×
65

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

69
        This string should be a unique, short, character only string,
70
        eg "qgis" or "gdal". This string should not be localised.
71
        """
72
        return "threedi"
×
73

74
    def name(self, *args, **kwargs):
1✔
75
        """The human friendly name of your plugin in Processing.
76

77
        This string should be as short as possible (e.g. "Lastools", not
78
        "Lastools version 1.0.1 64-bit") and localised.
79
        """
80
        return self.tr("3Di")
×
81

82
    def icon(self):
1✔
83
        """Should return a QIcon which is used for your provider inside
84
        the Processing toolbox.
85
        """
86
        icon_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "icons", "icon.png")
×
87
        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