Skip to content

Commit

Permalink
Temporarily remove from public api these functions which will not wor…
Browse files Browse the repository at this point in the history
…k with models with external import factors:

calculateMarginSectorImpacts(), calculateFlowContributiontoImpact(), and disaggregateTotalToDirectAndTier1()
  • Loading branch information
WesIngwersen committed Aug 6, 2024
1 parent 876817a commit a8db500
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ export(buildIOModel)
export(buildModel)
export(buildTwoRegionModels)
export(calculateEEIOModel)
export(calculateFlowContributiontoImpact)
export(calculateMarginSectorImpacts)
export(calculateSectorPurchasedbySectorSourcedImpact)
export(compareFlowTotals)
export(disaggregateTotalToDirectAndTier1)
export(extractAndFormatDemandVector)
export(formatDemandVector)
export(generateModelIdentifier)
Expand Down
6 changes: 3 additions & 3 deletions R/CalculationFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ calculateSectorContributiontoImpact <- function (model, sector, indicator, domes
#' @param indicator, str, index of a model indicator for use in the C matrix, e.g. "Acidification Potential".
#' @param domestic, boolean, sets model to use domestic flow matrix. Default is FALSE.
#' @return A dataframe sorted by contribution (high-to-low), also showing "M", "C", "impact".
#' @export
## @export ##temporarily comment out due to failure for models with external import factors
calculateFlowContributiontoImpact <- function (model, sector, indicator, domestic=FALSE) {
M <- model$M
C <- model$C
Expand Down Expand Up @@ -466,7 +466,7 @@ calculateSectorPurchasedbySectorSourcedImpact <- function (y, model, indicator)
#' Calculate sector margin impacts in the form of M and N Matrix
#' @param model A complete EEIO model: a list with USEEIO model components and attributes.
#' @return A list with M_margin and N_margin
#' @export
## @export ##temporarily comment out due to failure for models with external import factors
calculateMarginSectorImpacts <- function(model) {
if (model$specs$IODataSource == "stateior") {
stop("Margins not available for two-region models")
Expand Down Expand Up @@ -550,8 +550,8 @@ calculateHouseholdEmissions <- function(model, f, location, characterized=FALSE)
#' @param impact str, a model indicator (e.g., "Greenhouse Gases") row index of N,
#' or elementary flow (e.g., "Methane/emission/air/kg") index of M
#' @param opt_impact str {'indicator', 'elemflow'}, string code to specify impact type
#' @export
#' @return A data frame of direct and per-tier-1-purchase sector impacts
## @export ##temporarily comment out due to failure for models with external import factors
disaggregateTotalToDirectAndTier1 <- function(model, impact, opt_impact="indicator") {
mtx_direct <- c("indicator"="D", "elemflow"="B")[opt_impact]
if (is.na(mtx_direct)) {
Expand Down

0 comments on commit a8db500

Please sign in to comment.