Coverage for backend/django/Economics/settings_profiles/unit_options.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2026-06-23 21:51 +0000

1from Economics.shared.unit_options import UnitOption 

2 

3 

4def _annual_energy_basis_options(time_unit: str) -> tuple[UnitOption, ...]: 

5 return tuple( 

6 {"value": f"{unit}/{time_unit}", "label": f"{unit}/{time_unit}"} 

7 for unit in ("MJ", "GJ", "PJ") 

8 ) 

9 

10 

11ANNUAL_HEAT_BASIS_UNIT_OPTIONS: tuple[UnitOption, ...] = _annual_energy_basis_options("year") 

12AVERAGE_POWER_UNIT_OPTIONS: tuple[UnitOption, ...] = _annual_energy_basis_options("hr") 

13ELECTRICAL_UPGRADE_RATE_UNIT_OPTIONS: tuple[UnitOption, ...] = ( 

14 {"value": "NZD/kW", "label": "NZD/kW"}, 

15)