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

GCAMDATA user modification for read from file data #505

Open
choiHenry opened this issue Jan 6, 2025 · 0 comments
Open

GCAMDATA user modification for read from file data #505

choiHenry opened this issue Jan 6, 2025 · 0 comments

Comments

@choiHenry
Copy link

Hi all.
I want to modify energy/Dooley_Cstorage_RG3_MtCO2 writing codes as below.

usermod_cstorage <- function(command, ...) {
  if(command == driver.DECLARE_MODIFY) {
    return(c(FILE = "energy/Dooley_Cstorage_RG3_MtCO2"))
  } else if(command == driver.DECLARE_INPUTS) {
    return()
  } else if(command == driver.MAKE) {
    all_data <- list(...)[[1]]
    df <- get_data(all_data, "energy/Dooley_Cstorage_RG3_MtCO2")

    # Make some changes...
    df[df$region_GCAM3 == "South Korea", "Deep Saline Formation On-shore"] <- 999


    return_modified("energy/Dooley_Cstorage_RG3_MtCO2" = df)
  } else {
    stop("Unknown command")
  }
}

driver_drake(user_modifications = c("usermod_cstorage"), xml_suffix="_1")

I found the result message in RStudio that ▶ target Cstorage.xml and ▶ target xml.Cstorage.xml are not provoked by the last command driver_drake(user_modifications = c("usermod_cstorage"), xml_suffix="_1").

GCAM Data System v5.1
Found 441 chunks
Found 4636 chunk data requirements
Found 2623 chunk data products
1563 chunk data input(s) not accounted for
▶ target usermod_cstorage
▶ target energy.Dooley_Cstorage_RG3_MtCO2__0
▶ target module_energy_L161.Cstorage
All done.

But when I modified manually the Dooley_Cstorage_RG3_MtCO2.csv as I intended, the Cstorage.xml changed actually.
I want to ask how can I modify this file without manually editing the ext file in gcamdata

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