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 · 1 comment

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))
@Sweetdevil144
Copy link
Contributor

Maybe retrieve a dynamic value from the database? But wouldn;t that make the model MORE DB Dependent which is the opposite of what we want. Another approach would be examining a constant value within the xml structure being built from settings. Then maybe we can use any param as substitute to the ID or use it to construct a UID? Do you happen to know any xml we can take as reference for the LPJ-GUESS model params here?

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

2 participants