reemission.tests package
Submodules
reemission.tests.test_biogenic module
Tests for BiogenicFactors
- class reemission.tests.test_biogenic.TestBiogenic(methodName='runTest')[source]
Bases:
TestCase
Test functionality of BiogenicFactors class
- setUp()[source]
Hook method for setting up the test fixture before exercising it.
- classmethod setUpClass()[source]
Hook method for setting up class fixture before running tests in the class.
- test_convert_to_dict() None [source]
Test conversion to a dictionary
- test_read_from_dict() None [source]
Test initialization of BiogenicFactors from dictionary
reemission.tests.test_cli module
Tests for command line interface
- reemission.tests.test_cli.test_main()[source]
reemission.tests.test_input module
Tests for the Input and Inputs classes
TODO: Modify so that model loading involves parsing with InputModel.
- class reemission.tests.test_input.TestInput(methodName='runTest')[source]
Bases:
TestCase
Test class for testing Input class functionalities
- input = None
- setUp() None [source]
Hook method for setting up the test fixture before exercising it.
- classmethod setUpClass()[source]
Hook method for setting up class fixture before running tests in the class.
- test_input_from_dict() None [source]
Test input object initialization from data in dict format
- test_input_fromfile() None [source]
Test input object initialization Intented behaviour: Instantiating with wrong key should create a new input object with name=[Reservoir Name] and data={}
- test_read_yaml() None [source]
Test reading of yaml files
- test_retrieve_catchment_data() None [source]
Test catchment data retrieval
- test_retrieve_emission_factors() None [source]
Test emission factors (list) data retrieval
- test_retrieve_monthly_temps() None [source]
Test retrieval of monthly temperatures (12x1 vector of floats)
- test_retrieve_reservoir_data() None [source]
Test reservoir data retrieval
- test_retrieve_year_vector() None [source]
Test retrieval of the vector of years (for calculation of emission profiles)
- class reemission.tests.test_input.TestInputs(methodName='runTest')[source]
Bases:
TestCase
Test class for testing Inputs class functionalities
- inputs = None
- setUp() None [source]
Hook method for setting up the test fixture before exercising it.
- classmethod setUpClass() None [source]
Hook method for setting up class fixture before running tests in the class.
- test_add_new_data() None [source]
Initialize inputs from file and add a new reservoir dict
- test_inputs_fromfile() None [source]
Test input object initialization
reemission.tests.test_model module
Tests for the EmissionModel class functionalities
- class reemission.tests.test_model.TestEmissionModel(methodName='runTest')[source]
Bases:
TestCase
Test class for testing EmissionModel class functionalities
- em_model
alias of
EmissionModel
reemission.tests.test_n_exports module
reemission.tests.test_p_exports module
reemission.tests.test_preimpoundment module
- class reemission.tests.test_preimpoundment.TestLanduseMapping(methodName='runTest')[source]
Bases:
TestCase
Checks if data mapping from geocaret to re-emission and pre-impoundment emission calculation in re-emission produce correct results
- classmethod setUpClass()[source]
Hook method for setting up class fixture before running tests in the class.
- test_catchment_landuse_mapping()[source]
Test mapping between geocaret and re-emission Re-emission landuse map is shown below:
“bare”, “snow and ice” “urban” “water” “wetlands” “crops” “shrubs” “forest” “no data”
- Heet landuse map is as follows:
c_landcover_0 ‘No Data’ c_landcover_1 ‘Croplands’ c_landcover_2 ‘Grassland/Shrubland’ c_landcover_3 ‘Forest’ c_landcover_4 ‘Wetlands’ c_landcover_5 ‘Settlements’ c_landcover_6 ‘Bare Areas’ c_landcover_7 ‘Water Bodies’ c_landcover_8 ‘Permanent snow and ice’
- test_reservoir_landuse_mapping()[source]
Reservoir landuse mapping follows the same order as catchment landuse mapping but the vector is 3 x 9 = 27 long as the landuse mapping is divided into three categories based on soil type: Mineral -> Organic -> No Data
- class reemission.tests.test_preimpoundment.TestPreimpoundment(methodName='runTest')[source]
Bases:
TestCase
Checks calculation of pre-impoundment emissions with re-emission using re-emission inputs.
- classmethod setUpClass()[source]
Load pre-impoundment-emission-tables
- test_preimpoundment_ch4_emissions()[source]
- test_preimpoundment_co2_emissions()[source]
reemission.tests.test_presenter module
Tests for the Presenter and Writer classes
- class reemission.tests.test_presenter.TestPresenter(methodName='runTest')[source]
Bases:
TestCase
Class for testing the Presenter functionality
- input_file_path: str = '/home/runner/work/reemission/reemission/tests/test_data/inputs.json'
- inputs: Inputs | None = None
- output_file_path: str = '/home/runner/work/reemission/reemission/tests/test_data/test_outputs.json'
- outputs: Dict | None = None
- classmethod setUpClass()[source]
Hook method for setting up class fixture before running tests in the class.
- classmethod tearDownClass()[source]
Hook method for deconstructing the class fixture after running all tests in the class.
- test_excel()[source]
Test writing output data to .xlsx using Pandas
- test_latex()[source]
Test writing output data to .tex / .pdf using LatexWriter
- test_presenter_config()[source]
Check Presenter config data load in post init
- test_presenter_init()[source]
Check if initializations from dict and json produce the same data sets
reemission.tests.test_temperature module
Tests for the Emission classes
- class reemission.tests.test_temperature.TestTemperature(methodName='runTest')[source]
Bases:
TestCase
- setUp()[source]
Hook method for setting up the test fixture before exercising it.
- classmethod setUpClass()[source]
Hook method for setting up class fixture before running tests in the class.
- tearDown()[source]
Hook method for deconstructing the test fixture after testing it.
- classmethod tearDownClass()[source]
Hook method for deconstructing the class fixture after running all tests in the class.
- test_coldest()[source]