Skip to content
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

272#: Refactor get_location_specification_root_validator #347

Conversation

priscavdsluis
Copy link
Contributor

@priscavdsluis priscavdsluis commented Sep 30, 2022

Edited the existing get_location_specification_rootvalidator and removed the get_number_of_coordinates_validator. This one is merged in the new validator.

The validator is now configurable with a configuration class and the field names are also adjustable with a separate class.

The validator is made up of local functions.
Normally, local functions are not really nice I think, but because we need to have all the information, I think it is better to keep them private and local. This makes the "body" of the actual validation method more tidy and clean.

The validation method now has a more step-wise implementation.

@priscavdsluis priscavdsluis marked this pull request as ready for review October 3, 2022 08:37
hydrolib/core/io/crosssection/models.py Outdated Show resolved Hide resolved
hydrolib/core/io/ini/util.py Show resolved Hide resolved
hydrolib/core/io/ini/util.py Outdated Show resolved Hide resolved
hydrolib/core/io/ini/util.py Show resolved Hide resolved
hydrolib/core/io/ini/util.py Show resolved Hide resolved
tests/io/test_crosssection.py Show resolved Hide resolved
tests/io/test_ext.py Show resolved Hide resolved
tests/io/ini/test_util.py Show resolved Hide resolved
tests/io/ini/test_util.py Show resolved Hide resolved
tests/io/ini/test_util.py Show resolved Hide resolved
Copy link
Contributor

@tim-vd-aardweg tim-vd-aardweg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review OK!

Copy link
Member

@arthurvd arthurvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @priscavdsluis, can you also check my few small comments?

hydrolib/core/io/ini/util.py Show resolved Hide resolved
hydrolib/core/io/ini/util.py Outdated Show resolved Hide resolved
hydrolib/core/io/ini/util.py Outdated Show resolved Hide resolved
hydrolib/core/io/obscrosssection/models.py Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Oct 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tim-vd-aardweg tim-vd-aardweg merged commit f11668e into main Oct 7, 2022
@tim-vd-aardweg tim-vd-aardweg deleted the refactor/272-refactor-get-location-specification-root-validator branch October 7, 2022 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor get_location_specification_rootvalidator to be less nested and more configurable
3 participants