diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d22ec5..9942e36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.2.1] - 2022-11-01 +### Fixed +- Fixes a bug where storage constraints were not initialized in the `DispatchModel`. +- Fixes the tolerances in the testing suite so that the tests pass. +Previously, a single test was failing due to (-1e-9 == 0 ± 1e-12). +This should pass, since 1e-9 is still close to zero. + ## [0.2.0] - 2022-10-31 ### Added - Adds the following Technology subclasses diff --git a/docs/source/conf.py b/docs/source/conf.py index e491c52..38fc656 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,7 @@ author = 'Samuel Dotson' # The full version, including alpha/beta/rc tags -release = '0.2.0' +release = '0.2.1' # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index 8009851..d3aa687 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ # Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z" _version_major = 0 _version_minor = 2 -_version_micro = 0 # use '' for first of series, number for 1 and above +_version_micro = 1 # use '' for first of series, number for 1 and above # _version_extra = 'dev' _version_extra = '' # Uncomment this for full releases diff --git a/tests/test_models.py b/tests/test_models.py index 454b207..ef14333 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -203,10 +203,10 @@ def test_dispatch_model_solve_case1(technology_set_1, net_demand): [t.variable_cost for t in technology_set_1]).min() expected_result = cheapest_tech * net_demand.sum() - assert model.objective == pytest.approx(expected_result, TOL) + assert model.objective == pytest.approx(expected_result, abs=TOL) assert model.results['Nuclear'].sum( ) == pytest.approx(net_demand.sum(), TOL) - assert model.results['NaturalGas'].sum() == pytest.approx(0.0, TOL) + assert model.results['NaturalGas'].sum() == pytest.approx(0.0, abs=TOL) def test_dispatch_model_solve_case2(technology_set_2, net_demand): @@ -226,7 +226,7 @@ def test_dispatch_model_solve_case2(technology_set_2, net_demand): expected_natgas = net_demand - expected_nuclear expected_result = (expected_nuclear * nuclear.variable_cost + expected_natgas * natgas.variable_cost).sum() - assert model.objective == pytest.approx(expected_result, TOL) + assert model.objective == pytest.approx(expected_result, abs=TOL) def test_dispatch_model_solve_case3(technology_set_3, net_demand): @@ -244,9 +244,9 @@ def test_dispatch_model_solve_case3(technology_set_3, net_demand): min_power_delta = ((model.results.Nuclear.diff()) / nuclear.capacity.to_value()).min() assert max_power_delta == pytest.approx( - nuclear.ramp_up_rate.to_value(), TOL) + nuclear.ramp_up_rate.to_value(), abs=TOL) assert min_power_delta == pytest.approx( - -nuclear.ramp_down_rate.to_value(), TOL) + -nuclear.ramp_down_rate.to_value(), abs=TOL) def test_dispatch_model_solve_case4(technology_set_4, net_demand): @@ -263,5 +263,5 @@ def test_dispatch_model_solve_case4(technology_set_4, net_demand): 'Battery_charge']].sum().sum() binary_charging = np.dot(model.results.Battery, model.results.Battery_charge) - assert (total_gen - net_demand.sum()) == pytest.approx(0, TOL) - assert binary_charging == pytest.approx(0, TOL) + assert (total_gen - net_demand.sum()) == pytest.approx(0, abs=TOL) + assert binary_charging == pytest.approx(0, abs=TOL)