Skip to content

Workbench: pass only "enabled" args to a model run#2466

Merged
emilyanndavis merged 1 commit intonatcap:mainfrom
emilyanndavis:bugfix/2436-disabled-inputs
Mar 30, 2026
Merged

Workbench: pass only "enabled" args to a model run#2466
emilyanndavis merged 1 commit intonatcap:mainfrom
emilyanndavis:bugfix/2436-disabled-inputs

Conversation

@emilyanndavis
Copy link
Copy Markdown
Member

Description

Fixes #2436.

Specifically: the Workbench now filters model args to include only those whose corresponding form fields are enabled at the time a model is run.

Example: Carbon model with sample datastack

Log, Before

Arguments for InVEST carbon 3.18.1.dev16+ga61b6b649.d20260304:
calc_sequestration        True
carbon_pools_path         /Users/eadavis/invest-inputs/invest-sample-data_3.17.2/Carbon/carbon_pools_willamette.csv
discount_rate             
do_valuation              False
lulc_alt_path             /Users/eadavis/invest-inputs/invest-sample-data_3.17.2/Carbon/lulc_future_willamette.tif
lulc_alt_year             2050
lulc_bas_path             /Users/eadavis/invest-inputs/invest-sample-data_3.17.2/Carbon/lulc_current_willamette.tif
lulc_bas_year             2020
n_workers                 -1
price_per_metric_ton_of_c 
rate_change               
results_suffix            willamette
workspace_dir             /Users/eadavis/invest-workspaces/carbon-disabled-inputs

Log, After

calc_sequestration True
carbon_pools_path  /Users/eadavis/invest-inputs/invest-sample-data_3.17.2/Carbon/carbon_pools_willamette.csv
do_valuation       False
lulc_alt_path      /Users/eadavis/invest-inputs/invest-sample-data_3.17.2/Carbon/lulc_future_willamette.tif
lulc_bas_path      /Users/eadavis/invest-inputs/invest-sample-data_3.17.2/Carbon/lulc_current_willamette.tif
n_workers          -1
results_suffix     willamette
workspace_dir      /Users/eadavis/invest-workspaces/carbon-disabled-inputs

Note the log now omits all args that are enabled only when do_valuation is True (namely: lulc_bas_year, lulc_alt_year, discount_rate, price_per_metric_ton_of_c, and rate_change).

Args Table, Before

args-table-with-disabled-inputs_2026-03-26

Note the values listed for lulc_bas_year and lulc_alt_year.

Args Table, After

args-table-without-disabled-inputs_2026-03-26

Note that None is now listed for lulc_bas_year and lulc_alt_year.

Checklist

  • Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
    - [ ] Updated the user's guide (if needed)
  • Tested the Workbench UI (if relevant)

Copy link
Copy Markdown
Contributor

@claire-simpson claire-simpson left a comment

Choose a reason for hiding this comment

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

Tested this locally and it looks good - thanks @emilyanndavis!

@emilyanndavis emilyanndavis merged commit 2fd2124 into natcap:main Mar 30, 2026
100 of 117 checks passed
@emilyanndavis emilyanndavis deleted the bugfix/2436-disabled-inputs branch March 30, 2026 18:35
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.

Workbench: disabled inputs retain previous values and are passed to model

2 participants