Skip to content

Release v0.7.0.dev7

Pre-release
Pre-release

Choose a tag to compare

@irm-codebase irm-codebase released this 05 Sep 15:06
· 17 commits to main since this release
2c8fc10

User-facing changes

|changed| Model.from_dict has been removed in favor of calliope.read_dict (matching read_netcdf and read_yaml)

|changed| in model.yaml, parameters has been renamed to data_definitions to fit with the new params / lookups approach.

|changed| config.init.broadcast_param_data has been renamed to config.init.broadcast_input_data to fit with the new params / lookups approach.

|new| config.solve.postprocess_active can be used to skip postprocessing to save computation time, or avoid crashes if base math is made incompatible with them.

|fixed| All math components units and default values (#662).

|changed| pre-validation of math strings, in search of parsing errors, is undertaken at model instantiation and defaults to not run to reduce model init time.

|changed| Math dictionaries can be injected on loading a model from YAML/dict when using the Python API (calliope.read_yaml(...)/calliope.Model.from_dict(...)) using the math_dict argument.
This replaces add_math_dict in calliope.Model.build.

|changed| MILP math formulation now has its own file (milp.yaml), which can be requested via extra_math (#749).

|fixed| Updates to the expression underlying the Gurobi backend objective function make their way through to the objective function before solving (#797).

|new| Math global expressions have an order option to allow user-defined math to be reordered relative to pre-defined math (#773).

|changed| |backwards-incompatible| where: now uses == for equality comparisons (previously =) (#728).

|changed| |backwards-incompatible| YAML files are loaded with calliope.read_yaml(...) instead of calliope.Model(...).

|changed| |backwards-incompatible| In-memory dictionaries are loaded with calliope.Model.from_dict(...) instead of calliope.Model(...).

|new| In-memory xarray datasets are loaded with calliope.Model(...), e.g. calliope.Model(inputs=input_array, attrs=attributes).

|changed| Model attributes are not stored in the input/results arrays (e.g. model.inputs.attrs) but are available directly from the model object:

  • model.definition = the loaded model data definition
  • model.config = the loaded model configuration
  • model.runtime = runtime attributes, like timing logs
  • model.math = initialised and applied math

They can all be dumped to a single attribute dictionary with calliope.Model.dump_all_attrs()

|new| Model attributes are saved to a attrs.yaml YAML file when storing data using calliope.Model.to_csv.

|new| helper functions to enable summation over single-/multi-dimension groups and rolling window summations of math expression components (#735, #777).

|fixed| Evaluating results of Gurobi global expressions containing pure decision variables / parameters (#780).

|changed| SOS2 piecewise cost example in docs to explicitly include the new decision variable in the investment cost where string (see #525).

|fixed| Timeseries capacity factor accounts for time resolution (#762).

|fixed| Levelised cost accounts for energy that is generated and exported (flow_export) (#767).

|new| all math is defined during init and then stored in model._def.math, with the option to completely replace plan.yaml as the base mode (#763, #739).

|new| documentation on SPORES-specific configuration options (#750, #752).

|fixed| SPORES mode models not being appropriately serialised on saving to NetCDF (#751, #752).

|new| backend get_objective method, similar to get_global_expression etc. (#761)

|new| arrays in model results containing the objective function value of solved models.
Arrays have the name of the corresponding objective in math.
E.g., model.results.min_cost_optimisation will give the objective function value for the base math objective.

|changed| SPORES mode baseline run renamed to 0 and spores array dimension set to an integer dtype

|changed| SPORES configuration option skip_baseline_run renamed to use_latest_results

|new| config.solve.spores.use_latest_results allows for running from existing baseline (e.g. plan mode) results and for continuing a set of SPORES runs.
E.g., if there are results for 4 SPORES, the run can be continued for 6 more iterations by setting spores.use_latest_results and updating spores.number to 10 (4 + 6).

Internal changes

|fixed| ModelDataFactory is no longer run twice during startup, resulting in faster initialisation

|fixed| SPORES tests to vary capacities of costed technologies rather than be able to simply vary the capacity of a free heat transmission technology between SPORES (#782).

|fixed| Randomly failing tests that rely on random sampling from the core code, by setting a global test suite random seed (#789).

|new| pydantic.RootModel used for storing model definition dictionaries with arbitrary keys (techs, nodes, etc.).

|new| Add rich as a dev dependency for much more readable repr strings of our pydantic models.

|changed| Separate inputs and results into separate datasets rather than filtered views on the same _model_data, private dataset.
Accordingly, Remove is_result array attribute and save to separate NetCDF "groups"

|changed| Removed all attributes from _model_data.attrs, storing them instead in pydantic model objects attached to the main calliope model object.
On saving to file, attributes are stored in the attrs of an empty dataset as a distinct NetCDF "group".

New Contributors

Full Changelog: v0.7.0.dev6...v0.7.0.dev7