hydamo-validation 1.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. hydamo_validation-1.4.1/LICENSE +21 -0
  2. hydamo_validation-1.4.1/PKG-INFO +94 -0
  3. hydamo_validation-1.4.1/README.md +75 -0
  4. hydamo_validation-1.4.1/hydamo_validation/__init__.py +23 -0
  5. hydamo_validation-1.4.1/hydamo_validation/datamodel.py +500 -0
  6. hydamo_validation-1.4.1/hydamo_validation/datasets.py +109 -0
  7. hydamo_validation-1.4.1/hydamo_validation/functions/__init__.py +0 -0
  8. hydamo_validation-1.4.1/hydamo_validation/functions/general.py +319 -0
  9. hydamo_validation-1.4.1/hydamo_validation/functions/logic.py +338 -0
  10. hydamo_validation-1.4.1/hydamo_validation/functions/topologic.py +671 -0
  11. hydamo_validation-1.4.1/hydamo_validation/geometry.py +144 -0
  12. hydamo_validation-1.4.1/hydamo_validation/logical_validation.py +383 -0
  13. hydamo_validation-1.4.1/hydamo_validation/schemas/hydamo/HyDAMO_2.2.json +5946 -0
  14. hydamo_validation-1.4.1/hydamo_validation/schemas/hydamo/HyDAMO_2.3.json +6602 -0
  15. hydamo_validation-1.4.1/hydamo_validation/schemas/hydamo/HyDAMO_2.4.json +6919 -0
  16. hydamo_validation-1.4.1/hydamo_validation/schemas/rules/rules_1.0.json +1134 -0
  17. hydamo_validation-1.4.1/hydamo_validation/schemas/rules/rules_1.1.json +1134 -0
  18. hydamo_validation-1.4.1/hydamo_validation/schemas/rules/rules_1.2.json +1128 -0
  19. hydamo_validation-1.4.1/hydamo_validation/schemas/rules/rules_1.3.json +1128 -0
  20. hydamo_validation-1.4.1/hydamo_validation/schemas/rules/rules_1.4.json +1128 -0
  21. hydamo_validation-1.4.1/hydamo_validation/styles/hydroobject.qml +497 -0
  22. hydamo_validation-1.4.1/hydamo_validation/styles/hydroobject.sld +15 -0
  23. hydamo_validation-1.4.1/hydamo_validation/styles.py +124 -0
  24. hydamo_validation-1.4.1/hydamo_validation/summaries.py +269 -0
  25. hydamo_validation-1.4.1/hydamo_validation/syntax_validation.py +277 -0
  26. hydamo_validation-1.4.1/hydamo_validation/utils.py +75 -0
  27. hydamo_validation-1.4.1/hydamo_validation/validator.py +370 -0
  28. hydamo_validation-1.4.1/hydamo_validation.egg-info/PKG-INFO +94 -0
  29. hydamo_validation-1.4.1/hydamo_validation.egg-info/SOURCES.txt +50 -0
  30. hydamo_validation-1.4.1/hydamo_validation.egg-info/dependency_links.txt +1 -0
  31. hydamo_validation-1.4.1/hydamo_validation.egg-info/requires.txt +9 -0
  32. hydamo_validation-1.4.1/hydamo_validation.egg-info/top_level.txt +1 -0
  33. hydamo_validation-1.4.1/hydamo_validation.egg-info/zip-safe +1 -0
  34. hydamo_validation-1.4.1/pyproject.toml +46 -0
  35. hydamo_validation-1.4.1/setup.cfg +4 -0
  36. hydamo_validation-1.4.1/setup.py +3 -0
  37. hydamo_validation-1.4.1/tests/test_datasets.py +46 -0
  38. hydamo_validation-1.4.1/tests/test_dommelerwaard.py +94 -0
  39. hydamo_validation-1.4.1/tests/test_general_functions.py +154 -0
  40. hydamo_validation-1.4.1/tests/test_hydamo_2_2.py +135 -0
  41. hydamo_validation-1.4.1/tests/test_hydamo_2_4.py +137 -0
  42. hydamo_validation-1.4.1/tests/test_init.py +45 -0
  43. hydamo_validation-1.4.1/tests/test_logic_functions.py +84 -0
  44. hydamo_validation-1.4.1/tests/test_not_overlapping.py +113 -0
  45. hydamo_validation-1.4.1/tests/test_productie.py +103 -0
  46. hydamo_validation-1.4.1/tests/test_structures_at_interersections.py +35 -0
  47. hydamo_validation-1.4.1/tests/test_summaries.py +110 -0
  48. hydamo_validation-1.4.1/tests/test_testset.py +43 -0
  49. hydamo_validation-1.4.1/tests/test_topologic_functions.py +157 -0
  50. hydamo_validation-1.4.1/tests/test_validationrules.py +60 -0
  51. hydamo_validation-1.4.1/tests/test_wrij.py +186 -0
  52. hydamo_validation-1.4.1/tests/test_wrij_profielen.py +25 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 HyDAMO ValidatieTool
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.1
2
+ Name: hydamo_validation
3
+ Version: 1.4.1
4
+ Summary: Validation module for HyDAMO data
5
+ Author-email: Daniel Tollenaar <daniel@d2hydro.nl>
6
+ License: MIT
7
+ Project-URL: Source, https://github.com/HetWaterschapshuis/HyDAMOValidatieModule
8
+ Requires-Python: >=3.12
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: geopandas
12
+ Requires-Dist: pandas>=2
13
+ Requires-Dist: pyogrio
14
+ Requires-Dist: rasterio
15
+ Requires-Dist: shapely>=2
16
+ Requires-Dist: rasterstats
17
+ Provides-Extra: tests
18
+ Requires-Dist: pytest; extra == "tests"
19
+
20
+ # The HyDAMO Validation Module: hydamo_validation
21
+
22
+ Validation Module for HyDAMO data.
23
+
24
+ ## Installation
25
+
26
+ ### Python installation
27
+ Make sure you have an Miniconda or Anaconda installation. You can download these here:
28
+ - https://www.anaconda.com/products/individual
29
+ - https://docs.conda.io/en/latest/miniconda.html
30
+
31
+ During installation, tick the box "Add Anaconda to PATH", ignore the red remarks
32
+
33
+ ### Create the `validatietool` environment
34
+ Use the `env/environment.yml` in the repository to create the conda environment: `validatietool`
35
+
36
+ ```
37
+ conda env create -f environment.yml
38
+ ```
39
+
40
+ After installation you can activate your environment in command prompt
41
+
42
+ ```
43
+ conda activate validatietool
44
+ ```
45
+
46
+ ### Install hydamo_validation
47
+ Simply install the module in the activated environment:
48
+
49
+ ```
50
+ pip install hydamo_validation
51
+ ```
52
+
53
+ ### Develop-install hydamo_validation
54
+ Download or clone the repository. Now simply install the module in the activated environment:
55
+
56
+ ```
57
+ pip install .
58
+ ```
59
+
60
+ ## Run in Python
61
+
62
+ ### Specify a coverage directory
63
+ To get the validator running you need some AHN data. You can find these in the [data directory](https://github.com/HetWaterschapshuis/HyDAMOValidatieModule/tree/ee9ea1efed385deb692b89057e9c97114fd8c3be/tests/data/dtm) of this directory. We assume you copy this to `your/local/ahn/dir`. Now specify your coverage and init the validator in a python-script:
64
+
65
+ ```
66
+ from hydamo_validation import validator
67
+ from pathlib import Path
68
+
69
+ coverage = {"AHN": Path("your/local/ahn/dir")}
70
+
71
+ hydamo_validator = validator(
72
+ output_types=["geopackage", "csv", "geojson"], coverages=coverage, log_level="INFO"
73
+ )
74
+
75
+ ```
76
+
77
+ With this validator you can validate a directory that directory should have the following structure. The name of `datasets` directory and `ValidatorRules.json` are mandatory. Within datasets you can put one or more geopackages with `HyDAMO` layers.
78
+
79
+ ```
80
+ your/directory/
81
+ ├─ datasets/
82
+ │ ├─ hydamo.gpkg
83
+ ├─ ValidationRules.json
84
+ ```
85
+
86
+ Now you can validate the `HyDAMO` layers inside `your/ directory` by:
87
+ ```
88
+
89
+ directory = Path("your/directory")
90
+
91
+ datamodel, layer_summary, result_summary = hydamo_validator(
92
+ directory=directory, raise_error=False
93
+ )
94
+ ```
@@ -0,0 +1,75 @@
1
+ # The HyDAMO Validation Module: hydamo_validation
2
+
3
+ Validation Module for HyDAMO data.
4
+
5
+ ## Installation
6
+
7
+ ### Python installation
8
+ Make sure you have an Miniconda or Anaconda installation. You can download these here:
9
+ - https://www.anaconda.com/products/individual
10
+ - https://docs.conda.io/en/latest/miniconda.html
11
+
12
+ During installation, tick the box "Add Anaconda to PATH", ignore the red remarks
13
+
14
+ ### Create the `validatietool` environment
15
+ Use the `env/environment.yml` in the repository to create the conda environment: `validatietool`
16
+
17
+ ```
18
+ conda env create -f environment.yml
19
+ ```
20
+
21
+ After installation you can activate your environment in command prompt
22
+
23
+ ```
24
+ conda activate validatietool
25
+ ```
26
+
27
+ ### Install hydamo_validation
28
+ Simply install the module in the activated environment:
29
+
30
+ ```
31
+ pip install hydamo_validation
32
+ ```
33
+
34
+ ### Develop-install hydamo_validation
35
+ Download or clone the repository. Now simply install the module in the activated environment:
36
+
37
+ ```
38
+ pip install .
39
+ ```
40
+
41
+ ## Run in Python
42
+
43
+ ### Specify a coverage directory
44
+ To get the validator running you need some AHN data. You can find these in the [data directory](https://github.com/HetWaterschapshuis/HyDAMOValidatieModule/tree/ee9ea1efed385deb692b89057e9c97114fd8c3be/tests/data/dtm) of this directory. We assume you copy this to `your/local/ahn/dir`. Now specify your coverage and init the validator in a python-script:
45
+
46
+ ```
47
+ from hydamo_validation import validator
48
+ from pathlib import Path
49
+
50
+ coverage = {"AHN": Path("your/local/ahn/dir")}
51
+
52
+ hydamo_validator = validator(
53
+ output_types=["geopackage", "csv", "geojson"], coverages=coverage, log_level="INFO"
54
+ )
55
+
56
+ ```
57
+
58
+ With this validator you can validate a directory that directory should have the following structure. The name of `datasets` directory and `ValidatorRules.json` are mandatory. Within datasets you can put one or more geopackages with `HyDAMO` layers.
59
+
60
+ ```
61
+ your/directory/
62
+ ├─ datasets/
63
+ │ ├─ hydamo.gpkg
64
+ ├─ ValidationRules.json
65
+ ```
66
+
67
+ Now you can validate the `HyDAMO` layers inside `your/ directory` by:
68
+ ```
69
+
70
+ directory = Path("your/directory")
71
+
72
+ datamodel, layer_summary, result_summary = hydamo_validator(
73
+ directory=directory, raise_error=False
74
+ )
75
+ ```
@@ -0,0 +1,23 @@
1
+ __author__ = ["Het Waterschapshuis", "D2HYDRO", "HKV", "HydroConsult"]
2
+ __copyright__ = "Copyright 2021, HyDAMO ValidatieTool"
3
+ __credits__ = ["D2HYDRO", "HKV", "HydroConsult"]
4
+ __version__ = "1.4.1"
5
+
6
+ __license__ = "MIT"
7
+ __maintainer__ = "Daniel Tollenaar"
8
+ __email__ = "daniel@d2hydro.nl"
9
+
10
+ import fiona # top-level import to avoid fiona import issue: https://github.com/conda-forge/fiona-feedstock/issues/213
11
+ from hydamo_validation.functions import topologic as topologic_functions
12
+ from hydamo_validation.functions import logic as logic_functions
13
+ from hydamo_validation.functions import general as general_functions
14
+ from hydamo_validation.validator import validator
15
+
16
+ __all__ = [
17
+ "fiona",
18
+ "topologic_functions",
19
+ "logic_functions",
20
+ "general_functions",
21
+ "validator",
22
+ "SCHEMAS_PATH",
23
+ ]