pommes.tests.test_catalogue
Tests for the catalogue of variable and constraint stages (#151).
Attributes
Functions
|
|
A typed helper creates the linopy object and its entry together. |
|
The queries give what the Benders rules give on the same names. |
|
|
|
|
|
An operation cost per condition is annual: the expectation comes later. |
|
A refused tag leaves neither a variable nor an entry behind. |
|
A plain linopy call leaves a variable without an entry: the build fails. |
|
|
The model of a window of hours, states and fixing rows included. |
|
The model of a year cut into sub-periods of one day. |
|
The catalogued names the model still holds. |
|
What the master keeps and a subproblem pins or drops is declared. |
|
TURPE's contract power: the conditions of a year stay one subproblem. |
|
A window pins the planning variables and the states, drops the rest. |
|
|
|
|
|
A dataset shaped like the solution of a model, without catalogue. |
The rules of 0.10.0 give every variable the stage the module declares. |
|
Module Contents
- pommes.tests.test_catalogue.AREA
- pommes.tests.test_catalogue.HOUR
- pommes.tests.test_catalogue.YEAR_OP
- pommes.tests.test_catalogue.YEAR_INV
- pommes.tests.test_catalogue.model()
- pommes.tests.test_catalogue.test_helpers_create_and_register(model)
A typed helper creates the linopy object and its entry together.
- pommes.tests.test_catalogue.test_queries_match_the_benders_split(model)
The queries give what the Benders rules give on the same names.
- pommes.tests.test_catalogue.test_module_is_required()
- pommes.tests.test_catalogue.test_a_built_model_has_no_writing_module(parameters)
- pommes.tests.test_catalogue.test_duplicate_name_is_refused(model)
- pommes.tests.test_catalogue.test_dims_contradicting_the_stage_are_refused(stage, role, dims, message)
- pommes.tests.test_catalogue.test_a_state_has_neither_hour_nor_investment_year(stage, dims)
- pommes.tests.test_catalogue.test_a_state_with_the_wrong_dims_or_stage_is_refused(stage, dims, message)
- pommes.tests.test_catalogue.test_state_in_must_name_a_state(model)
- pommes.tests.test_catalogue.test_solver_additions_are_not_the_models(model)
- pommes.tests.test_catalogue.test_annual_cost_may_carry_the_condition()
An operation cost per condition is annual: the expectation comes later.
- pommes.tests.test_catalogue.test_mistagged_variable_is_not_created()
A refused tag leaves neither a variable nor an entry behind.
- pommes.tests.test_catalogue.test_definition_must_name_a_known_variable(model)
- pommes.tests.test_catalogue.test_check_reports_entries_the_model_does_not_have(model)
- pommes.tests.test_catalogue.test_untagged_entries_are_refused(model)
A plain linopy call leaves a variable without an entry: the build fails.
- pommes.tests.test_catalogue._window(p)
The model of a window of hours, states and fixing rows included.
- pommes.tests.test_catalogue._split(p)
The model of a year cut into sub-periods of one day.
- pommes.tests.test_catalogue._DATASETS
- pommes.tests.test_catalogue._declared(names, present)
The catalogued names the model still holds.
- pommes.tests.test_catalogue.test_the_benders_split_follows_the_catalogue(fixture, request)
What the master keeps and a subproblem pins or drops is declared.
On every module, the retrofit caps included – planning constraints the name rules used to list by hand –, and on a year cut into sub-periods with its planning states.
TURPE’s contract power: the conditions of a year stay one subproblem.
- pommes.tests.test_catalogue.test_the_window_follows_the_catalogue(parameters_window)
A window pins the planning variables and the states, drops the rest.
- pommes.tests.test_catalogue.test_window_states_are_catalogued(parameters_window)
- pommes.tests.test_catalogue.test_subperiod_states_are_planning_states(parameters)
- pommes.tests.test_catalogue.test_every_entry_names_its_module(parameters_retrofit_conversion_single_horizon)
- pommes.tests.test_catalogue.test_annual_couplings_are_flagged(parameters_flexible_demand)
- pommes.tests.test_catalogue.test_specs_are_immutable()
- pommes.tests.test_catalogue.test_the_catalogue_survives_json(parameters_flexible_demand)
- pommes.tests.test_catalogue.test_a_solution_carries_its_catalogue(model)
- pommes.tests.test_catalogue._as_solution(model)
A dataset shaped like the solution of a model, without catalogue.
- pommes.tests.test_catalogue.test_legacy_names_rebuild_the_catalogue_of_a_solution(fixture, request, caplog)
The rules of 0.10.0 give every variable the stage the module declares.
For a result written before the catalogue existed: the names, with the dimensions for the states, on every module, a window and a year cut into sub-periods. A derived operation variable comes out a decision, the one difference the names never carried.
- pommes.tests.test_catalogue.test_legacy_names_leave_out_what_no_rule_covers(caplog)