Skip to content

Commit

Permalink
Merge branch 'main' into update-cost-expr-naming
Browse files Browse the repository at this point in the history
  • Loading branch information
brynpickering committed Sep 17, 2024
2 parents 9910b0e + 62dcd34 commit 8adf258
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 20 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/pr-ci-pipbuild-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: pipbuild
channels:
- conda-forge
dependencies:
- python=3.11
- pip
- pip:
- build
6 changes: 1 addition & 5 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ jobs:
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: latest
environment-name: pipbuild
create-args: >-
python=3.11
pip
build
environment-file: .github/workflows/pr-ci-pipbuild-environment.yml
post-cleanup: all
cache-environment: true
- name: Build package
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
## 0.7.0.dev4 (dev)
## 0.7.0.dev5 (Unreleased)

## 0.7.0.dev4 (2024-09-10)

### User-facing changes

|changed| cost expressions in math, to split out investment costs into the capital cost (`cost_investment`), annualised capital cost (`cost_investment_annualised`), fixed operation costs (`cost_operation_fixed`) and variable operation costs (`cost_operation_variable`, previously `cost_var`) (#645).

|fixed| Decision variable domain in math docs to use $\in$ instead of $\forall$ (#652).

|fixed| Clarity of `flow_cap_min` description in documentation (#653).

|changed| API/schema documentation is de-ranked in documentation search bar results (#670).

|new| Math component cross-references in both directions ("uses" and "used in") in Markdown math documentation (#643).

|fixed| Duplicated links in math documentation (#651).
Expand Down
12 changes: 11 additions & 1 deletion docs/hooks/generate_readable_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import tempfile
import textwrap
from pathlib import Path

import jsonschema2md
Expand Down Expand Up @@ -55,7 +56,16 @@ def _schema_to_md(schema: dict, filename: str, config: dict) -> File:
assert lines[2] == "## Properties\n\n"
del lines[2]

output_full_filepath.write_text("\n".join(lines))
initial_lines = textwrap.dedent(
"""
---
search:
boost: 0.25
---
"""
)
output_full_filepath.write_text(initial_lines.lstrip() + "\n".join(lines))

return File(
path=output_file,
Expand Down
7 changes: 6 additions & 1 deletion docs/reference/api/attrdict.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
::: calliope.attrdict.AttrDict
---
search:
boost: 0.5
---

::: calliope.attrdict.AttrDict
7 changes: 6 additions & 1 deletion docs/reference/api/backend_model.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
::: calliope.backend.backend_model.BackendModel
---
search:
boost: 0.5
---

::: calliope.backend.backend_model.BackendModel
7 changes: 6 additions & 1 deletion docs/reference/api/example_models.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
::: calliope.examples
---
search:
boost: 0.5
---

::: calliope.examples
7 changes: 6 additions & 1 deletion docs/reference/api/exceptions.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
::: calliope.exceptions
---
search:
boost: 0.5
---

::: calliope.exceptions
7 changes: 6 additions & 1 deletion docs/reference/api/helper_functions.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
::: calliope.backend.helper_functions
---
search:
boost: 0.5
---

::: calliope.backend.helper_functions
7 changes: 6 additions & 1 deletion docs/reference/api/logging.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
::: calliope.util.logging
---
search:
boost: 0.5
---

::: calliope.util.logging
7 changes: 6 additions & 1 deletion docs/reference/api/model.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
::: calliope.Model
---
search:
boost: 0.5
---

::: calliope.Model
7 changes: 6 additions & 1 deletion docs/reference/api/schema.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
::: calliope.util.schema
---
search:
boost: 0.5
---

::: calliope.util.schema
5 changes: 5 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
search:
boost: 0.5
---

# CLI Reference

This page provides documentation for the `calliope` command line tool.
Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ theme:
- navigation.top
- content.code.copy
- content.code.annotate
- search.suggest
- search.highlight
- search.share
logo: img/logo-bw.png
favicon: img/favicon.ico
extra_css:
Expand Down
2 changes: 1 addition & 1 deletion src/calliope/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.0.dev3"
__version__ = "0.7.0.dev5"
2 changes: 1 addition & 1 deletion src/calliope/backend/latex_backend_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def _variable_setter(where: xr.DataArray, references: set) -> xr.DataArray:
self._update_references(name, bound_refs.difference(name))

self._generate_math_string(
parsed_component, var_da, equations=[lb, ub], sense=r"\forall" + domain
parsed_component, var_da, equations=[lb, ub], sense=r"\in" + domain
)

def add_objective( # noqa: D102, override
Expand Down
13 changes: 10 additions & 3 deletions src/calliope/config/model_def_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,16 @@ properties:
x-type: float
title: Minimum rated flow capacity.
description: >-
Limits `flow_cap` to a minimum.
NOTE: this will _force_ `flow_cap` to a minimum value unless `cap_method` is set to `integer`.
If `cap_method=integer`, this will be scaled by the number of integer units of a technology purchased.
This acts as lower limit (lower bound) for flow_cap.
If `cap_method` = integer, this will be scaled by the number of integer units of a technology purchased.
!!! note
If `cap_method` = continuous (which is set by default), then setting `flow_cap_min` to any value greater than 0 forces the model to always respect that limit, which in turn forces investment into the technology.
Use this to enforce given investment plans, or to account for existing technologies that cannot be decommissioned.
An example: If `cap_method` = continuous and `flow_cap_min` = 100, then flow_cap has to be at least 100.
This means that going to 0 is not possible, unless you switch to `cap_method` = integer (see [cap_method][]).
x-unit: power or $\frac{\text{power}}{\text{unit}}$.

flow_cap_min_systemwide:
Expand Down

0 comments on commit 8adf258

Please sign in to comment.