Skip to content

Technology Scaling Test Procedure

Alex Bettinardi edited this page Jan 9, 2025 · 1 revision

Technology Scaling is a port of an existing feature that is part of the standard PECAS framework. The standard feature is written in Python 3, uses a PostgreSQL database, and scales all future year inputs at once after AA runs in the base year. To satisfy SWIM requirements, it was converted to work with Python 2, to use an SQLite database, and to produce the inputs for each year immediately before AA runs for that year (because the inputs to Technology Scaling are not available until SWIM creates them).

To confirm that the port was successful, we performed the following test:

  • We created simplified test versions of ActivityTotalsW.csv (for both the base and future years), TechnologyOptionsI.csv, and MakeUse.csv. The test files were based on the SWIM_26_HBA scenario, with t46 (2036) taken as the future year, but aggregated into six (non-import/export) industries and six commodities. The resulting scenario was not meant to be realistic, but simply to test the mechanics of the scaling procedure.
  • We wrote a test case (using Python's unittest module) to confirm that the standard PECAS implementation of Technology Scaling replicated the spreadsheet when given the test files.
  • We ran the test case on the SWIM port to confirm that it also replicated the spreadsheet.

The test program and test inputs are provided in this zipped folder. To run the test, copy test_techscaling.py and the technology_scaling_test folder into the model/code folder of a SWIM scenario, and run test_techscaling.py using Python unittest. The command should look like python -m unittest discover, and be run with model/code as the current directory. The test will print "OK" at the end if it passes.

The spreadsheet used to replicate Technology Scaling with the test files is also included in the folder, under the name "Tech Scaling Example.xlsx".

Clone this wiki locally