Skip to content

Commit

Permalink
remove browser statements
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Apr 8, 2024
1 parent 1344721 commit 6f4a7d3
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '3091608'
ValidationKey: '3092076'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
gamstransfer=?ignore
any::lucode2
any::covr
any::madrat
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ message: If you use this software, please cite it using the metadata from this f
type: software
title: 'edgeTransport: Prepare EDGE Transport Data for the REMIND model'
version: 1.5.6
date-released: '2024-04-05'
date-released: '2024-04-08'
abstract: EDGE-T is a fork of the GCAM transport module https://jgcri.github.io/gcam-doc/energy.html#transportation
with a high level of detail in its representation of technological and modal options.
It is a partial equilibrium model with a nested multinomial logit structure and
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
VignetteBuilder: knitr
Date: 2024-04-05
Date: 2024-04-08
Config/testthat/edition: 3
Imports:
rmndt,
Expand Down
2 changes: 0 additions & 2 deletions R/generateEDGEdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ toolGenerateEDGEdata <- function(input_folder, output_folder, cache_folder = NUL
if(nrow(nas) > 0) {
print("NAs found in FV vintage shares.")
nas
browser()
}
shares$FV_shares = vintages[["shares"]]$FV_shares
prices = vintages[["prices"]]
Expand All @@ -474,7 +473,6 @@ toolGenerateEDGEdata <- function(input_folder, output_folder, cache_folder = NUL
if(nrow(nas) > 0) {
print("NAs found in final demand output.")
nas
browser()
}

num_veh_stations = toolVehicleStations(
Expand Down
8 changes: 0 additions & 8 deletions R/incotrend.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ toolPreftrend <- function(SWS, ptab, calibdem, incocost, years, GDP_POP_MER,
nas <- FVtarget[is.na(sw)]
if(nrow(nas) > 0){
print("Warning: NAs in SWs found.")
browser()
}

setnames(FVtarget, "sw", "value")
Expand Down Expand Up @@ -221,31 +220,27 @@ toolPreftrend <- function(SWS, ptab, calibdem, incocost, years, GDP_POP_MER,
nas <- S3target[is.na(sw)]
if(nrow(nas) > 0){
print("Warning: NAs in SWs found.")
browser()
}

S2target[, sw := sw/max(sw),
by = c("region", "year", "subsector_L3")]
nas <- S2target[is.na(sw)]
if(nrow(nas) > 0){
print("Warning: NAs in SWs found.")
browser()
}

S1target[, sw := sw/max(sw),
by = c("region", "year", "subsector_L2")]
nas <- S1target[is.na(sw)]
if(nrow(nas) > 0){
print("Warning: NAs in SWs found.")
browser()
}

VStarget[, sw := sw/max(sw),
by = c("region", "year", "subsector_L1")]
nas <- VStarget[is.na(sw)]
if(nrow(nas) > 0){
print("Warning: NAs in SWs found.")
browser()
}


Expand Down Expand Up @@ -332,7 +327,6 @@ Hybrid Electric,Liquids")
nas <- FVtarget[logit_type != "pchar" & is.na(value)]
if(nrow(nas) > 0){
print(sprintf("NAs found in FV shareweight trends for %s scenario.", tech_scen))
browser()
}
## level S2: Bus vs LDV
S2target[, regioncat := ifelse(region %in% richregions, "rich", "poor")]
Expand All @@ -350,7 +344,6 @@ Hybrid Electric,Liquids")
nas <- S2target[is.na(sw)]
if(nrow(nas) > 0){
print(sprintf("NAs found in S2 shareweight trends for %s scenario.", tech_scen))
browser()
}

## level S3: all other mode shares
Expand All @@ -369,7 +362,6 @@ Hybrid Electric,Liquids")
nas <- S3target[is.na(sw)]
if(nrow(nas) > 0){
print(sprintf("NAs found in S3 shareweight trends for %s scenario.", tech_scen))
browser()
}

}else{
Expand Down
2 changes: 0 additions & 2 deletions R/logit.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ toolCalculateLogitSW <- function(prices,
nas <- df[is.na(share)]
if(nrow(nas) > 0) {
print("NAs found in SWs.")
browser()
}
MJ_km <- merge(df, mj_km_data, by=intersect(names(df),names(mj_km_data)), all = FALSE)

Expand Down Expand Up @@ -237,7 +236,6 @@ toolCalculateLogitSW <- function(prices,
if(nrow(nas) > 0){
print("NAs found in FV shares.")
nas
browser()
}
# VS1
VS1_all <- X2Xcalc(prices = FV,
Expand Down
10 changes: 4 additions & 6 deletions R/reportEDGET.R
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,12 @@ toolReportEDGET <- function(output_folder = ".",

vars <- varlist[[aggrname]]
#access the first element in vars


if (length(unique(datatable[variable %in% vars]$variable)) < length(vars)){
browser()
print(paste0("Missing variables to aggregate data to ", aggrname))
}
else if (length(unique(datatable[variable %in% vars]$variable)) > length(vars)) {
browser()
print(paste0('duplicates from: ', aggrname, 'not summed up'))
}
else {
Expand Down Expand Up @@ -992,11 +990,11 @@ toolReportEDGET <- function(output_folder = ".",

#Calculate useful energy
UE <- toMIF[grepl("FE", variable) & grepl("Electric|Liquids|Hydrogen", variable)] #select only FE for electricity, liquids and hydrogen


#create new column named technology and assign values based on variables in UE.varialbe: if the variable contains "Electricity" then technology is "Electric", if the variable contains "Liquids" then technology is "Liquids", if the variable contains "Hydrogen" then technology is "Hydrogen"
UE[, technology := ifelse(grepl("Electricity", variable), "Electric", ifelse(grepl("Liquids", variable), "Liquids", ifelse(grepl("Hydrogen", variable), "Hydrogen", NA)))]

UE <- merge(UE, Mapp_UE, technology) #merge with efficiencies
UE[, value:= value*UE_efficiency][, c("variable", "technology", "UE_efficiency"):= list(gsub("FE","UE", variable), NULL, NULL)] #calculate useful energy

Expand Down
1 change: 0 additions & 1 deletion R/sharesIntensitiesDemand.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ toolSharesIntensityDemand <- function(logit_shares,
nas <- dt[!complete.cases(dt)]
if(nrow(nas) > 0){
print("NAs found in REMIND output table")
browser()
}
}
demand_list = list(demand = demand,
Expand Down

0 comments on commit 6f4a7d3

Please sign in to comment.