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

Remove getConfig() call from convertUSGS() #14

Open
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q opened this issue Nov 26, 2024 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

Calling getConfig() for 'regionmapping' from read-functions

iso3c = toolGetMapping(name = getConfig('regionmapping'),

is verboten, and will be disabled any time now. Like, probably next week.

On the upside, convertUSGS() is used exactly

> library(mrremind)
> library(madrat)
> 
> getDependencies('readUSGS', 'dout')
            func type    package                      call     hash
1     calcCement calc mrindustry   mrindustry:::calcCement 18eacd1e
2 calcHistorical calc   mrremind mrremind:::calcHistorical 95d0464b
> 
> getFunction('calcCement', where = .getNamespace('mrindustry')) |>
+     format() |>
+     grep('readSource.*USGS', x = _, value = TRUE)
[1] "    d_USGS_cement <- readSource(\"USGS\", \"cement\", convert = FALSE) %>% "
> 
> f <- getFunction('calcHistorical', where = .getNamespace('mrremind')) |>
+     format()
> 
> f[grep('readSource.*USGS', x = f) + 0:1]
[1] "    USGS_cement <- readSource(type = \"USGS\", subtype = \"cement\", "                
[2] "        convert = FALSE) %>% quitte::madrat_mule() %>% group_by(!!!syms(c(\"iso3c\", "

nowhere.
So we can just delete it.

Does anybody need madrat development practice, @JakobBD?

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q added enhancement New feature or request good first issue Good for newcomers labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant