[3pt] PR: Optimize FLASH FIM Workflow#1803
Conversation
Add type checking for lookup_table input in optimized_flash_conflation.py to allow for a pandas dataframe to be passed in directly.
…n-mapping into dev-flash-optimization
…mapping into dev-flash-optimization
mluck
left a comment
There was a problem hiding this comment.
I tested both conflate_flash_flows.py and optimized_flash_conflation.py and both created flow files that were used to create inundation with inundate_mosaic_wrapper.py. Both ran successfully and optimized_flash_conflation.py ran in about 1/4 the time as the other script.
One minor issue is that the scripts fail if the output folder doesn't exist. You may want to check if the folder exists and either create the folder so the output can be saved, or else exit gracefully.
I have a question about the two scripts. Do they have different use cases? Should the optimized_flash_conflation.py script be described in the README.md? Would it make sense to combine the two into a single script that uses an optional lookup table argument if the lookup file exists and otherwise uses zonal stats if it doesn't?
This PR updates the FLASH FIM workflow to make it more efficient for development of a rapidly updating service.
Additions
tools/flashfim/optimized_flash_conflation.py: Added new script to look up FLASH flows via a lookup table rather than using zonal stats to optimize service efficiency. Changes also resolve PR Implement type checking for lookup_table parameter #1791Changes
tools/flashfim/conflate_flash_flows.py: Restructured reading of FLASH grib file for efficiency. Changes resolve PR PR: [1pt] More efficient file read in FLASH FIM #1745Testing
Tested for the CONUS for latest timestep and different archive timesteps.
Deployment Plan (For FIM developers use)
Does the change impact inputs, docker or python packages?
If you are not a FIM dev team member: Please let us know what you need and we can help with it.
If you are a FIM Dev team member:
Please work with the DevOps team and do not just go ahead and do it without some co-ordination.
Copy where you can, assign where you can not, and it is your responsibility to ensure it is done. Please ensure it is completed before the PR is merged.
Has new or updated python packages, PipFile, Pipefile.lock or Dockerfile changes? DevOps can help or take care of it if you want. Just need to know if it is required.
Require new or adjusted data inputs? Does it have a way to version (folder or file dates)?
Please use caution in removing older version unless it is at least two versions ago. Confirm with DevOps if cleanup might be involved.
If new or updated data sets, has the FIM code, including running fim_pipeline.sh, been updated and tested with the new/adjusted data? You can dev test against subsets if you like.
Notes to DevOps Team or others:
Please add any notes that are helpful for us to make sure it is all done correctly. Do not put actual server names or full true paths, just shortcut paths like 'efs..../inputs/, or 'dev1....inputs', etc.
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.xReviewer / Approver Checklist
Merge Checklist (For Technical Lead use only)