Skip to content

Commit

Permalink
avoid extra rows if location is set for single region model
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-young committed Aug 16, 2024
1 parent 336cc55 commit 07998ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/CalculationFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ calculateHouseholdEmissions <- function(model, f, location, characterized=FALSE)
logging::logwarn("Household emissions not found in this model")
return(NULL)
}
if(length(model$specs$ModelRegionAcronyms) == 1) {
# Set location as NULL for single region model
location <- NULL
}
codes <- model$FinalDemandMeta[model$FinalDemandMeta$Group%in%c("Household"), "Code_Loc"]
if (!is.null(location)) {
other_code <- codes[!grepl(location, codes)]
Expand Down

0 comments on commit 07998ce

Please sign in to comment.