Skip to content

Commit

Permalink
Update Westeros multinode (energy trade) tutorial and add hints (#798)
Browse files Browse the repository at this point in the history
* Update multinode tutorial after resolving issue #601

* Extend multinode tutorial to include hints for questions

* Add release notes #798

* Apply ruff and format hint code block

* Rename tutorial to mention energy trade

* Update mypy, ruff, pre-commit config

Mypy v1.8.0 → v1.9.0
Ruff v0.3.0 → v0.3.2
pre-commit/action v3.0.0 → v3.0.1

---------

Co-authored-by: Fridolin Glatter <glatter@iiasa.ac.at>
Co-authored-by: Paul Natsuo Kishimoto <mail@paul.kishimoto.name>
  • Loading branch information
3 people committed Mar 20, 2024
1 parent 023b91a commit 99422f4
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ jobs:
run: gh cache list -L 999 | cut -f2 | grep pre-commit | xargs -I{} gh cache delete "{}" || true
env: { GH_TOKEN: "${{ github.token }}" }

- uses: pre-commit/action@v3.0.0
- uses: pre-commit/action@v3.0.1
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
language: python
entry: bash -c ". ${PRE_COMMIT_MYPY_VENV:-/dev/null}/bin/activate 2>/dev/null; mypy $0 $@"
additional_dependencies:
- mypy >= 1.8.0
- mypy >= 1.9.0
- asyncssh
- git+https://github.com/iiasa/ixmp.git@main
- importlib_resources
Expand All @@ -20,7 +20,7 @@ repos:
- types-requests
args: ["."]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
rev: v0.3.2
hooks:
- id: ruff
- id: ruff-format
Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Next release
All changes
-----------

- Update tutorial Westeros multinode to include code-based hints for in-depth questions (:pull:`798`).
- :func:`.make_df` can now create partly-filled :class:`DataFrames <pandas.DataFrame>` for indexed sets; not only parameters (:pull:`784`).
- New function :func:`.util.copy_model` that exposes the behaviour of the :program:`message-ix copy-model` CLI command to other Python code (:pull:`784`).
- New test fixture :func:`.tmp_model_dir` (:pull:`784`).
Expand Down
2 changes: 1 addition & 1 deletion message_ix/tests/test_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _t(group: Union[str, None], basename: str, *, check=None, marks=None):
_t("w0", f"{W}_soft_constraints"),
_t("w0", f"{W}_addon_technologies"),
_t("w0", f"{W}_historical_new_capacity"),
_t("w0", f"{W}_multinode"),
_t("w0", f"{W}_multinode_energy_trade"),
# NB this is the same value as in test_reporter()
_t(None, f"{W}_report", check=[("len-rep-graph", 13724)]),
_t("at0", "austria", check=[("solve-objective-value", 206321.90625)]),
Expand Down
2 changes: 1 addition & 1 deletion tutorial/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ framework, such as used in global research applications of |MESSAGEix|.
system (:tut:`westeros/westeros_historical_new_capacity.ipynb`).

#. Modeling of a multi-node energy system and representing trade between nodes
(:tut:`westeros/westeros_multinode.ipynb`).
(:tut:`westeros/westeros_multinode_energy_trade.ipynb`).

#. Use other features of :mod:`message_ix` and :mod:`ixmp`:

Expand Down

0 comments on commit 99422f4

Please sign in to comment.