Skip to content

Commit

Permalink
feat(grouper): #93 Throw ValueError when providing less than 2 CPTs t…
Browse files Browse the repository at this point in the history
…o create_grouper_payload()
  • Loading branch information
Thijs Lukkezen authored and tlukkezen committed Sep 25, 2024
1 parent dc485dc commit bc4965d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/pypilecore/input/grouper_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def create_grouper_payload(
Parameters
----------
cpt_results_dict:
Dictionary with key as CPT name and value a SingleCPTBearingResults class
Dictionary with key as CPT name and value a SingleCPTBearingResults class.
Should contain at least 2 entries.
pile_load_uls
ULS load in kN. Used to determine if a grouping configuration is valid.
stiff_construction
Expand Down Expand Up @@ -131,12 +132,12 @@ def create_grouper_payload(
ValueError:
- if NaN values are present in negative friction, bottom or shaft bearing_capacity
- if x or y coordinate is None
- if pile tip levels don't macht for all SingleCPTBearingResults
- if less than 2 valid CPTs are provided
Returns
-------
Expand Down Expand Up @@ -212,6 +213,12 @@ def create_grouper_payload(
},
}
)

if not len(cpt_objects) >= 2:
raise ValueError(
"The PileCore grouper requires at least 2 CPTs with valid bearing capacity."
)

payload["cpt_objects"] = cpt_objects

# validate pile tip levels
Expand Down

0 comments on commit bc4965d

Please sign in to comment.