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.
PR - NGWPC PI7 Delivery
Modifications and additions to bring in NGWPC work in PI3 - PI7, including: Pulling 3dep DEM Tiles, Variable HUC Level Parameterization (HLP), HPC Capabilities (Slurm), USGS High Water Mark & Ripple1d SRC incorporation.
Description
OWP’s latest
mainbranch (v4.8.7.33c237df) has been merged, extensive comments have been inserted where breaking changes to exisitng NWCPC functionality occur, and where future resolutions are likely. The branch submitted as this Pull Request has been modified to prioritize HLP, and the existing pre clip directories (s3://fimc-data/hand_fim/inputs/pre_clip/25_05_10_huc${huc_level}). This required reverting certain sections of code to the 5/22 Release (v4.6.1.4,84b5ae3). Searching for the stringv4.8.7.3should reveal the majority of the breaking changes, with their resolutions. There is a possibility that some resolutions were made without including thev4.8.7.3string in a comment, so these resolutions may not be fully inclusive. See Outstanding Items.PR #1206 introduced modifications that are incompatible with HLP and USGS HWM functionality. All SRC and post processing steps require further investigation with regards to full compatibility and accuracy, given the divergence with new modules introduced in both NGWPC and OWP codebases.
The current pre clip directories in use (
pre_clip_huc_dirinsrc/bash_variables.env) do not have newest bridge data. To enable the use of this codebase using existing pre clip directories, routines to incorporate updated osm bridge data have been reverted to 5/22 version of codebase. All osm bridge functionality should be reviewed and tested, as there was significant divergence. A good faith attempt was make to keep this functionality intact, but due to the discrepancy in input data, this component will likely require further resolutions.Files and directories which exist in the
dev-NGWPCbranch, but were removed in main (v4.8.7.3), persisted beyond the merge. Theunit_tests/folder, andconfig/aws_s3_put_fim3_hydrovis_whitelist.lstfile were deleted to match what is in themainbranch. There may be additional files and folder deletions stemming from the divergence which were not identified and removed.Additions
data/nws/.gitignoreusgs/clip_tile_indices.pycreate_3dep_tile_index.pyget_3dep_static_tiles.pywbd/generate_pre_clip_fim_huc.pyget_child_or_parent_hucs_for_huc_list.pyhucs.pyslurm/check_arguments.shREADME.mdslurm_partition_process_unit.shslurm_pipeline.shslurm_post_processing.shslurm_pre_processing.shslurm_process_unit_wb_partitions.shslurm_process_unit_wb_restart.shslurm_process_unit_wb.shslurm_sierra_test.shslurm_single_fim_pipeline.shsrc/fill_depressions.pysrc_adjust_ripple1d_rating.pytools/acquire_tigerweb_data.pyconvert_city_names_to_huc8s.pycreate_completion_maps.pypartition_and_write_parquet.pyChanges
.gitignoreDockerfile.devPipfilePipfile.lockREADME.mdconfig/deny_branches.lstdeny_unit.lstparams_template.envdata/wbd/generate_pre_clip_fim_huc8.pypreprocess_wbd.pyfim_pipeline.shfim_post_processing.shfim_pre_processing.shfim_process_unit_wb.shpyproject.tomlsrc/accumulate_headwaters.pyadd_crosswalk.pyadjust_thalweg_lateral.pyaggregate_by_huc.pyagreedem.pybash_functions.envbash_variables.envbathymetric_adjustment.pybuild_stream_traversal.pycheck_huc_inputs.pydelineate_hydros_and_produce_HAND.shfilter_catchments_and_add_attributes.pygenerate_branch_list_csv.pyheal_bridges_osm.pyidentify_src_bankfull.pymake_rem.pymask_dem.pyprocess_branch.shrun_unit_wb.shsplit_flows.pysrc_adjust_ras2fim_rating.pysrc_adjust_spatial_obs.pysrc_adjust_usgs_rating_trace.pysrc_roughness_optimization.pystream_branches.pysubdiv_chan_obank_src.pyunique_pixel_and_allocation.pyupdate_htable_src.pyusgs_gage_crosswalk.pyusgs_gage_unit_setup.pyutils/shared_functions.pytools/combine_crosswalk_tables.pyhash_compare.pyrun_test_case.pytools_shared_functions.pyRemovals
Testing
The code proposed as part of this branch has been tested, and outputs are on S3:
s3://fimc-data/hand_fim/outputs/merge_NGWPC_and_v4_8_7_3/HUC<>s_MERGED.There are three HUC levels and three versions tested. These outputs were generated to test and compare the original NGWPC branch (
dev-NGWPC), identified with the naming patternHUC<>s_NGWPC. Themainbranch, identified with the naming patternHUC8s_v4_8_7_3. And the merged branch (dev-NGWPC-merge-main-temp), identified with the naming patternHUC<>s_MERGED.Methods
The process taken for this pull request is as follows:
1.) Checkout
dev-NGWPCbranch2.) Create a new branch named
dev-NGWPC-merge-main3.) Merge main (v4.8.7.3 commit:
3c237df758a8055c14bfe9af36d425fc336c474c)4.) Resolve all merge conflicts, with a focus on keeping NGWPC functionality intact
Commit (
055ae80805549620e263fdd4355f2045c21bd608) and push this branch to NGWPC fork5.) From
dev-NGWPC-merge-main, checkout a new branch nameddev-NGWPC-merge-main-temp6.) Continued merge conflicts and resolutions in this branch, focusing on the enablement of NGWPC code to successfully complete processing without any errors.
7.) Made commits directly to this branch
src/bash_variables.env) to reference HLP data on PW EFSunit_tests/directory (directory not deleted as part of merge)aggregrate_by_huc.py8.) Create a patch with all changes, and condense into a single commit:
git diff main..dev-NGWPC-merge-main-temp > main-merge-NGWPC.patchgit checkout maingit checkout -b main-v_4_8_7_3-NGWPC-mergegit apply main-merge-NGWPC.patchrm main-merge-NGWPC.patchgit add .git commit --no-verifyIncorporate all NGWPC work (HLP, Slurm, HWM, Ripple1d) Resolve merge conflicts. Co-authored-by: fernando-aristizabal <[email protected]> Co-authored-by: BradfordBates-NOAA <[email protected]> Co-authored-by: cwlyden <[email protected]>git push -u origin main-v_4_8_7_3-NGWPC-merge9.) Issue Pull Request
Notes on Commit History
Due to the significant divergence in commit histories, the preferred operation of
git rebase mainwas not practical. Attempts were made tocherry-pickcommits from NGWPC work and apply them to new branch checked out frommain, but this does not remove the necesity to resolve all merge conflicts. Therefore, a patch was created, and all the NGWPC commits were consolidated in one commit, using the process outlined above.Outstanding Items
Searching for the string
v4.8.7.3should reveal locations where adjustments were needed to enable HLP with existing input data. Below should not be considered a comprehensive list, as there may be other locations where adjustments are necessary, namely in post-processing steps.The following files contain conflicts, where a resolution was made to keep HLP functionality intact and/or suggest HLP incorporation:
data/wbd/generate_pre_clip_fim_huc8.pysrc/add_crosswalk.pysrc/aggregate_by_huc.pysrc/bash_variables.envsrc/bathymetric_adjustment.pysrc/delineate_hydros_and_produce_HAND.shsrc/heal_bridges_osm.pysrc/adjust_spatial_obs.pyThe file that generates variable HUC level pre clip directories (
genererate_pre_clip_fim_huc.py) will require modification to match the newsubset_vector_layersfunction inclip_vectors_to_wbd.py.To use existing HUC8 level pre clip directories with this version, the only change necessary is to rename the
wbd8_clp.gpkgfile in the HUC8 level pre clip towbd_clp.gpkg.A reconciliation of the
HydroIDto enable HLP should be investigated insrc/add_crosswalk.py. For now, the call tosrc/convert_to_int16.pyinsrc/delineate_hydros_and_produce_HAND.shhas been commented to enable HLPHydroIDs.New methods related to updated osm bridge data within the pre clip directories is divergent, most all bridge related functionality was reverted to v4.6.1.4 or earlier.
Deployment Plan (For developer use)
How does the changes affect the product?
Issuer Checklist (For developer use)
You may update this checklist before and/or after creating the PR. If you're unsure about any of them, please ask, we're here to help! These items are what we are going to look for before merging your code.
[_pt] PR: <description>devbranch (the default branch), you have a descriptive Feature Branch name using the format:dev-<description-of-change>(e.g.dev-revise-levee-masking)devbranchpre-commithooks were run locally4.x.x.xMerge Checklist (For Technical Lead use only)