Skip to content

Conversation

RobHanna-NOAA
Copy link
Contributor

@RobHanna-NOAA RobHanna-NOAA commented Sep 22, 2025

The file shared_functions.py had a bug in it related to a object length check. During that processes we discovered some enhancements to logging tools and run_with_mp. The return code system was changed now where 1 = success, 0 = fail but do not abort and -1 means fail and abort run.

This triggered changes to scripts that use the logging or run_with_mp tools for their return values from their multi-proc functions. The change affected four data load scripts, and all were retested for correct data loading. A fifth data load script, pull_osm_bridges.py, was updated but only for a comment and was not affected by other changes in this PR.

There was also a change to shared_functions.setup_file_logger. It no longer takes a full path and file name for a log file, but two separate variables, one for the log folder, the other for a log file prefix. A date will be added automatically to the log file name.

Changes

  • data
    • bridges\make_dem_dif_for_bridges.py: Updated call to setup_file_logger plus changes related to run_with_mp. A bit of additional error handling was also added.
    • bridges\pull_osm_bridges.py: Just a comment added
    • nfhl\download_fema_nfhl.py: Updated call to setup_file_logger plus changes related to run_with_mp.
    • roads\pull_osm_roads.py: Updated call to setup_file_logger plus changes related to run_with_mp.
  • src\shared_functions.py: as described.
    • usgs\get_usgs_rating_curve.py: Updated call to setup_file_logger plus changes related to run_with_mp. A bit of additional error handling was also added. A small fix for rounding was also fixed.

Closes: 1659


Testing

This changes affects four scripts: pull_osm_roads.py, make_dem_dif_for_bridges.py, download_fema_nfhl.py and get_usgs_rating_curves.py. All were retested and all had a way to quickly stub test with small batches.


Deployment Plan (For FIM developers use)

  • Does the change impact inputs, docker or python packages?

    • Yes
    • No (f no.. skip the rest of the Deployment Plan section)
  • 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.

      • Yes
      • No
    • Require new or adjusted data inputs? Does it have a way to version (folder or file dates)?

      • No
      • Yes
        • Require new pre-clip set or any other data reloads, such as DEMS, osm, etc. ie.. pre-requisite re-data upstream of your input changes.
          • Yes
          • No
        • Has the inputs been copied/exist in all five enviros:
          • FIM EFS
          • FIM S3
          • ESIP
          • Dev1
          • UCS2
  • 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.

    • Yes

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.

  • Informative and human-readable title, using the format: [_pt] PR: <description>
  • Links are provided if this PR resolves an issue, or depends on another other PR
  • If submitting a PR to the dev branch (the default branch), you have a descriptive Feature Branch name using the format: dev-<description-of-change> (e.g. dev-revise-levee-masking)
  • Changes are limited to a single goal (no scope creep)
  • The feature branch you're submitting as a PR is up to date (merged) with the latest dev branch
  • pre-commit hooks were run locally
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • CHANGELOG updated with template version number, e.g. 4.x.x.x
  • Add yourself as an assignee in the PR as well as the FIM Technical Lead

Merge Checklist (For Technical Lead use only)

  • Update CHANGELOG with latest version number and merge date
  • Update the Citation.cff file to reflect the latest version number in the CHANGELOG
  • If applicable, update README with major alterations

@RobHanna-NOAA RobHanna-NOAA self-assigned this Sep 22, 2025
@RobHanna-NOAA RobHanna-NOAA added the bug Something isn't working label Sep 22, 2025
@RobHanna-NOAA RobHanna-NOAA marked this pull request as ready for review September 22, 2025 19:33
@CarsonPruitt-NOAA CarsonPruitt-NOAA merged commit 76b7f37 into dev Oct 10, 2025
1 check passed
@CarsonPruitt-NOAA CarsonPruitt-NOAA deleted the dev-mprunner-fix branch October 10, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Ready_to_Merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[5pt] Bug in updated MP runner

3 participants