Python Reference#
The pyproject.toml of this repository primarily contains requirements for building documentation. The build sequence of the nwm-rte image is dynamic/configurable and involves multiple Python virtual environments.
CLI Help Menus#
These are raw outputs of the --help menu generated by Python's argparse library.
To update these, run: ./docs/update_python_cli_ref.sh
run_regionalization_standalone.py --help
run_output_postprocess.py --help
make_coastal_forcing.py --help
CLI Executable Modules#
run_default.py#
Called by run_default.sh
ngen_rte.run_default
#
Command-line executable to build and run a "default" realization. Supports realtime forcing configurations, e.g. "short_range", as well as historical/retrospective sources, e.g. "aorc".
This runs inside the ngen runtime environment.
The CLI structure is mimicked in part by configs.RTEDefaultConfig.
For settings that are not exposed by CLI arguments, see primarily consts.py.
See run_default.sh for example calls.
run_default
#
run_default(
rb: RealizationBuilder, cfg: RTEDefaultConfig
) -> NgenRunnerAsync
Run the provided default realization.
Realization should already be built (rb.build_default_realization() already called).
Args: rb: The RealizationBuilder instance containing the realization. cfg: The RTEDefaultConfig instance, used to access ecf_iface and ecf_ctx.
Source code in bin_mounted/ngen_rte/run_default.py
cli_arg_parser
#
Build and return the CLI argument parser
Source code in bin_mounted/ngen_rte/run_default.py
run_calibration.py#
Called by run_calib.sh
ngen_rte.run_calibration
#
Command-line executable to build and run a "calibration" realization.
This runs inside the ngen runtime environment.
The CLI structure is mimicked in part by configs.RTECalibConfig.
For settings that are not exposed by CLI arguments, see primarily consts.py.
See run_calib.sh for example calls.
get_calibration_cmd
#
Get the command to run the calibration realization.
Source code in bin_mounted/ngen_rte/run_calibration.py
cli_arg_parser
#
Build and return the CLI argument parser
Source code in bin_mounted/ngen_rte/run_calibration.py
run_forecast.py#
Called by run_fcst.sh
ngen_rte.run_forecast
#
Command-line executable to build and run a "forecast" realization, optionally with a coldstart.
This runs inside the ngen runtime environment.
The CLI structure is mimicked in part by configs.RTEForecastConfig.
For settings that are not exposed by CLI arguments, see primarily consts.py.
See run_fcst.sh for example calls.
run_realization
#
Run the realization, which can be a coldstart, forecast, or lagged ensemble.
Source code in bin_mounted/ngen_rte/run_forecast.py
cli_arg_parser
#
Build and return the CLI argument parser
Source code in bin_mounted/ngen_rte/run_forecast.py
run_restart.py#
Called by run_default.sh
ngen_rte.run_restart
#
Command-line executable to restart a failed run from a saved checkpoint. Currently only functional for default and regionalization runs. Calls msw-mgr chcekpoint_restart to copy and configure the run, then infers the ngen command from the destination directory. A run can only be restarted if the original run was configured to save checkpoints using the --checkpoint_interval argument.
infer_gage_id
#
infer_rb
#
Infer and return a minimal RealizationBuilder from the destination directory structure
Source code in bin_mounted/ngen_rte/run_restart.py
run_restart
#
Run the provided checkpoint restart realization.
Source code in bin_mounted/ngen_rte/run_restart.py
run_tests.py#
Called by run_test_formulations.sh
ngen_rte.tests.run_tests
#
Command-line executable to build and run a series of "forecast" realizations, optionally with a "calibration" realization preceding them.
This runs inside the ngen runtime environment.
The CLI structure is mimicked in part by configs.RTETestConfig.
For settings that are not exposed by CLI arguments, see primarily consts.py.
When realizations fail, this program does not halt, but rather moves to the next configuration type in the list, with the goal of "trying" many different realization configurations in one call. The status of each configuration's build step and run step is reported and written to a json file at the end.
This includes options for stopping realizations mid-way through their run, rather than waiting for them to complete.
See run_test_formulations.sh for example calls.
calibrations__build_and_run
#
calibrations__build_and_run(
cfg: RTETestConfig, tm: TestsManager
) -> None
Build calibration realizations and run them as tests.
Source code in bin_mounted/ngen_rte/tests/run_tests.py
forecasts__build_and_run
#
forecasts__build_and_run(
cfg: RTETestConfig, tm: TestsManager, cs: bool
) -> None
Using ForecastTest, build and execute a list of forecast realizations.
tests_manager is modified in-place, so some test results may be available if this function is interrupted.
cs controls whether coldstart is used (not cfg.do_coldstart).
Source code in bin_mounted/ngen_rte/tests/run_tests.py
run_noop_mode
#
Run noop mode - verify imports and basic setup without executing workflows.
Source code in bin_mounted/ngen_rte/tests/run_tests.py
cli_arg_parser
#
Build and return the CLI argument parser
Source code in bin_mounted/ngen_rte/tests/run_tests.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | |
run_regionalization_standalone.py#
Called by run_region_standalone.sh
run_regionalization_standalone.py --help
ngen_rte.run_regionalization_standalone
#
Command-line executable to build and run a "regionalization" realization. Supports realtime forcing configurations, e.g. "short_range", as well as historical/retrospective sources, e.g. "aorc".
This runs inside the ngen runtime environment.
The CLI structure is mimicked in part by configs.RTERegionConfig.
For settings that are not exposed by CLI arguments, see primarily consts.py.
See run_default.sh for example calls.
run_region
#
Run the provided regionalization realization. Realization should already be built (rb.build_region_realization() already called).
Source code in bin_mounted/ngen_rte/run_regionalization_standalone.py
cli_arg_parser
#
Build and return the CLI argument parser
Source code in bin_mounted/ngen_rte/run_regionalization_standalone.py
run_output_postprocess.py#
Called by run_output_postprocess.sh
run_output_postprocess.py --help
ngen_rte.run_output_postprocess
#
Command-line executable to run the overall NetCDF production workflow from nwm-data-assimilation. Calls data-assimilation's overall_netcdf_workflow to convert ngen catchment output into NWM-formatted gridded NetCDF products.
run_output_mosaic.py#
Called by run_output_mosaic.sh
ngen_rte.run_output_mosaic
#
Command-line executable to run the output mosaicing workflow from nwm-data-assimilation. Calls data-assimilation's combine_basin_grids to merge per-timestep NetCDF gridded outputs into a single NetCDF product.
make_coastal_forcing.py#
Example calls are provided by make_coastal_forcing.sh. See the nwm-coastal repository for complete coastal workflow documentation.
make_coastal_forcing.py --help
ngen_rte.coastal.make_coastal_forcing
#
CLI script to generate gridded atmospheric forcing files for coastal models.
NOTE: This includes a T0 output needed for coastal, in addition to the normal T1+ outputs.
NOTE: The T0 output has identical forcing values as T1.
See comments in ngen-forcing model.py function write_t0_output.
An independent T0 state cannot be reliably computed because several forecast products omit required fields at hour zero and substitute hour one. Examples:
https://github.com/NGWPC/ngen-forcing/blob/27e03ba138478dd449ce957b1c3ba4c36fc33d8f/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/time_handling.py#L1202-L1206
https://github.com/NGWPC/ngen-forcing/blob/27e03ba138478dd449ce957b1c3ba4c36fc33d8f/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/time_handling.py#L1444-L1448
https://github.com/NGWPC/ngen-forcing/blob/27e03ba138478dd449ce957b1c3ba4c36fc33d8f/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/time_handling.py#L2043-L2047
https://github.com/NGWPC/ngen-forcing/blob/27e03ba138478dd449ce957b1c3ba4c36fc33d8f/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/time_handling.py#L4129-L4135
NOTE:
See repository nwm-coastal (file nwm-coastal/scripts/setup_data_coastal.sh) for the scripts needed to download / set up input data required to run coastal forcing workflows:
These files are masked versions of the full CONUS nc files, masked to an area around the test gage for testing CONUS workflows
on a machine that may not have enough RAM for an actual full CONUS run:
run_ngen/data/esmf_mesh/NWM/domain/GEOGRID_LDASOUT_Spatial_Metadata_CONUS_debug_gauge_01123000.nc
run_ngen/data/esmf_mesh/NWM/domain/geo_em_CONUS_debug_gauge_01123000.nc
Usage: Choose exactly one timing mode:
* ``--cycle_datetime`` (``-dt``) runs an operational forecast cycle. The
forcing engine determines the time window from the selected configuration.
* ``--start_time`` (``-start``) together with ``--end_time`` (``-end``) runs
an explic`it time window, such as an AORC retrospective run.
Examples: python -um ngen_rte.coastal.make_coastal_forcing -dt "2025-09-15 00:00:00" -fconfig standard_ana_hawaii -gdomain Hawaii python -um ngen_rte.coastal.make_coastal_forcing -start "2013-07-25 00:00:00" -end "2013-07-26 00:00:00" -fconfig aorc -gdomain Hawaii
make_coastal_forcing
#
make_coastal_forcing(
forcing_configuration: str,
global_domain: str,
run_name: str = DEFAULT_RUN_NAME,
cycle_datetime: datetime | None = None,
start_time: datetime | None = None,
end_time: datetime | None = None,
lookback: int | None = None,
forecast_input_horizons: int | None = None,
debug_conus_subset: bool = False,
) -> Path
Create one gridded coastal forcing file and return its path.
Source code in bin_mounted/ngen_rte/coastal/make_coastal_forcing.py
Python Constants#
Currently bin_mounted/ngen_rte/consts.py contains variables which rarely need editing.
ngen_rte.consts
#
Constants
FORCING_TEMPLATE_DIR
module-attribute
#
FORCING_TEMPLATE_DIR = f"{getsitepackages()[0]}/NextGen_Forcings_Engine_BMI/BMI_NextGen_Configs/config_templates/"
Directory of forcing configuration template yaml files.
Configuration Classes#
These mimic the CLI interfaces and perform some additional argument parsing and preparation of classes that are passed to other components of the system.
ngen_rte.configs
#
Primary configuration classes. Pydantic BaseModels directly associated with CLI executables.
RTEBaseConfig
#
Bases: BaseModelStrict
Base RTE configuration class to be inherited by child classes. Triggers certain setup actions, such as creation of WCOSS-path symlinks. Classes that inherit from this should call super().model_post_init(__context) inside their own model_post_init() method, if they have that method also defined in the child.
The primary usage of this class is to access property mswm_RealizationBuilder_kwargs for building (and later running) a realization using MSWM.
| ATTRIBUTE | DESCRIPTION |
|---|---|
delete_scratch_and_mesh_first |
Causes scratch dir and intermediate mesh file to be deleted before building the realization. Use with caution.
TYPE:
|
delete_forcing_raw_input_first |
Causes forcing raw input dir to be deleted before building the realization. Use with caution.
TYPE:
|
edfs_url |
Base URL for the Icefabric EDFS API used to retrieve hydrofabric geopackage
TYPE:
|
environment |
Operating environment used to set edfs_url, e.g. 'test' or 'oe'. Overriden if specific edfs_url is provided.
TYPE:
|
nprocs |
Number of processors to use for ngen execution.
TYPE:
|
global_domain |
Global domain, e.g. "CONUS" or "Hawaii". Must agree with the ID of the basin / gage / VPU being simulated.
TYPE:
|
forcing_static_dir |
Directory for static forcing data.
TYPE:
|
basin |
Basin identifier. Can be either Gage ID or VPU identifier.
TYPE:
|
gage_id |
Gage ID. When provided, sets subset_type to 'gage'.
TYPE:
|
vpu |
VPU identifier. When provided, sets subset_type to 'vpu'.
TYPE:
|
subset_type |
Type of basin identifier. Accepts 'gage' or 'vpu'.
TYPE:
|
model_formulation_cli_csv |
Comma-separated string of model names comprising the formulation.
TYPE:
|
model_formulation_cli_rootzone |
Boolean for model formulation rootzone parameter.
TYPE:
|
add_timestamp_to_run_name |
Boolean causing the final forecast run name to contain a timestamp suffix.
TYPE:
|
nwm_output_vars |
Boolean causing NWM output variables to be included in the output. Passed to MSWM NWMOutputConfig. Does not apply to calibration workflow.
TYPE:
|
output_format |
Output format(s) for output variables. Accepts 'CSV', 'NetCDF', or both. Defaults to ["CSV"] in MSWM.
TYPE:
|
hydrofab_file |
Optional hydrofabric file path. If provided, bypasses MSWM Icefabric server API call.
TYPE:
|
reservoir_rfc_dir |
Optional path to reservoir RFC forecast time-series directory. If provided, reservoir_da is set to True and passed to DataAssimilationConfig
TYPE:
|
usgs_timeslice_dir |
Optional path to USGS timeslice time-series directory. If provided, streamflow_da is set to True and passed to DataAssimilationConfig
TYPE:
|
fcst_run_name |
Forecast run name.
TYPE:
|
cycle_datetime |
Cycle datetime for forecast
TYPE:
|
checkpoint_interval |
Integer number of timesteps for interval of checkpoint output
TYPE:
|
checkpoint_dir |
Optional directory to save checkpoint states. Defaults to
TYPE:
|
load_state_from |
Path to existing state file to load at start of run
TYPE:
|
save_state |
Boolean to activate state save at end of run
TYPE:
|
save_state_dir |
Optional directory to save model state at end of run. Defaults in
TYPE:
|
lookback |
Optional override of the forcing template
TYPE:
|
Source code in bin_mounted/ngen_rte/configs.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 | |
time_at_init
class-attribute
instance-attribute
#
Time at class instantiation.
errors
class-attribute
instance-attribute
#
List of exceptions encountered during init.
subset_type
class-attribute
instance-attribute
#
Subset_type set depending on vpu and gage_id args
basin
class-attribute
instance-attribute
#
Basin id set depending on vpu and gage_id args
use_lagged_ensemble
class-attribute
instance-attribute
#
Boolean indicating that lagged ensemble is to be used. Passed to MSWM.
lagged_ens_mem
class-attribute
instance-attribute
#
Lagged ensemble member name. Passed to MSWM.
forcing_lag
class-attribute
instance-attribute
#
Lagged ensemble forcing lag. Looked up based on lagged ensemble member name. Passed to MSWM.
le__open_loop_state
class-attribute
instance-attribute
#
File path for lagged ensemble open loop state.
le__closed_loop_state
class-attribute
instance-attribute
#
File path for lagged ensemble closed loop state.
hindcast_args
class-attribute
instance-attribute
#
List of hindcast args from CLI. For details, see CLI help and _parse_hindcast_args().
use_hindcast
class-attribute
instance-attribute
#
Boolean indicating that hindcast is to be used. Passed to MSWM.
hc_cycle_interval
class-attribute
instance-attribute
#
Hindcast cycle interval.
hc_num_iterations
class-attribute
instance-attribute
#
Hindcast number of iterations.
ecf_task
class-attribute
instance-attribute
#
ECFlow task path, e.g. '/nwm/hourly/nwm_analysis_assim/jnwm_conus_analysis_assim'.
ecf_subtask
class-attribute
instance-attribute
#
ECFlow subtask base identifier. Example: 'no_subtask_type__20260615_120000_000000__vpu__03S'.
ecf_iface
class-attribute
instance-attribute
#
EcflowInterface instance created if ecf_task and ecf_subtask are provided.
ecf_ctx
class-attribute
instance-attribute
#
SubtaskCallbackContext instance created if ecf_task and ecf_subtask are provided.
realtime_mode
property
#
Realtime mode boolean, leveraged by default realization which can run both realtime and historical/retrospective configurations.
forcing_provider_paths
property
#
Helper class for managing forcing provider paths.
start_period__end_period
property
#
Tuple of start period and end period for calibration and default realizations.
model_formulation
property
#
Model formulation helper class for MSWM models list and rootzone parameter.
mswm_ModulePropertiesConfig
property
#
MSWM ModulePropertiesConfig instance
mswm_RegionalizationConfig
property
#
MSWM RegionalizationConfig instance
mswm_ForcingConfig
property
#
MSWM ForcingConfig instance. Contains dynamic logic for handling different types of child classes of RTEBaseConfig.
mswm_DataAssimilationConfig
property
#
MSWM DataAssimilationConfig instance
mswm_InputConfig
property
#
MSWM InputConfig instance. This is the composite MSWM class that contains the other sub-config classes.
mswm_RealizationBuilder_kwargs
property
#
Full set of kwargs that are passed to MSWM RealizationBuilder's constructor for bulding a realization.
valid_best_yaml
property
#
Validation yaml file (output from previously-ran calibration realization)
configure_ngen_log
#
Configure the ngen logging, by setting the associated OS env variable for the directory to hold the logs, and copying the associated json file into that directory.
fallback_log_dir is ignored when the RTE OS env var key NGEN_LOG_TO_RTE is true.
It is used to emulate behavior of nwm-cal-mgr and nwm-fcst-mgr (what they would use without RTE).
| PARAMETER | DESCRIPTION |
|---|---|
rb
|
An already built realization.
TYPE:
|
Source code in bin_mounted/ngen_rte/configs.py
RTEDefaultConfig
#
Bases: RTEBaseConfig
Configuration class for building and running one default realization (realtime forcing configuration or historical / retrospective forcing configuration).
| ATTRIBUTE | DESCRIPTION |
|---|---|
cycle_datetime |
Start time of the realization
TYPE:
|
duration |
Duration of the simulation (only used for historical / retrospective forcing configurations)
TYPE:
|
forcing_configuration |
Forcing configuration, e.g. "aorc" or "short_range"
TYPE:
|
fcst_run_name |
Name of the forecast realization run. Affects a directory name.
TYPE:
|
lagged_ensemble_args |
See CLI help menu for
TYPE:
|
cold_start_datetime |
Start time of the coldstart realization. If None, coldstart is not performed.
TYPE:
|
noop |
Causes a noop to occur (for confirming that Python packages are importable).
TYPE:
|
Source code in bin_mounted/ngen_rte/configs.py
RTERegionConfig
#
Bases: RTEBaseConfig
Configuration class for building and running one regionalization realization (realtime forcing configuration or historical / retrospective forcing configuration).
| ATTRIBUTE | DESCRIPTION |
|---|---|
cycle_datetime |
Start time of the realization
TYPE:
|
duration |
Duration of the simulation (only used for historical / retrospective forcing configurations)
TYPE:
|
forcing_configuration |
Forcing configuration, e.g. "aorc" or "short_range"
TYPE:
|
fcst_run_name |
Name of the forecast realization run. Affects a directory name.
TYPE:
|
lagged_ensemble_args |
See CLI help menu for
TYPE:
|
form_assign_file |
File containing formulation assignments for catchments
TYPE:
|
cat_grp_file |
File containing catchment groupings for regionalization
TYPE:
|
cold_start_datetime |
Start time of the coldstart realization. If None, coldstart is not performed.
TYPE:
|
Source code in bin_mounted/ngen_rte/configs.py
RTECalibConfig
#
Bases: RTEBaseConfig
Configuration class for building and running one calibration realization.
| ATTRIBUTE | DESCRIPTION |
|---|---|
objective_function |
Objective function, e.g. "kge"
TYPE:
|
optimization_algorithm |
Optimization algorithm, e.g. "dds"
TYPE:
|
calib_sim_start |
Calibration start time
TYPE:
|
duration |
Calibration simulation duration
TYPE:
|
calib_eval_delayment |
Used for evaluation / validation time windowing
TYPE:
|
valid_sim_advancement |
Used for evaluation / validation time windowing
TYPE:
|
valid_eval_curtailment |
Used for evaluation / validation time windowing
TYPE:
|
forcing_configuration |
Source of forcing data, e.g. "aorc" or "nwm"
TYPE:
|
worker_name |
Name of the ngen worker (used to build a directory name)
TYPE:
|
Source code in bin_mounted/ngen_rte/configs.py
RTEForecastConfig
#
Bases: RTEBaseConfig
Configuration class for building and running one forecast realization.
| ATTRIBUTE | DESCRIPTION |
|---|---|
objective_function |
Affects input realization path. Objective function of previously-ran calibration realization, e.g. "kge"
TYPE:
|
optimization_algorithm |
Affects input realization path. Optimization algorithm of previously-ran calibration realization, e.g. "dds"
TYPE:
|
cycle_datetime |
Start time of the realization (or end time for coldstart, if
TYPE:
|
cold_start_datetime |
Start time of the coldstart realization. If None, coldstart is not performed.
TYPE:
|
forcing_configuration |
Forcing configuration, e.g. "aorc" or "short_range"
TYPE:
|
fcst_run_name |
Name of the forecast realization run
TYPE:
|
lagged_ensemble_args |
See CLI help menu for
TYPE:
|
Source code in bin_mounted/ngen_rte/configs.py
RTEAsyncConfig
#
Bases: RTEBaseConfig
Minimal configuration class for run using NgenRunnerAsync Set RTEBaseConfigs variables to defaults, not used by NgenRunnerAsync
Source code in bin_mounted/ngen_rte/configs.py
RTETestConfig
#
Bases: RTEBaseConfig
Configuration class for building and running a set of test realizations.
| ATTRIBUTE | DESCRIPTION |
|---|---|
skip_forecast |
Causes forecast to be skipped (only do calibration)
TYPE:
|
quit_forecast_after_duration |
Causes forecasts to be stopped midway after a set duration (seconds of processing time)
TYPE:
|
do_calibration |
Causes calibration to be ran, before forecasts (needed if a calibration has not yet been ran for the gage)
TYPE:
|
quit_calibration_after_duration |
Causes calibrations to be stopped midway after a set duration (seconds of processing time)
TYPE:
|
objective_functions |
For calibration, list of objective functions to run, e.g. "kge". Replaced with full list when do_all_objective_functions = True
TYPE:
|
do_all_objective_functions |
For calibration, causes all objective functions to be used.
TYPE:
|
optimization_algorithms |
For calibration, list of optimization algorithms to run, e.g. "dds". Replaced with full list when do_all_optimization_algorithms = True
TYPE:
|
model_formulations_file |
File containing model formulations to iterate over
TYPE:
|
calibration_forcing_sources |
Calibration forcing configurations, e.g. "aorc" "nwm"
TYPE:
|
do_all_optimization_algorithms |
For calibration, causes all optimization algorithms to be used.
TYPE:
|
do_all_forcing_configs |
Causes all forcing configurations to be used, e.g. "short_range", "standard_ana", "medium_range_blend", "extended_ana", "short_range_hawaii", etc.
TYPE:
|
do_coldstart |
Causes coldstart to be ran before forecast.
TYPE:
|
fcst_run_name |
Name of the forecast realization run. Affects a directory name.
TYPE:
|
noop |
Causes a noop to occur (for confirming that Python packages are importable).
TYPE:
|
restart |
Causes the test to be restarted by reading the existing c.TEST_RESULTS_FILE and skipping configurations which had completed earlier. Can be used when long-running tests are interrupted. Use with caution.
TYPE:
|
Source code in bin_mounted/ngen_rte/configs.py
939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 | |
get_calib_permutations
#
Returns the permutations of objective function and optimization algorithm specified in the config, as well as a TestPaths instance for each. If only_first, then only the first permutation will be returned. Else all permutations will be returned.
Source code in bin_mounted/ngen_rte/configs.py
make_parallel_config
#
MSWM ParallelConfig instance.
Source code in bin_mounted/ngen_rte/configs.py
Regionalization Workflows#
The regionalization workflows run via command-line interface (CLI) Scripts.
Here is the argparse help menu of run_regionalization.py:
run_regionalization is called by run_region.sh
For more information, see the nwm-region-mgr repository.
ngen_rte.run_regionalization
#
RTE regionalization workflow runner script.