Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
246 commits
Select commit Hold shift + click to select a range
47212ec
Kick off work on GeoProb-Pipe
chrispijo Jun 23, 2025
fd715e7
Start gemaakt met main_piping.py met logger en envs
chrispijo Jun 23, 2025
f62fcb1
tussenstand
chrispijo Jun 25, 2025
123bdd9
small changes
chrispijo Jun 26, 2025
c1980d8
Solved some issues from merge. Ready for creation dev branch
chrispijo Jun 26, 2025
6fbd57a
Merge pull request #4 from kkpdata/cp_start
chrispijo Jun 26, 2025
f68dd5c
Codeherziening(#13)
chrispijo Aug 7, 2025
b3d93dc
Update of TODO items in README
actions-user Aug 7, 2025
3314641
actions commit issue
chrispijo Aug 7, 2025
5749705
Merge branch 'dev' of https://github.com/kkpdata/GeoProb-Pipe into dev
chrispijo Aug 7, 2025
ea90f6e
Update of TODO items in README
actions-user Aug 7, 2025
e3bc4de
Testing and coverage
actions-user Aug 7, 2025
4da4df4
Renaming of workflows
chrispijo Aug 7, 2025
20961fe
Merge branch 'dev' of https://github.com/kkpdata/GeoProb-Pipe into dev
chrispijo Aug 7, 2025
019f305
Update of TODO items in README
actions-user Aug 7, 2025
9adbc59
HFreq figuur omgezet naar Plotly (#14)
chrispijo Aug 8, 2025
fdebb25
Update of TODO items in README
actions-user Aug 8, 2025
7457a89
Testing and coverage
actions-user Aug 8, 2025
b7cd65d
first geoprob_pipe package available (#16)
chrispijo Aug 11, 2025
90d6afe
Testing and coverage
actions-user Aug 11, 2025
d9218cb
gitpython for workflow
chrispijo Aug 11, 2025
1b95df2
Merge branch 'dev' of https://github.com/kkpdata/GeoProb-Pipe into dev
chrispijo Aug 11, 2025
4ea461b
Update of TODO items in README
actions-user Aug 11, 2025
a62742e
Feedback na gebruikerssessie WSRL 2025-08-11 grotendeels verwerkt (#17)
chrispijo Aug 14, 2025
07b2acd
Update of TODO items in README
actions-user Aug 14, 2025
f99749d
TODO xlsx toegevoegd
chrispijo Aug 15, 2025
96ca5f2
Update of TODO items in README
actions-user Aug 15, 2025
87eed23
Toevoegingen n.a.v. 224 (#18)
chrispijo Aug 28, 2025
800180a
Update of TODO items in README
actions-user Aug 28, 2025
6ee4a37
Testing and coverage
actions-user Aug 28, 2025
f6dff1c
Bugfix overschrijdingsfrequentie grafiek
chrispijo Aug 28, 2025
07c8488
Merge branch 'dev' of https://github.com/kkpdata/GeoProb-Pipe into dev
chrispijo Aug 28, 2025
eec083d
Update of TODO items in README
actions-user Aug 28, 2025
a809279
Afgeleiden uit limit state functions toegevoegd (#19)
chrispijo Aug 29, 2025
b7b3319
Update of TODO items in README
actions-user Aug 29, 2025
033082e
Testing and coverage
actions-user Aug 29, 2025
98fd972
Pre processing (#21)
chrispijo Aug 29, 2025
bbd1a7d
Update of TODO items in README
actions-user Aug 29, 2025
08ba8c8
Testing and coverage
actions-user Aug 29, 2025
1805de6
Betrouwbaarheidsindex figuren omzetten naar Plotly (#15)
chrispijo Aug 29, 2025
044c9dc
Update of TODO items in README
actions-user Aug 29, 2025
44526dc
Clean up (#24)
chrispijo Aug 29, 2025
bd80b12
Update of TODO items in README
actions-user Aug 29, 2025
9b1fd4f
Testing and coverage
actions-user Aug 29, 2025
74943f6
Clean up (#25)
chrispijo Aug 29, 2025
874e2d4
Update of TODO items in README
actions-user Aug 29, 2025
f6e002e
Testing and coverage
actions-user Aug 29, 2025
d1e5785
Clean up (#26)
chrispijo Aug 29, 2025
d6d9fe1
Update of TODO items in README
actions-user Aug 29, 2025
ca9d28e
Added geoprob_pipe cmd command
chrispijo Sep 2, 2025
3084ea0
Update of TODO items in README
actions-user Sep 2, 2025
26a460e
Voorkomen van crash op missen Chrome
chrispijo Sep 4, 2025
d908d21
Update of TODO items in README
actions-user Sep 4, 2025
5ce337f
Pre-processing dijktrajet uit Waterveiligheidsportaal
chrispijo Sep 4, 2025
2952aa0
Update of TODO items in README
actions-user Sep 4, 2025
07acb61
update main vsc
LauravanderDoef Oct 1, 2025
db22558
Update of TODO items in README
actions-user Oct 1, 2025
689f5b6
beta_scenario_graph naar plotly omgezet
VincentJilesen Oct 1, 2025
b2de987
Verbeteringen n.a.v. beoordeling dijktraject 38-2 (#29)
chrispijo Oct 1, 2025
26e68b6
Update of TODO items in README
actions-user Oct 1, 2025
0268da6
Testing and coverage
actions-user Oct 1, 2025
829d149
Betrouwbaarheidsindex grafieken omgezet naar
VincentJilesen Oct 2, 2025
7fbb835
Kleine aanpassingen na review
chrispijo Oct 6, 2025
9be7032
Verwerken comments en toegevoegd SingleInteractive
VincentJilesen Oct 7, 2025
afaffc9
Merge branch 'Plotly_beta' of https://github.com/kkpdata/GeoProb-Pipe…
VincentJilesen Oct 7, 2025
09521c9
Foutje bij merge underscore verdwenen
VincentJilesen Oct 7, 2025
0b91899
Merge pull request #30 from kkpdata/Plotly_beta
VincentJilesen Oct 8, 2025
f499621
Revert "Plotly beta"
VincentJilesen Oct 8, 2025
1a9320c
Merge pull request #31 from kkpdata/revert-30-Plotly_beta
VincentJilesen Oct 8, 2025
a3b27b4
Update of TODO items in README
actions-user Oct 8, 2025
d092774
Testing and coverage
actions-user Oct 8, 2025
ff7a062
Docs samenwerkdag (#28)
chrispijo Oct 15, 2025
780b082
Update of TODO items in README
actions-user Oct 15, 2025
2c4c979
Testing and coverage
actions-user Oct 15, 2025
ad243f0
Implementatie input Excel en GeoProb-Pipe CMD als volledige applicati…
chrispijo Dec 1, 2025
f2145bc
Update of TODO items in README
actions-user Dec 1, 2025
eca0317
Testing and coverage
actions-user Dec 1, 2025
adde342
Small docstring changes
chrispijo Dec 5, 2025
3e395ef
Update of TODO items in README
actions-user Dec 5, 2025
869f1a3
Testing and coverage
actions-user Dec 5, 2025
26d467a
Solved merge conflicts
chrispijo Dec 5, 2025
3ee703d
Merge branch 'dev' of https://github.com/kkpdata/GeoProb-Pipe into dev
chrispijo Dec 5, 2025
81da103
Update of TODO items in README
actions-user Dec 5, 2025
e141582
Testing and coverage
actions-user Dec 5, 2025
2bcf3b2
Correlation sheet (#47)
chrispijo Dec 5, 2025
2c9b06d
Update of TODO items in README
actions-user Dec 5, 2025
864e2b7
Testing and coverage
actions-user Dec 5, 2025
23a0e45
Plotly grafieken voor betrouwbaarheidsindex (#38)
VincentJilesen Dec 5, 2025
20a9dc4
Update of TODO items in README
actions-user Dec 5, 2025
d7c8d23
Unlinking problem?
chrispijo Dec 5, 2025
e8fc64f
Merge branch 'dev' of https://github.com/kkpdata/GeoProb-Pipe into dev
chrispijo Dec 5, 2025
de60c0a
Update of TODO items in README
actions-user Dec 5, 2025
d78961f
Testing and coverage
actions-user Dec 5, 2025
224191e
Info over nr of iterations toevoegd
chrispijo Dec 11, 2025
166410c
Update of TODO items in README
actions-user Dec 11, 2025
98bbbd9
Testing and coverage
actions-user Dec 11, 2025
3fcd69e
Small changes
chrispijo Dec 12, 2025
a9c2697
Merge branch 'dev' of https://github.com/kkpdata/GeoProb-Pipe into dev
chrispijo Dec 12, 2025
54f2adc
Update of TODO items in README
actions-user Dec 12, 2025
83d2493
Testing and coverage
actions-user Dec 12, 2025
7d64532
Plot phys values (#44)
chrispijo Dec 15, 2025
61acdeb
Update of TODO items in README
actions-user Dec 15, 2025
ebaca21
Testing and coverage
actions-user Dec 15, 2025
425c27f
Test branch (#51)
chrispijo Dec 15, 2025
d8d0db0
Update of TODO items in README
actions-user Dec 15, 2025
2361a81
Testing and coverage
actions-user Dec 15, 2025
782ccf7
Hotfix vak ID nummer in resultaat grafiek
chrispijo Dec 17, 2025
fa44241
Update of TODO items in README
actions-user Dec 17, 2025
dfba98a
Testing and coverage
actions-user Dec 17, 2025
0118018
Htmlkaart vincent (#48)
VincentJilesen Jan 6, 2026
dfa9ef4
Update of TODO items in README
actions-user Jan 6, 2026
3b13f09
Testing and coverage
actions-user Jan 6, 2026
fcbd034
Version up
chrispijo Jan 16, 2026
ac1a3f9
Update of TODO items in README
actions-user Jan 16, 2026
1712cab
Testing and coverage
actions-user Jan 16, 2026
2a6685b
Result comparison (#49)
VincentJilesen Jan 20, 2026
d7b7e23
Update of TODO items in README
actions-user Jan 20, 2026
2492470
Testing and coverage
actions-user Jan 20, 2026
6af1416
Adding debug issue found by Lars
chrispijo Jan 21, 2026
2ac9b87
Update of TODO items in README
actions-user Jan 21, 2026
bf57614
Testing and coverage
actions-user Jan 21, 2026
2d9bb3b
Parallel 2026 (#53)
VincentJilesen Jan 23, 2026
e30adf8
Update of TODO items in README
actions-user Jan 23, 2026
bb4bd6a
Testing and coverage
actions-user Jan 23, 2026
bfcf05e
Added GeoDatabase option for vakindeling
chrispijo Jan 26, 2026
b3265fe
Update of TODO items in README
actions-user Jan 26, 2026
108d82a
Hotfix MultiLineString vakindeling
chrispijo Jan 27, 2026
b2fddc6
Update of TODO items in README
actions-user Jan 27, 2026
b7891c0
Betrouwbaarheidsindex converged (#52)
VincentJilesen Jan 29, 2026
8c979c1
Update of TODO items in README
actions-user Jan 29, 2026
fe5ebaf
Small fix
chrispijo Feb 2, 2026
1106c3d
Update of TODO items in README
actions-user Feb 2, 2026
01f682e
Version upped
chrispijo Feb 3, 2026
cdfebf2
Merge branch 'dev' of https://github.com/kkpdata/GeoProb-Pipe into dev
chrispijo Feb 3, 2026
adc2b95
Update of TODO items in README
actions-user Feb 3, 2026
c480d20
PNG-figuren uitfaseren (#56)
chrispijo Feb 3, 2026
da7201e
Update of TODO items in README
actions-user Feb 3, 2026
fb5b1f2
issue_df_scenarios
chrispijo Feb 4, 2026
ad850b4
Update of TODO items in README
actions-user Feb 4, 2026
3c1df21
Fix issue betrouwbaarheids-graph and df_scenarios-export (#57)
chrispijo Feb 4, 2026
dce2204
Update of TODO items in README
actions-user Feb 4, 2026
981f76b
Docs samenwerkdag (#55)
chrispijo Feb 5, 2026
c8cce1d
Update of TODO items in README
actions-user Feb 5, 2026
9d256e6
Testing and coverage
actions-user Feb 5, 2026
ebed583
Refactor 2026 (#58)
chrispijo Feb 11, 2026
9bbc3bb
update test workflow
chrispijo Feb 11, 2026
e7c195e
update test workflow
chrispijo Feb 11, 2026
be9ccdb
update test workflow
chrispijo Feb 11, 2026
64d8cad
Testing and coverage
actions-user Feb 11, 2026
c32b676
Fixed unit test workflow issue
chrispijo Feb 11, 2026
995d857
Merge branch 'dev' of https://github.com/kkpdata/GeoProb-Pipe into dev
chrispijo Feb 11, 2026
9a6b7b0
Fixed unit test workflow issue
chrispijo Feb 11, 2026
4a2a7dc
version bump
chrispijo Feb 11, 2026
81694a9
Fixed some issues following from refactoring
chrispijo Feb 12, 2026
b6a568b
Update van readme
chrispijo Feb 12, 2026
e5993bf
small changes
chrispijo Feb 12, 2026
be5fcd1
New branch scheme'
chrispijo Feb 12, 2026
3af2e79
Beta branch introdution
chrispijo Feb 12, 2026
9c490c9
Test new release
chrispijo Feb 12, 2026
4fc7645
onafgemaakte workflow verwijderd
chrispijo Feb 12, 2026
b7f8b63
Version bump (#60)
chrispijo Feb 12, 2026
1087582
Solved merge conflicts
chrispijo Feb 12, 2026
c5c37a3
Removal of old workflow file
chrispijo Feb 12, 2026
3166aba
Worker buffer + fix issue buitenwaterstand beta (#64)
chrispijo Feb 23, 2026
6978225
Testing and coverage
actions-user Feb 23, 2026
05d25a7
Release workflow (#65)
chrispijo Feb 23, 2026
d047241
Solved merge conflicts
chrispijo Feb 23, 2026
5d3c156
Update of beta + test PyPI workflow (#66)
chrispijo Feb 23, 2026
3f8c257
Solved merge conflicts
chrispijo Feb 23, 2026
5e9ee96
Hotfix: Pandas bug in GraphHFreqInteractive
VincentJilesen Feb 24, 2026
f546e6b
hotfix: utp weer in hfeq figuur
VincentJilesen Feb 24, 2026
04ce239
Small updates
chrispijo Mar 4, 2026
8c7ac2c
Small updates (#69)
chrispijo Mar 4, 2026
a9362ca
Merge branch 'alpha' of https://github.com/kkpdata/GeoProb-Pipe into …
chrispijo Mar 4, 2026
b3c4697
Merge conflicts solved
chrispijo Mar 4, 2026
19e5708
Start validatie Excel-sheet (#62)
chrispijo Mar 4, 2026
3f7e5ec
Version bump
chrispijo Mar 4, 2026
6444eed
Branch scheme update
chrispijo Mar 4, 2026
da2d8e3
Use of PAT token
chrispijo Mar 5, 2026
f5c247b
Testing and coverage
chrispijo Mar 5, 2026
7707b47
Implementation of new SystemCalculation structure (#68)
chrispijo Mar 6, 2026
b90afe2
Testing and coverage
chrispijo Mar 6, 2026
34237f6
Update of test worfklow
chrispijo Mar 6, 2026
128b38c
Solved merge conflicts
chrispijo Mar 6, 2026
8760e1c
fix in workflow
chrispijo Mar 6, 2026
7b89831
Workflow updat
chrispijo Mar 6, 2026
f7d87a4
Sphinx docs release (#74)
chrispijo Mar 6, 2026
8207b5d
Small change
chrispijo Mar 6, 2026
1de3b42
Update of documentation (#72)
chrispijo Mar 18, 2026
e486313
Version bump
chrispijo Mar 18, 2026
94b5cb9
Cmd debug-modus en loggen in GeoPackage (#76)
chrispijo Mar 23, 2026
6faf825
[auto] Testing and coverage
chrispijo Mar 23, 2026
ff31df1
solved merge conflicts
chrispijo Mar 23, 2026
984dd9d
Small improvement vak-selection
chrispijo Mar 23, 2026
d68f032
Bugfix ComparisonCollector
chrispijo Mar 23, 2026
9ee1001
Version diff warning (#80)
chrispijo Mar 25, 2026
98fb914
Small change
chrispijo Mar 25, 2026
8679c6d
Update changelog
chrispijo Mar 25, 2026
ed9ddd5
Test workflow (#82)
chrispijo Mar 30, 2026
a75b353
Test workflow
chrispijo Mar 30, 2026
8db4f17
Merge branch 'alpha' of https://github.com/kkpdata/GeoProb-Pipe into …
chrispijo Mar 30, 2026
5a99f55
Test workflow
chrispijo Mar 30, 2026
f9ceb50
test force change
chrispijo Mar 30, 2026
5759fd4
test force change
chrispijo Mar 30, 2026
38b1e11
Test workflow
chrispijo Mar 30, 2026
811d18b
Small change
chrispijo Mar 30, 2026
6764583
Small change
chrispijo Mar 30, 2026
b9e3d24
[auto] Testing and coverage
github-actions[bot] Mar 30, 2026
a66024e
finishing up
chrispijo Mar 30, 2026
1e888fc
Hotfix vergelijk resultaten
chrispijo Apr 8, 2026
8ebcfd6
Solved merge conflicts
chrispijo Apr 8, 2026
d0922dc
Hydra-NL optioneel (#84)
chrispijo Apr 15, 2026
09aec9b
[auto] Testing and coverage
github-actions[bot] Apr 15, 2026
2b3d659
Solve merge conflicts
chrispijo Apr 15, 2026
8d78fb9
Duidelijkere weblinks naar docs en broncode
chrispijo Apr 20, 2026
c4645c9
Assemblage tool (#54)
VincentJilesen Apr 22, 2026
ec39978
[auto] Testing and coverage
github-actions[bot] Apr 22, 2026
5c94999
Feedback Sander (#86)
chrispijo Apr 23, 2026
3d9971e
[auto] Testing and coverage
github-actions[bot] Apr 23, 2026
4f96681
DataFrame validation (#87)
chrispijo Apr 23, 2026
eaf3462
Uittredepunt invoer op scenario-niveau toepassen (#88)
chrispijo May 4, 2026
0a56178
Solved merge conflicts
chrispijo May 4, 2026
8908bd5
Update lock file
chrispijo May 4, 2026
f49584f
Update lock file
chrispijo May 4, 2026
271de54
Update lock file
chrispijo May 4, 2026
d6a82c3
Small change
chrispijo May 4, 2026
49719af
Small extension of validation requirements
chrispijo May 4, 2026
00f6de6
Small extension of validation requirements
chrispijo May 4, 2026
b21b370
Pydra-core vast gezet. Anders error
chrispijo May 8, 2026
cacb470
Fix error in requirements.txt
chrispijo May 8, 2026
8df4f69
Fix error in project.toml
chrispijo May 8, 2026
4ccce57
Fix crash of geoprob-pipe in validation (#91)
skapinga May 21, 2026
1d0c5dc
[auto] Testing and coverage
github-actions[bot] May 21, 2026
e893615
Solved merge conflicts
chrispijo May 21, 2026
78e5734
Update workflow actions (#94)
chrispijo May 22, 2026
9f661f3
action update
chrispijo May 22, 2026
a631a8c
Version up to trigger main workflows
chrispijo May 22, 2026
a7554eb
Prep voor nieuwe PyPI readme
chrispijo May 22, 2026
087131e
Version up voor PyPI image test
chrispijo May 22, 2026
af9071d
Solved merge conflicts
chrispijo May 22, 2026
f2e9c18
Update toml en readme voor PyPI
chrispijo May 22, 2026
63876bd
Solved merge conflicts
chrispijo May 22, 2026
b929135
Feedback na regionaal toepassen Mariska en Mark (#98)
chrispijo Jun 1, 2026
d8caaf8
Solved merge conflicts
chrispijo Jun 1, 2026
45e8320
Kans elementen met een PoF van NaN resulteert in crash (#104)
chrispijo Jul 7, 2026
fc153d7
Solved merge conflicts
chrispijo Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions geoprob_pipe/changelog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

CHANGELOG = {
"2.2.11":
"Bug fix. When there were NaN-calculation results (PoF), it resulted in a crash in the KansElement.",
"2.2.10":
"Bug fix en added validation. Traject probability of failure kon net boven 1.0 uitkomen door de toegepaste "
"rekentechniek. Daarnaast om het gebruik van de applicatie te verbeteren extra validatie toegepast, zoals dat "
Expand Down
91 changes: 33 additions & 58 deletions geoprob_pipe/results/assemblage/objects.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from __future__ import annotations
from dataclasses import dataclass
import math
from typing import Optional, List, Tuple, cast
from geoprob_pipe.results.assemblage.functions import bepaal_N_vak
import scipy.stats as stats # importeer de scipy.stats module
from geoprob_pipe.results.assemblage.functions import (
combine_series, window_collect, scaled_collect)
from geoprob_pipe.results.assemblage.functions import combine_series, window_collect, scaled_collect
import numpy as np


@dataclass
Expand All @@ -23,27 +22,24 @@ class te initialiseren.

def __post_init__(self):

if self.pf is not None:
if not (0.0 <= self.pf <= 1.0):
raise ValueError(f"pof moet tussen 0.0 en 1.0 liggen. Huidige waarde is {self.pf}")
pf_is_nan = self.pf is None or np.isnan(self.pf)
beta_is_nan = self.beta is None or np.isnan(self.beta)

# if self.beta is not None:
# if not math.isfinite(self.beta):
# raise ValueError("beta moet een eindige waarde zijn.")
# if (-38.0 <= self.beta <= 38.0) is False:
# raise ValueError("beta moet tussen -38.0 en 38.0 liggen.")
if not pf_is_nan:
if not (0.0 <= self.pf <= 1.0):
raise ValueError(
f"pof moet tussen 0.0 en 1.0 liggen. Huidige waarde is {self.pf}. Beta waarde is {self.beta}.")

if self.pf is None and self.beta is not None:
if pf_is_nan and not beta_is_nan:
self.pf = float(stats.norm.cdf(-1.0 * self.beta))

if self.beta is None and self.pf is not None:
if beta_is_nan and not pf_is_nan:
self.beta = -1.0 * float(stats.norm.ppf(self.pf))


@dataclass
class UittredepuntElement:
"""DataClass om alle relevante data van een uittredepunt te verzamelen.
"""
""" DataClass om alle relevante data van een uittredepunt te verzamelen. """
m_value: float
a: float
converged: bool
Expand All @@ -54,29 +50,26 @@ class UittredepuntElement:

def __post_init__(self):

if self.pf is not None:
if not (0.0 <= self.pf <= 1.0):
raise ValueError(f"pof moet tussen 0.0 en 1.0 liggen. Huidige waarde is {self.pf}")
pf_is_nan = self.pf is None or np.isnan(self.pf)
beta_is_nan = self.beta is None or np.isnan(self.beta)

# if self.beta is not None:
# if not math.isfinite(self.beta):
# raise ValueError("beta moet een eindige waarde zijn.")
# if (-38.0 <= self.beta <= 38.0) is False:
# raise ValueError("beta moet tussen -38.0 en 38.0 liggen.")
# Validate pof value
if not pf_is_nan:
if not (0.0 <= self.pf <= 1.0):
raise ValueError(
f"De pof moet tussen 0.0 en 1.0 liggen. Huidige waarde is {self.pf}. Beta waarde is {self.beta}.")

if self.pf is None and self.beta is not None:
if pf_is_nan and not beta_is_nan:
self.pf = float(stats.norm.cdf(-1.0 * self.beta))

if self.beta is None and self.pf is not None:
if beta_is_nan and not pf_is_nan:
self.beta = -1.0 * float(stats.norm.ppf(self.pf))


@dataclass
class VakElement:
""" DataClass om alle relevante data van een vak te verzamelen.
Vanuit deze class kunnen de verschillende methoden om tot een faalkans van
het vak worden bepaald.
"""
""" DataClass om alle relevante data van een vak te verzamelen. Vanuit deze class kunnen de verschillende methoden
om tot een faalkans van het vak worden bepaald. """
id: int
m_van: float # Locatie van het begin van het element [meters]
m_tot: float # Locatie van het einde van het element [meters]
Expand Down Expand Up @@ -139,21 +132,14 @@ def conv_max_dsn(self) -> bool:
# vak: moving window met variable lengtes
def pf_window(self, window_size: float):
pf_sum, pf_max, window_elements = window_collect(
window_size=window_size, point_list=self.dsn_list,
m_van=self.m_van, m_tot=self.m_tot, vak_id=self.id
)
"""Helper om de `window_collect` functie op te zetten voor alle
attributen.
"""
window_size=window_size, point_list=self.dsn_list, m_van=self.m_van, m_tot=self.m_tot, vak_id=self.id)
""" Helper om de `window_collect` functie op te zetten voor alle attributen. """
return KansElement(pf=pf_sum), KansElement(pf=pf_max), window_elements

@property
def pf_scaled(self) -> Tuple[KansElement, KansElement,
List[WindowElement]]:
def pf_scaled(self) -> Tuple[KansElement, KansElement, List[WindowElement]]:
pf_sum, pf_max, window_elements = scaled_collect(
self.delta_length, self.dsn_list, self.m_van,
self.m_tot, vak_id=self.id
)
self.delta_length, self.dsn_list, self.m_van, self.m_tot, vak_id=self.id)
return KansElement(pf=pf_sum), KansElement(pf=pf_max), window_elements


Expand Down Expand Up @@ -205,24 +191,19 @@ def m_uittredepunt(self) -> float:
if isinstance(self._m_uittredepunt, float):
return self._m_uittredepunt
else:
raise AttributeError(
"No attribute m_uittredepunt specified in object."
)
raise AttributeError("No attribute m_uittredepunt specified in object.")

@property
def n_vak(self) -> float:
if isinstance(self._n_vak, float):
return self._n_vak
else:
raise AttributeError(
"No attribute N_vak specified in object."
)
raise AttributeError("No attribute N_vak specified in object.")


@dataclass
class TrajectElement:
"""DataClass om de data van het traject te verzamelen.
"""
""" DataClass om de data van het traject te verzamelen. """
list_vakken: list[VakElement]
list_dsn: list[UittredepuntElement]
delta_length: float
Expand Down Expand Up @@ -256,18 +237,12 @@ def pf_max_vak(self) -> Tuple[KansElement, KansElement]:
# traject: moving window met variable lengtes
def pf_window(self, window_size: float) -> Tuple[KansElement, KansElement, List[WindowElement]]:
pf_sum, pf_max, window_elements = window_collect(
window_size=window_size, point_list=self.list_dsn,
m_van=self.m_van, m_tot=self.m_tot, vak_id=None
)
"""Helper om de `window_collect` functie op te zetten voor alle
attributen.
"""
window_size=window_size, point_list=self.list_dsn, m_van=self.m_van, m_tot=self.m_tot, vak_id=None)
""" Helper om de `window_collect` functie op te zetten voor alle attributen. """
return KansElement(pf=pf_sum), KansElement(pf=pf_max), window_elements

@property
def pf_scaled(self) -> Tuple[KansElement, KansElement,
List[WindowElement]]:
def pf_scaled(self) -> Tuple[KansElement, KansElement, List[WindowElement]]:
pf_sum, pf_max, window_elements = scaled_collect(
dL=self.delta_length, point_list=self.list_dsn,
m_van=self.m_van, m_tot=self.m_tot, vak_id=None)
dL=self.delta_length, point_list=self.list_dsn, m_van=self.m_van, m_tot=self.m_tot, vak_id=None)
return KansElement(pf=pf_sum), KansElement(pf=pf_max), window_elements
110 changes: 56 additions & 54 deletions geoprob_pipe/visualizations/maps/betamap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,34 @@
from typing import TYPE_CHECKING, Dict, List, Tuple
import plotly.graph_objects as go
import os
import geopandas as gpd
from pandas import DataFrame
from geopandas import GeoDataFrame, read_file
from shapely.geometry import LineString, MultiLineString, GeometryCollection

if TYPE_CHECKING:
from geoprob_pipe import GeoProbPipe


def _add_line(geoprob_pipe: GeoProbPipe, fig: go.Figure,
layer: str, color: str):
def _calculate_zoom(lat_range, lon_range):
max_range = max(lat_range, lon_range)
if max_range < 0.01:
return 15
elif max_range < 0.05:
return 13
elif max_range < 0.1:
return 12
elif max_range < 0.5:
return 10
elif max_range < 1.0:
return 9
else:
return 8


def _add_line(geoprob_pipe: GeoProbPipe, fig: go.Figure, layer: str, color: str):
""" Helperfunctie om de lijnen uit de geopackage te vinden en toe te voegen aan de map. Layer is de naam van de
laag in de geopackage waar de lijn is opgeslagen. Color is de kleur van deze lijn in de map. """

gdf_traject = gpd.read_file(
gdf_traject = read_file(
geoprob_pipe.input_data.app_settings.geopackage_filepath,
layer=layer)
gdf_traject = gdf_traject.to_crs("EPSG:4326")
Expand Down Expand Up @@ -115,52 +130,39 @@ def __init__(self, geoprob_pipe: GeoProbPipe, export: bool = False):

def _import_results(self):
# results import
self.inp_point = self.geoprob_pipe.input_data.uittredepunten.gdf
self.res_sc = self.geoprob_pipe.results.df_beta_scenarios_final
mask = self.inp_point["uittredepunt_id"].isin(self.res_sc["uittredepunt_id"])
self.inp_point = self.inp_point[mask]
self.gdf_uittredepunten: GeoDataFrame = self.geoprob_pipe.input_data.uittredepunten.gdf
self.df_beta_scenarios_final: DataFrame = self.geoprob_pipe.results.df_beta_scenarios_final
mask = self.gdf_uittredepunten["uittredepunt_id"].isin(self.df_beta_scenarios_final["uittredepunt_id"])
self.gdf_uittredepunten = self.gdf_uittredepunten[mask]

# Setup of beta category limits
self.cg: Dict[str, List] = self.geoprob_pipe.input_data.traject_normering.riskeer_categorie_grenzen
self.labels: List[str] = list(self.cg.keys())
self.categorie_grenzen: Dict[str, List] = self.geoprob_pipe.input_data.traject_normering.riskeer_categorie_grenzen
self.labels_categorie_grenzen: List[str] = list(self.categorie_grenzen.keys())

def _setup_gdf(self):
self.hoverdata = ["uittredepunt_id", "converged", "beta"]

self.df = self.res_sc.merge(self.inp_point, on="uittredepunt_id", how="inner")
idx = self.df.groupby(["uittredepunt_id"])["beta"].idxmin()
self.df = self.df.loc[idx]
# Prep dataframe
df = self.df_beta_scenarios_final.merge(self.gdf_uittredepunten, on="uittredepunt_id", how="inner")
gdf = GeoDataFrame(df, geometry="geometry", crs=self.gdf_uittredepunten.crs)

self.gdf = gpd.GeoDataFrame(
self.df,
geometry=gpd.points_from_xy(self.inp_point.geometry.x, self.inp_point.geometry.y),
crs="EPSG:28992")
# Transformeer naar WGS84 (latitude / longitude)
self.gdf_latlon = self.gdf.to_crs("EPSG:4326")
# Filter uit NAN values TODO: Present nan values in a way?
gdf = gdf[~gdf["beta"].isna()]

# Continue logic
idx = gdf.groupby(["uittredepunt_id"])["beta"].idxmin() # TODO: Unclear what this line adds/does.
gdf = gdf.loc[idx]
self.gdf_latlon = gdf.to_crs("EPSG:4326")

def _determine_zoom(self):
self.center_lat = self.gdf_latlon.geometry.y.mean()
self.center_lon = self.gdf_latlon.geometry.x.mean()

self.min_lat = self.gdf_latlon.geometry.y.min()
self.max_lat = self.gdf_latlon.geometry.y.max()
self.min_lon = self.gdf_latlon.geometry.x.min()
self.max_lon = self.gdf_latlon.geometry.x.max()

def _calculate_zoom(lat_range, lon_range):
max_range = max(lat_range, lon_range)
if max_range < 0.01:
return 15
elif max_range < 0.05:
return 13
elif max_range < 0.1:
return 12
elif max_range < 0.5:
return 10
elif max_range < 1.0:
return 9
else:
return 8

self.lat_range = self.max_lat - self.min_lat
self.lon_range = self.max_lon - self.min_lon
self.zoom = _calculate_zoom(self.lat_range, self.lon_range)
Expand All @@ -180,30 +182,30 @@ def _create_figure(self):
marker=dict(
size=8,
color=self.gdf_latlon['beta'],
colorscale=_generate_colorscale(cg=self.cg, labels=self.labels),
cmin=self.cg[self.labels[6]][0],
cmax=self.cg[self.labels[0]][1],
colorscale=_generate_colorscale(cg=self.categorie_grenzen, labels=self.labels_categorie_grenzen),
cmin=self.categorie_grenzen[self.labels_categorie_grenzen[6]][0],
cmax=self.categorie_grenzen[self.labels_categorie_grenzen[0]][1],
colorbar=dict(
title="Bèta, WBI cat.",
tickvals=[
self.cg[self.labels[6]][0],
self.cg[self.labels[6]][1],
self.cg[self.labels[5]][1],
self.cg[self.labels[4]][1],
self.cg[self.labels[3]][1],
self.cg[self.labels[2]][1],
self.cg[self.labels[1]][1],
self.cg[self.labels[0]][1]
self.categorie_grenzen[self.labels_categorie_grenzen[6]][0],
self.categorie_grenzen[self.labels_categorie_grenzen[6]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[5]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[4]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[3]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[2]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[1]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[0]][1]
],
ticktext=[f"{v:.2f}" for v in [
self.cg[self.labels[6]][0],
self.cg[self.labels[6]][1],
self.cg[self.labels[5]][1],
self.cg[self.labels[4]][1],
self.cg[self.labels[3]][1],
self.cg[self.labels[2]][1],
self.cg[self.labels[1]][1],
self.cg[self.labels[0]][1]]],
self.categorie_grenzen[self.labels_categorie_grenzen[6]][0],
self.categorie_grenzen[self.labels_categorie_grenzen[6]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[5]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[4]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[3]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[2]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[1]][1],
self.categorie_grenzen[self.labels_categorie_grenzen[0]][1]]],
)
),
hoverinfo='text',
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[tool.poetry]
name = "geoprob_pipe"
version = "2.2.10"
version = "2.2.11"
description = "Execute probabilistic piping calculations using the Deltares probabilic library."
keywords = [
"levee",
Expand Down