-
Notifications
You must be signed in to change notification settings - Fork 2
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
upgrade 1D #405
Merged
Merged
upgrade 1D #405
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ExpectEmptyCheck and CrossSectionEqualElementsCheck
elisalle
reviewed
Nov 4, 2024
elisalle
reviewed
Nov 4, 2024
elisalle
approved these changes
Nov 4, 2024
…1 and 1602 ensure that material table values are not None) * Fix check 26 by also considering linked material Both changes are tested manually
…ction_value of Pipe, Culvert, Orifice and Weir
…veyanceFrictionCheck
… in all relevant tables
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all apologies to the reviewer for the size of this PR. This could have been handled better with smaller PRs on a feature branch; but hindsight is 20 20. I made an overview below, but it's probably best to review together.
Overview of schema changes that had major effects
Removal of
CrossSectionDefinition
The
CrossSectionDefinition
was moved to linked tables:CrossSectionLocation
,Culvert',
Orifice,
Pipe,
Weir. Therefore, all checks related to
CrossSectionDefinitionhad to be modified an many checks for
CrossSectionLocation` had to be extended to the other four tables.Cross section parameters
Several cross section parameters were moved or reformatted:
cross_section_width
andcross_section_height
now only contain a single float. In case of a tabulated shape, the height and width (or Y and Z) are in a csv table incross_section_table
.vegetation_stem_densities
,vegetation_stem_diameters
,vegetation_heights
andvegetation_drag_coefficients
, are removed and that data is now incross_section_vegetation_table
(vegetation_stem_densities, vegetation_stem_diameters, vegetation_heights, vegetation_drag_coefficients)cross_section_friction_values
containts a comma separated list of friction valuesFor fields that changed from string to float, a number of checks could be removed. For the new comma separated fields, checks are added to ensure their formatting.
Added basic functions
All parameters for tabulated cross sections are formatted as one or more lines of comma separated values and can be easily parsed with
parse_csv_table_col
andparse_csv_table
.Iterating over
cross_section_table
orcross_section_vegetation_table
recordsCrossSectionBaseCheck
is extended with two iterators:parse_cross_section_table
andparse_cross_section_vegetation_table
that enable iterating over these columns. They return the parsed data and the full record.Modified cross section configuration identification
I split
cross_section_configuration
in two, one for tabulated and one for not tabulated, and added wrappercross_section_configuration_for_record
. For tabulated shapes, widths and heights are retrieved withget_widths_heights_for_tabulated_record
which takes into consideration the shape, because the formatting ofcross_section_table
differs betweenTABULATED_YZ
and the other tabulated shapes. I extendedconstants.CrossSectionShape
(in threedi-schema) withis_tabulated
andis_open
to make all this easier.The new functions used for cross section configuration identification are all included in the tests. This reduces the number of test cases required for testing checks that depend on the corss section configuration.