Skip to content

Commit

Permalink
remove maglcass::dimSums() import
Browse files Browse the repository at this point in the history
- since magclass 6.0.0 changed dimSums() behaviour, remind2 uses a local dimSums() (see #98)
- so dimSums() was imported, then immediately overwritten by the local dimSums() version in the remind2 scope
  • Loading branch information
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q committed Feb 19, 2024
1 parent 2854bbc commit 1886a00
Show file tree
Hide file tree
Showing 23 changed files with 98 additions and 99 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ importFrom(magclass,collapseNames)
importFrom(magclass,complete_magpie)
importFrom(magclass,dimExists)
importFrom(magclass,dimReduce)
importFrom(magclass,dimSums)
importFrom(magclass,getItems)
importFrom(magclass,getNames)
importFrom(magclass,getRegions)
Expand Down
2 changes: 1 addition & 1 deletion R/calc_regionSubset_sums.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @return A [`MAgPIE`][magclass::magclass] object.
#' @author Michaja Pehl
#'
#' @importFrom magclass mbind dimSums getItems<-
#' @importFrom magclass mbind getItems<-
#'
#'
#' @examples
Expand Down
2 changes: 1 addition & 1 deletion R/readConsumption.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass mbind dimSums getNames<-
#' @importFrom magclass mbind getNames<-

readConsumption <- function(gdx, field="l"){
tmp <- readGDX(gdx, name='vm_cons', field=field, format="first_found")
Expand Down
2 changes: 1 addition & 1 deletion R/readEmissions.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass dimSums setNames getNames<-
#' @importFrom magclass setNames getNames<-
readEmissions <- function(gdx,emiengregi,eminegregi){
if(!is.null(emiengregi)){
tmp1 <- readGDX(gdx, name = c("vm_emiTe","vm_emiengregi"), field="l", format="first_found")[ , , emiengregi]
Expand Down
2 changes: 1 addition & 1 deletion R/readFE.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass dimSums getNames<-
#' @importFrom magclass getNames<-
readFE <- function(gdx){
fe <- readGDX(gdx,c("vm_prodFe","v_feprod"),field="l",restore_zeros = FALSE,react="silent")
fe <- dimSums(fe,dim=3)
Expand Down
2 changes: 1 addition & 1 deletion R/reportCapacity.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' @importFrom quitte calcCumulatedDiscount
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass mbind setNames dimSums getSets getSets<- as.magpie
#' @importFrom magclass mbind setNames getSets getSets<- as.magpie
#' @importFrom dplyr %>% filter mutate

reportCapacity <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150)) {
Expand Down
2 changes: 1 addition & 1 deletion R/reportCapitalStock.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass getYears mbind setNames dimSums
#' @importFrom magclass getYears mbind setNames
#' @importFrom dplyr tribble
reportCapitalStock <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150)) {

Expand Down
2 changes: 1 addition & 1 deletion R/reportCosts.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#'
#' @export
#' @importFrom rlang .data
#' @importFrom magclass mbind getYears collapseNames dimSums setNames
#' @importFrom magclass mbind getYears collapseNames setNames
#' @importFrom gdx readGDX
#' @importFrom dplyr filter

Expand Down
2 changes: 1 addition & 1 deletion R/reportCrossVariables.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @export
#' @importFrom assertr assert not_na
#' @importFrom gdx readGDX
#' @importFrom magclass getYears getRegions mbind setNames dimSums mselect
#' @importFrom magclass getYears getRegions mbind setNames mselect
#' new.magpie setYears mcalc
#' @importFrom luscale speed_aggregate
#' @importFrom tibble as_tibble
Expand Down
2 changes: 1 addition & 1 deletion R/reportEmi.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
#' @importFrom gdx readGDX
#' @importFrom dplyr %>% filter full_join group_by inner_join left_join mutate rename select summarise
#' @importFrom magclass mselect dimSums mselect<- collapseDim getItems getRegions getYears
#' @importFrom magclass mselect mselect<- collapseDim getItems getRegions getYears
#' @importFrom madrat toolAggregate
#' @importFrom tibble as_tibble

Expand Down
154 changes: 77 additions & 77 deletions R/reportEmiAirPol.R

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion R/reportEnergyInvestment.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' }
#'
#' @export
#' @importFrom magclass dimSums mbind
#' @importFrom magclass mbind
#' @importFrom gdx readGDX

reportEnergyInvestment <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150)) {
Expand Down
2 changes: 1 addition & 1 deletion R/reportExtraction.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @importFrom quitte calcCumulatedDiscount
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass mbind dimSums mselect getRegions new.magpie getYears<- getYears setNames getSets getSets<- as.magpie
#' @importFrom magclass mbind mselect getRegions new.magpie getYears<- getYears setNames getSets getSets<- as.magpie
#' @importFrom dplyr %>% filter mutate
#' @importFrom tidyr extract

Expand Down
2 changes: 1 addition & 1 deletion R/reportFE.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass new.magpie mselect getRegions getYears mbind setNames
#' dimSums getNames<- as.data.frame as.magpie getSets
#' getNames<- as.data.frame as.magpie getSets
#' @importFrom dplyr %>% filter full_join group_by left_join mutate rename
#' select semi_join summarise ungroup
#' @importFrom quitte inline.data.frame revalue.levels
Expand Down
2 changes: 1 addition & 1 deletion R/reportLCOE.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass new.magpie dimSums getRegions getYears getNames setNames clean_magpie dimReduce as.magpie magpie_expand
#' @importFrom magclass new.magpie getRegions getYears getNames setNames clean_magpie dimReduce as.magpie magpie_expand
#' @importFrom dplyr %>% mutate select rename group_by ungroup right_join filter full_join arrange summarise
#' @importFrom quitte as.quitte overwrite getRegs getPeriods
#' @importFrom tidyr spread gather expand fill
Expand Down
2 changes: 1 addition & 1 deletion R/reportMOFEX.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
#' @export
#' @importFrom rlang .data
#' @importFrom magclass mbind getYears collapseNames dimSums setNames mselect as.magpie write.report
#' @importFrom magclass mbind getYears collapseNames setNames mselect as.magpie write.report
#' @importFrom gdx readGDX
#' @importFrom dplyr filter
#' @importFrom ggplot2 ggplot aes labs geom_area geom_line geom_col scale_fill_brewer facet_grid theme_minimal
Expand Down
2 changes: 1 addition & 1 deletion R/reportMacroEconomy.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass setNames mbind getYears dimSums new.magpie getRegions setYears
#' @importFrom magclass setNames mbind getYears new.magpie getRegions setYears

reportMacroEconomy <- function(gdx, regionSubsetList = NULL,
t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150)) {
Expand Down
2 changes: 1 addition & 1 deletion R/reportPE.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass mselect getYears dimSums getNames<- mbind setNames
#' @importFrom magclass mselect getYears getNames<- mbind setNames

reportPE <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150)){
####### conversion factors ##########
Expand Down
2 changes: 1 addition & 1 deletion R/reportPolicyCosts.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass getYears mbind dimSums setNames
#' @importFrom magclass getYears mbind setNames
reportPolicyCosts <- function(gdx,gdx_ref,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150)){
####### read in needed data #########
## sets
Expand Down
2 changes: 1 addition & 1 deletion R/reportPrices.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' @importFrom luscale speed_aggregate
#' @importFrom dplyr %>% case_when distinct filter inner_join tibble left_join rename
#' @importFrom gdx readGDX
#' @importFrom magclass mbind getYears getRegions setNames dimExists dimSums new.magpie lowpass complete_magpie getItems<- getNames
#' @importFrom magclass mbind getYears getRegions setNames dimExists new.magpie lowpass complete_magpie getItems<- getNames
#' @importFrom quitte df.2.named.vector getColValues
#' @importFrom readr read_csv
#' @importFrom madrat toolAggregate
Expand Down
2 changes: 1 addition & 1 deletion R/reportSE.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass mselect getSets getSets<- getYears dimSums getNames<- mbind
#' @importFrom magclass mselect getSets getSets<- getYears getNames<- mbind
#' @importFrom abind abind
#' @importFrom rlang sym

Expand Down
2 changes: 1 addition & 1 deletion R/reportTax.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass mbind getYears getNames setNames dimSums setItems
#' @importFrom magclass mbind getYears getNames setNames setItems

reportTax <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150)){
# old tax reporting was deleted, stop if old tax reporting would be needed
Expand Down
2 changes: 1 addition & 1 deletion R/reportTrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass getYears setNames mbind dimSums
#' @importFrom magclass getYears setNames mbind

reportTrade <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150)) {

Expand Down

0 comments on commit 1886a00

Please sign in to comment.