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

upgrade 1D #405

Merged
merged 100 commits into from
Nov 25, 2024
Merged

upgrade 1D #405

merged 100 commits into from
Nov 25, 2024

Conversation

margrietpalm
Copy link
Contributor

@margrietpalm margrietpalm commented Oct 15, 2024

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 forCrossSectionLocation` had to be extended to the other four tables.

Cross section parameters

Several cross section parameters were moved or reformatted:

  • cross_section_width and cross_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 in cross_section_table.
  • vegetation_stem_densities, vegetation_stem_diameters, vegetation_heights and vegetation_drag_coefficients, are removed and that data is now in cross_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 values

For 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 and parse_csv_table.

Iterating over cross_section_table or cross_section_vegetation_table records

CrossSectionBaseCheck is extended with two iterators: parse_cross_section_table and parse_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 wrapper cross_section_configuration_for_record. For tabulated shapes, widths and heights are retrieved with get_widths_heights_for_tabulated_record which takes into consideration the shape, because the formatting of cross_section_table differs between TABULATED_YZ and the other tabulated shapes. I extended constants.CrossSectionShape (in threedi-schema) with is_tabulated and is_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.

@nens nens deleted a comment from CodiumAI-Agent Oct 23, 2024
@margrietpalm margrietpalm changed the title WIP: upgrade 1D upgrade 1D Oct 30, 2024
@margrietpalm margrietpalm requested a review from elisalle October 30, 2024 11:31
@margrietpalm margrietpalm merged commit 64f0057 into master Nov 25, 2024
8 checks passed
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.

2 participants