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

PEcAn.utils::read_web_config numeric parsing not preserved when expand is true #2421

Closed
infotroph opened this issue Sep 17, 2019 · 1 comment
Milestone

Comments

@infotroph
Copy link
Member

If you feel like it, changing the expand block in the function to this should fix the parsing bug:

  if (expand) {
    # Replace $output_folder with its value, and concatenate strings
    chr <- vapply(config_list, is.character, logical(1))
    config_list[chr] <- lapply(config_list[chr], gsub,
                               pattern = "\\$output_folder *\\. *",
                               replacement = config_list[["output_folder"]])
  }

Basically, the gsub call on every element was re-converting everything back to character.

Originally posted by @ashiklom in #2420 (comment)

@infotroph
Copy link
Member Author

infotroph commented Sep 17, 2019

> read_web_config("config.php", parse = TRUE, expand = FALSE)$pagesize
[1] 30
> read_web_config("config.php", parse = TRUE, expand = TRUE)$pagesize
[1] "30"

@infotroph infotroph changed the title PEcAn.utils::read_web_config parse option ignored when expand is true PEcAn.utils::read_web_config numeric parsing not preserved when expand is true Sep 17, 2019
@robkooper robkooper added this to the 1.8.0 milestone Apr 14, 2020
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