Skip to content

Update Regionalization to Run as Module Instead of Script#70

Merged
mxkpp merged 4 commits into
ngwpc-candidatefrom
maxkipp-update-run-regionalization
May 13, 2026
Merged

Update Regionalization to Run as Module Instead of Script#70
mxkpp merged 4 commits into
ngwpc-candidatefrom
maxkipp-update-run-regionalization

Conversation

@mxkpp
Copy link
Copy Markdown
Contributor

@mxkpp mxkpp commented May 12, 2026

This updates run_region.sh to call to run_regionalization.py s.t. it calls it as a module rather than as a script, to update against latest code structure in nwm-rte.

For example: python -um ngen_rte.run_regionalization.

@mxkpp mxkpp requested a review from yuqiong77 May 12, 2026 20:47
Copy link
Copy Markdown
Contributor

@yuqiong77 yuqiong77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Successfully tested regionalization runs in AWS workspace.

Update: Actually the ngen step of the regionalization workflow ran into the following error:

[94c60fdd3c03:00029] *** End of error message ***
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to initialize ForcingsEngine: ForcingsEngine python module is not installed or is not properly configured. (KeyError: 'att_map'

@yuqiong77 yuqiong77 self-requested a review May 12, 2026 21:39
Copy link
Copy Markdown
Contributor

@yuqiong77 yuqiong77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting the following error:

[94c60fdd3c03:00029] *** End of error message ***
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to initialize ForcingsEngine: ForcingsEngine python module is not installed or is not properly configured. (KeyError: 'att_map'

At:
  /ngen-app/ngen-python/lib/python3.11/site-packages/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/bmi_model.py(145): NWMv3_Forcing_Engine_BMI_model_Base
  /ngen-app/ngen-python/lib/python3.11/site-packages/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/bmi_model.py(79): <module>
  <frozen importlib._bootstrap>(241): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(940): exec_module
  <frozen importlib._bootstrap>(705): _load_unlocked
  <frozen importlib._bootstrap>(1150): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1176): _find_and_load
  /ngen-app/ngen-python/lib/python3.11/site-packages/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/__init__.py(3): <module>

@mxkpp
Copy link
Copy Markdown
Contributor Author

mxkpp commented May 13, 2026

Getting the following error:

[94c60fdd3c03:00029] *** End of error message ***
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to initialize ForcingsEngine: ForcingsEngine python module is not installed or is not properly configured. (KeyError: 'att_map'

At:
  /ngen-app/ngen-python/lib/python3.11/site-packages/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/bmi_model.py(145): NWMv3_Forcing_Engine_BMI_model_Base
  /ngen-app/ngen-python/lib/python3.11/site-packages/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/bmi_model.py(79): <module>
  <frozen importlib._bootstrap>(241): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(940): exec_module
  <frozen importlib._bootstrap>(705): _load_unlocked
  <frozen importlib._bootstrap>(1150): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1176): _find_and_load
  /ngen-app/ngen-python/lib/python3.11/site-packages/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/__init__.py(3): <module>

Please try again after pulling the latest image. I am not experiencing this error when using the latest.

Copy link
Copy Markdown
Contributor

@yuqiong77 yuqiong77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repulled the latest RTE image and ngen simulation completed successfully

Copy link
Copy Markdown
Contributor Author

@mxkpp mxkpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuqiong77 I think the chmod call should be after the ensure_dir call

Copy link
Copy Markdown
Contributor

@yuqiong77 yuqiong77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mxkpp Moved chmod to be after ensure_dir

@mxkpp mxkpp merged commit b71ed91 into ngwpc-candidate May 13, 2026
2 checks passed
@mxkpp mxkpp deleted the maxkipp-update-run-regionalization branch May 13, 2026 14:15
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