pommes.tests.test_operation_window

Windowed operation model: equivalence with the year, state duals, budget.

Attributes

YEAR

SOLVE

CONDITIONS

Functions

parameters_window(parameters_conversion, storage)

_annual_reference(p)

_ocgt_production(solution, hours)

test_windows_chained_on_the_annual_states_add_up_to_the_year(...)

test_state_duals_are_subgradients(parameters_window)

test_budget_state_bounds_the_production(parameters_window)

test_window_must_be_contiguous(parameters_window)

test_a_state_the_window_does_not_expose_is_refused(...)

A module pinning a new state must be taught to the window.

test_build_model_unchanged_without_the_new_parameters(...)

_with_conditions(p, **profiles)

Two equiprobable conditions; profiles scale series per condition.

parameters_conditions(parameters_window)

_capacities(p)

_same_matrix(a, b)

Two linopy models exporting the same LP (rows, columns, bounds).

_state(p)

test_set_time_series_equals_a_window_built_for_the_condition(...)

test_set_time_series_refuses_what_it_cannot_patch(...)

test_time_series_update_patches_a_persistent_solver(...)

test_rules_name_existing_parameters()

test_window_keeps_a_zero_yearly_import_ceiling(...)

A zero ceiling survives the drop; a positive one is reported.

test_set_time_series_writes_the_emission_factor_of_the_imports(...)

The emissions are in the carbon costs row since #152, not a row of

Module Contents

pommes.tests.test_operation_window.YEAR = 2020
pommes.tests.test_operation_window.SOLVE
pommes.tests.test_operation_window.parameters_window(parameters_conversion, storage)
pommes.tests.test_operation_window._annual_reference(p)
pommes.tests.test_operation_window._ocgt_production(solution, hours)
pommes.tests.test_operation_window.test_windows_chained_on_the_annual_states_add_up_to_the_year(parameters_window)
pommes.tests.test_operation_window.test_state_duals_are_subgradients(parameters_window)
pommes.tests.test_operation_window.test_budget_state_bounds_the_production(parameters_window)
pommes.tests.test_operation_window.test_window_must_be_contiguous(parameters_window)
pommes.tests.test_operation_window.test_a_state_the_window_does_not_expose_is_refused(parameters_window, monkeypatch)

A module pinning a new state must be taught to the window.

pommes.tests.test_operation_window.test_build_model_unchanged_without_the_new_parameters(parameters_window)
pommes.tests.test_operation_window.CONDITIONS = ('calm', 'windy')
pommes.tests.test_operation_window._with_conditions(p, **profiles)

Two equiprobable conditions; profiles scale series per condition.

pommes.tests.test_operation_window.parameters_conditions(parameters_window)
pommes.tests.test_operation_window._capacities(p)
pommes.tests.test_operation_window._same_matrix(a, b)

Two linopy models exporting the same LP (rows, columns, bounds).

pommes.tests.test_operation_window._state(p)
pommes.tests.test_operation_window.test_set_time_series_equals_a_window_built_for_the_condition(parameters_conditions)
pommes.tests.test_operation_window.test_set_time_series_refuses_what_it_cannot_patch(parameters_window, parameters_conditions)
pommes.tests.test_operation_window.test_time_series_update_patches_a_persistent_solver(parameters_conditions, backend)
pommes.tests.test_operation_window.test_rules_name_existing_parameters()
pommes.tests.test_operation_window.test_window_keeps_a_zero_yearly_import_ceiling(parameters_window, net_import, caplog)

A zero ceiling survives the drop; a positive one is reported.

pommes.tests.test_operation_window.test_set_time_series_writes_the_emission_factor_of_the_imports(parameters_window, carbon, net_import)

The emissions are in the carbon costs row since #152, not a row of their own: an hourly emission factor of the imports is written there, scaled as the row scales the emissions, a zero factor included.