Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate model/ID-specific hacks in create_execute_test_xml (well, and everywhere) #3410

Open
infotroph opened this issue Jan 7, 2025 · 0 comments

Comments

@infotroph
Copy link
Member

infotroph commented Jan 7, 2025

@mdietze in #3407 (comment) :

Not sure what the aim or this overall function is, or where it's called from, but this sort of deeply-buried hard-coded hack is something we should really avoid. I know you didn't add this and are just reformatting it, but I wonder if we could take the opportunity to fix it? First, this bit won't work if we're moving away from BETY being required (and never would have worked on a machine lacking this input ID). Second, as we move towards more people passing in ensemble soil inputs, this is going to break things (especially if a soil input is already present, which the code never checks for)

The code in question, from PEcAn.workflow::create_execute_test_xml:

model_specific_tags <- function(settings, model.info) {
  # some extra settings for LPJ-GUESS
  if (model.info$model_name == "LPJ-GUESS") {
    settings$run$inputs <- c(
      settings$run$inputs,
      list(soil = list(id = 1000000903))
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

No branches or pull requests

1 participant