There is a newer version of the record available.

Published January 24, 2023 | Version v0.1.39
Software Open

MatthewHeun/Recca: v0.1.39

Description

Recca 0.1.39 (2023-01-24)

  • Tests once again all passing on all test rigs of GitHub Actions. Tests had been failing due to new code that correctly detects unit errors (inhomogeneity) for some upstream swim calculations with services as the last stage in an ECC.
  • Move tests associated with verify_cols_missing() from the Recca package to matsindf. Those tests didn't belong in Recca, because verify_cols_missing() is no longer in Recca.
  • Eliminated data frame rows for a couple tests that were producing NA values due to unit inhomogeneity.
  • Switched to simpler formulas derived by MKH for new_R_ps().
  • Eliminated tidyselect warnings.
  • write_ecc_to_excel() now ensures that columns of U and rows of V are the same, even if it means adding zero columns to U or zero rows to V. This change makes further Excel calculations easier.
  • chopR() now checks for the ability to swim downstream with R_prime = R to re-create the original energy conversion chain, thereby bringing consistency with chopY(). This approach identifies numerical precision errors before they cause a problem.
  • chopR() now uses calc_io_mats(direction = "downstream"), thereby consistently using calc_io_mats() for both upstream and downstream swims.
  • calc_io_mats() gains new argument direction that tells whether the input-output matrices are for "upstream" or "downstream" swims.
  • finaldemand_aggregates() now produces true 0 instead of a 1x1 matrix without row or column labels when no columns names of U_EIOU or Y match fd_sectors.
  • Fixed two bugs in new_Y(). There were compensatory formula errors that only appeared in some edge cases.
  • Aggregations are now optional (on by default) in chop_R() and chop_Y().
  • Renamed effects_aggregates() and footprint_aggregates() to chop_R() and chop_Y().
  • New function effects_aggregates() swims downstream from the R matrix to final demand for each column (energy carrier) in the R matrix and calculates primary and final demand aggregates.
  • footprint_aggregates() now checks that the chopped ECCs sum to the original ECC on every calculation.
  • region_aggregates() now correctly eliminates the few_colname when the incoming data frame has no rows.
  • footprint_aggregates() now also includes the *_prime_colname matrices in the nested data frame.
  • calc_io_mats() and calc_L() gain method and tol arguments to control matrix inversion.
  • calc_eta_pfd() now includes columns of names of efficiencies in its output. This feature will assist pivoting on efficiencies later.
  • New function footprint_aggregates() calculates primary and final demand aggregates for each isolated row and column in Y.
  • new_Y() now also produced matrices U_feed, U_eiou, and r_eiou in its output.
  • W matrix no longer included in the output of new_Y(). W can always be calculated from V^T - U.
  • New function write_ecc_to_excel() stores ECCs in spatial format in Excel. All ECC matrices are written to the Excel file: R, U, V, Y, U_feed, U_eiou, r_eiou, and S_units.
  • primary_aggregates() and finaldemand_aggregates() no longer require p_industries and fd_sectors to be present in the incoming list or data frame. Rather, p_industries and fd_sectors are treated as parameters that apply to all items in the incoming list or rows in the incoming data frame. This change brings consistency with other functions that use matsindf::matsindf_apply() internally.
  • New function group_aggregates() that aggregates PSUT matrices according to an aggregation map.
  • New function despecified_aggregates() that aggregates PSUT matrices to a piece of row and column labels.
  • New argument add_net_gross_cols on primary_aggregates() that tells whether to add both net and gross primary energy columns. (Net and gross primary energy aggregate columns will contain identical values, but the presence of both net and gross columns may make it easier to mesh with results from the finaldemand_aggregates() function, which produces net and gross columns that are different.)
  • aggregate_regions() now returns an empty data frame with the expected columns if the input data frame has no rows.
  • Many new tests for new features.
    • Now up to 672 tests, all passing.
    • Test coverage remains at 100 %.

Files

MatthewHeun/Recca-v0.1.39.zip

Files (10.8 MB)

Name Size Download all
md5:dc05adf2d382262c7ae604145b9fdb1d
10.8 MB Preview Download

Additional details

Related works