def test_from_json(): l = advanced_controls.load_scenarios_from_json( directory=datadir.joinpath('ac'), vmas=None) assert len(l) == 1 ac = l['ac_dataclass'] assert ac.pds_2014_cost == pytest.approx(1.0) assert ac.ref_2014_cost == pytest.approx(2.0) assert ac.conv_2014_cost == pytest.approx(3.0) assert ac.soln_first_cost_efficiency_rate == pytest.approx(4.0) assert ac.conv_first_cost_efficiency_rate == pytest.approx(5.0)
} vma.populate_fixed_summaries(vma_dict=VMAs, filename=THISDIR.joinpath('vma_data', 'VMA_info.csv')) units = { "implementation unit": "MHholds", "functional unit": "Million Households ", "first cost": "US$B", "operating cost": "US$B", } name = 'Smart Thermostats' solution_category = ac.SOLUTION_CATEGORY.REDUCTION scenarios = ac.load_scenarios_from_json(directory=THISDIR.joinpath('ac'), vmas=VMAs) class Scenario: name = name units = units vmas = VMAs solution_category = solution_category def __init__(self, scenario=None): if scenario is None: scenario = list(scenarios.keys())[0] self.scenario = scenario self.ac = scenarios[scenario] # TAM