hydxlib 1.7.6.dev0__tar.gz → 1.7.7__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 (28) hide show
  1. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/CHANGES.rst +8 -1
  2. {hydxlib-1.7.6.dev0/hydxlib.egg-info → hydxlib-1.7.7}/PKG-INFO +9 -2
  3. hydxlib-1.7.7/hydxlib/__init__.py +3 -0
  4. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/exporter.py +1 -1
  5. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/tests/test_threedi.py +29 -0
  6. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/threedi.py +12 -9
  7. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7/hydxlib.egg-info}/PKG-INFO +9 -2
  8. hydxlib-1.7.6.dev0/hydxlib/__init__.py +0 -3
  9. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/LICENSE +0 -0
  10. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/MANIFEST.in +0 -0
  11. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/README.rst +0 -0
  12. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/hydx.py +0 -0
  13. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/importer.py +0 -0
  14. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/scripts.py +0 -0
  15. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/tests/__init__.py +0 -0
  16. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/tests/conftest.py +0 -0
  17. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/tests/test_exporter.py +0 -0
  18. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/tests/test_hydx.py +0 -0
  19. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/tests/test_importer.py +0 -0
  20. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib/tests/test_scripts.py +0 -0
  21. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib.egg-info/SOURCES.txt +0 -0
  22. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib.egg-info/dependency_links.txt +0 -0
  23. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib.egg-info/entry_points.txt +0 -0
  24. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib.egg-info/not-zip-safe +0 -0
  25. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib.egg-info/requires.txt +0 -0
  26. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/hydxlib.egg-info/top_level.txt +0 -0
  27. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/setup.cfg +0 -0
  28. {hydxlib-1.7.6.dev0 → hydxlib-1.7.7}/setup.py +0 -0
@@ -1,7 +1,14 @@
1
1
  Changelog of hydxlib
2
2
  ===================================================
3
3
 
