JGCRI / gcamdata

The GCAM data system
https://jgcri.github.io/gcamdata/
Other
44 stars 26 forks source link

add chunk_details_description #1223

Open russellhz opened 2 years ago

russellhz commented 2 years ago

@hassaniazi New function to get the details and description for a single chunk.

To get the full data system info, users can run:

chunk_names <- find_chunks('^module_[a-zA-Z\\.]*_L.*$')
lapply(chunk_names$name, chunk_details_description) %>% bind_rows()

Still need to address missing details/description for the following chunk: image

codecov[bot] commented 2 years ago

Codecov Report

Merging #1223 (335bffd) into develop (dd2447e) will decrease coverage by 0.05%. The diff coverage is 67.69%.

@@             Coverage Diff             @@
##           develop    #1223      +/-   ##
===========================================
- Coverage    97.07%   97.02%   -0.06%     
===========================================
  Files          429      429              
  Lines        69407    69415       +8     
===========================================
- Hits         67380    67352      -28     
- Misses        2027     2063      +36     
Impacted Files Coverage Δ
R/utils.R 79.27% <0.00%> (-11.95%) :arrow_down:
R/zchunk_L102.nonco2_ceds_R_S_Y.R 30.32% <0.00%> (ø)
R/zchunk_LA100.IEA_downscale_ctry.R 17.61% <0.00%> (ø)
R/zchunk_L224.heat.R 89.32% <76.47%> (-0.12%) :arrow_down:
R/driver.R 72.00% <100.00%> (ø)
R/zchunk_L210.resources.R 99.84% <100.00%> (ø)
R/zchunk_L223.electricity.R 94.89% <100.00%> (ø)
R/zchunk_L2233.electricity_water.R 99.88% <100.00%> (ø)
R/zchunk_L2321.cement_USA.R 99.71% <100.00%> (ø)
R/zchunk_L2324.Off_road.R 94.60% <100.00%> (ø)
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

hassaniazi commented 2 years ago

I think it's a great idea to have it as single utility function, which gives users the ability to extract introductory information of a chunk. However, info("data_object") can also do something similar. Although yes, not for chunks, but for individual chunks one can easily find details and description in the chunk header by simply scrolling up. The motivation behind this is to give an overarching summary of data system at one place, which can be handy for starters, or during debugging, or even setting scenarios. So, I think it could be equally great to have it run on full data system and return a file gcamdata_chunks_info in data/ folder