Skip to content

add check 799, change message for 1500 #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Changelog of threedi-modelchecker
2.7.1 (unreleased)
------------------

- Nothing changed yet.
- Add check 799 to warn if raster friction pixels are < 1 while Chezy friction is selected
- Change error message for check 1500


2.7.0 (2024-03-12)
Expand Down
12 changes: 10 additions & 2 deletions threedi_modelchecker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2329,6 +2329,14 @@ def is_none_or_empty(col):
column=models.GlobalSetting.dem_file,
filters=first_setting_filter,
),
RasterRangeCheck(
error_code=799,
level=CheckLevel.WARNING,
column=models.GlobalSetting.frict_coef_file,
filters=CONDITIONS["chezy"].exists(),
min_value=1,
message=f"Some pixels in {models.GlobalSetting.__tablename__}.{models.GlobalSetting.frict_coef_file.name} are less than 1, while friction type is Chézy. This may lead to unexpected results. Did you mean to use friction type Manning?",
),
## 100xx: We continue raster checks from 1400
RasterRangeCheck(
error_code=1401,
Expand Down Expand Up @@ -3149,7 +3157,7 @@ def is_none_or_empty(col):
column=table.friction_value,
filters=table.friction_type == constants.FrictionType.CHEZY.value,
min_value=1,
message=f"{table.__tablename__}.friction_value is less than 1 while CHEZY friction is selected. This may cause nonsensical results.",
message=f"{table.__tablename__}.friction_value is less than 1, while friction type is Chézy. This may lead to unexpected results. Did you mean to use friction type Manning?",
)
for table in [
models.CrossSectionLocation,
Expand All @@ -3165,7 +3173,7 @@ def is_none_or_empty(col):
filters=(table.friction_type == constants.FrictionType.CHEZY.value)
& (table.crest_type == constants.CrestType.BROAD_CRESTED.value),
min_value=1,
message=f"{table.__tablename__}.friction_value is less than 1 while CHEZY friction is selected. This may cause nonsensical results.",
message=f"{table.__tablename__}.friction_value is less than 1, while friction type is Chézy. This may lead to unexpected results. Did you mean to use friction type Manning?",
)
for table in [
models.Orifice,
Expand Down