4
- 1.7.6 (unreleased)
4
+ 1.7.7 (2026-06-09)
5
+ ------------------
6
+
7
+ - Set weir cross-section shape to closed rectangle; set cross_section_height from OVS_VOH (mm to m) when present (nens/rana#4429).
8
+ - Profiles without a shape now import with shape=NULL and width/height preserved; unknown shape logs a warning (nens/rana#4429).
9
+
10
+
11
+ 1.7.6 (2026-05-11)
5
12
  ------------------
6
13
 
7
14
  - Support discharge_capacity import
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hydxlib
3
- Version: 1.7.6.dev0
3
+ Version: 1.7.7
4
4
  Summary: Importer and Exporter for GWSW
5
5
  Home-page: https://github.com/nens/hydxlib
6
6
  Author: Nelen & Schuurmans
@@ -104,7 +104,14 @@ install `pre-commit`::
104
104
  Changelog of hydxlib
105
105
  ===================================================
106
106
 
107
- 1.7.6 (unreleased)
107
+ 1.7.7 (2026-06-09)
108
+ ------------------
109
+
110
+ - Set weir cross-section shape to closed rectangle; set cross_section_height from OVS_VOH (mm to m) when present (nens/rana#4429).
111
+ - Profiles without a shape now import with shape=NULL and width/height preserved; unknown shape logs a warning (nens/rana#4429).
112
+
113
+
114
+ 1.7.6 (2026-05-11)
108
115
  ------------------
109
116
 
110
117
  - Support discharge_capacity import
@@ -0,0 +1,3 @@
1
+ # fmt: off
2
+ __version__ = '1.7.7'
3
+ # fmt: on
@@ -434,7 +434,7 @@ def get_cross_section_fields(connection, cross_section_dict):
434
434
  connection["cross_section_table"] = "\n".join(
435
435
  [",".join(row) for row in zip(col1, col2)]
436
436
  )
437
- elif profile["shape"] is not None:
437
+ else:
438
438
  connection["cross_section_width"] = profile["width"]
439
439
  connection["cross_section_height"] = profile["height"]
440
440
  else:
@@ -180,6 +180,18 @@ def test_import_hydx(hydx):
180
180
  "sewerage": True,
181
181
  "cross_section_code": "weir_ovs83",
182
182
  }
183
+ # weir cross-section: always closed rectangle; height from OVS_VOH (mm -> m)
184
+ weir_cross_section_ovs83 = next(
185
+ cs for cs in threedi.cross_sections if cs["code"] == "weir_ovs83"
186
+ )
187
+ assert weir_cross_section_ovs83["shape"] == 0 # CLOSED_RECTANGLE
188
+ assert weir_cross_section_ovs83["height"] == pytest.approx(0.00025) # 0.25 mm -> m
189
+
190
+ weir_cross_section_ovs82 = next(
191
+ cs for cs in threedi.cross_sections if cs["code"] == "weir_ovs82"
192
+ )
193
+ assert weir_cross_section_ovs82["shape"] == 0 # CLOSED_RECTANGLE
194
+ assert weir_cross_section_ovs82["height"] is None # no OVS_VOH set
183
195
  assert threedi.orifices[1] == {
184
196
  "code": "drl97",
185
197
  "display_name": "2002-2002-1",
@@ -202,6 +214,23 @@ def get_profile(**kwargs):
202
214
  return x
203
215
 
204
216
 
217
+ def test_get_cross_section_details_unknown_shape_keeps_width_height(caplog):
218
+ profiel = get_profile(
219
+ identificatieprofieldefinitie="PRO",
220
+ vormprofiel=None,
221
+ breedte_diameterprofiel="800",
222
+ hoogteprofiel="500",
223
+ materiaal="PVC",
224
+ tabulatedbreedte="",
225
+ tabulatedhoogte="",
226
+ )
227
+ actual = get_cross_section_details(profiel, "PRO", "profile")
228
+ assert actual["shape"] is None
229
+ assert actual["width"] == pytest.approx(0.8)
230
+ assert actual["height"] == pytest.approx(0.5)
231
+ assert any(r.levelname == "WARNING" for r in caplog.records)
232
+
233
+
205
234
  @pytest.mark.parametrize(
206
235
  "vrm,bre,hgt,expected",
207
236
  [
@@ -209,20 +209,22 @@ def get_cross_section_details(hydx_profile, record_code, name_for_logging):
209
209
  else:
210
210
  width = hydx_profile.tabulatedbreedte
211
211
  height = hydx_profile.tabulatedhoogte
212
- shape = CrossSectionShape.TABULATED_RECTANGLE.value
213
212
 
214
- if not width:
215
- logger.error(
216
- "%s has an undefined %s.width: %s",
213
+ shape = SHAPE_MAPPING.get(hydx_profile.vormprofiel)
214
+ if shape is None:
215
+ # Unknown/missing shape: fall back to scalar mm fields for width/height
216
+ width = transform_unit_mm_to_m(hydx_profile.breedte_diameterprofiel)
217
+ height = transform_unit_mm_to_m(hydx_profile.hoogteprofiel)
218
+ logger.warning(
219
+ "%s has an unknown %s: %s",
217
220
  record_code,
218
221
  name_for_logging,
219
222
  hydx_profile.vormprofiel,
220
223
  )
221
224
 
222
- shape = SHAPE_MAPPING.get(hydx_profile.vormprofiel)
223
- if shape is None:
225
+ if not width:
224
226
  logger.error(
225
- "%s has an unknown %s: %s",
227
+ "%s has an undefined %s.width: %s",
226
228
  record_code,
227
229
  name_for_logging,
228
230
  hydx_profile.vormprofiel,
@@ -497,11 +499,12 @@ class Threedi:
497
499
  hydx_connection, hydx_structure
498
500
  )
499
501
 
502
+ voh = hydx_structure.vrijeoverstorthoogte
500
503
  profile = {
501
504
  "code": f"weir_{hydx_connection.identificatieknooppuntofverbinding}",
502
- "shape": CrossSectionShape.RECTANGLE.value,
505
+ "shape": CrossSectionShape.CLOSED_RECTANGLE.value,
503
506
  "width": hydx_structure.breedteoverstortdrempel,
504
- "height": None,
507
+ "height": float(voh) * 1e-3 if voh else None,
505
508
  }
506
509
  self.cross_sections.append(profile)
507
510
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hydxlib
3
- Version: 1.7.6.dev0
3
+ Version: 1.7.7
4
4
  Summary: Importer and Exporter for GWSW
5
5
  Home-page: https://github.com/nens/hydxlib
6
6
  Author: Nelen & Schuurmans
@@ -104,7 +104,14 @@ install `pre-commit`::
104
104
  Changelog of hydxlib
105
105
  ===================================================
106
106
 
107
- 1.7.6 (unreleased)
107
+ 1.7.7 (2026-06-09)
108
+ ------------------
109
+
110
+ - Set weir cross-section shape to closed rectangle; set cross_section_height from OVS_VOH (mm to m) when present (nens/rana#4429).
111
+ - Profiles without a shape now import with shape=NULL and width/height preserved; unknown shape logs a warning (nens/rana#4429).
112
+
113
+
114
+ 1.7.6 (2026-05-11)
108
115
  ------------------
109
116
 
110
117
  - Support discharge_capacity import
@@ -1,3 +0,0 @@
1
- # fmt: off
2
- __version__ = '1.7.6.dev0'
3
- # fmt: on
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes