Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e1cb6f8
Use poetry for publishing
phackstock Jul 24, 2025
254eca8
Fix syntax error in GH action
phackstock Jul 24, 2025
8835956
Fix nightly tests
phackstock Jul 24, 2025
36ee2ab
Add README.md
phackstock Jul 24, 2025
78c0715
Remove README.rst
phackstock Jul 24, 2025
6e6bd57
Update pyproject.toml
phackstock Jul 24, 2025
f87508c
Add dynamic versioning plugin
phackstock Jul 24, 2025
9d238de
Update poetry to 2.x
phackstock Jul 24, 2025
fbefbe3
Update pyproject.toml
phackstock Jul 24, 2025
57a6f13
Use dynamic versioning plugin
phackstock Jul 24, 2025
6ed4324
Update authors
phackstock Jul 24, 2025
1def945
Update ruff to latest version
phackstock Jul 25, 2025
e427fe4
Switch order of installing python and poetry around
phackstock Jul 25, 2025
b651942
Use python 3.13 for linting and publish
phackstock Jul 25, 2025
733cf55
Apply ruff linting and formatting
phackstock Jul 25, 2025
a41844e
Update ruff config to new version
phackstock Jul 25, 2025
6f7c4dd
Update CHANGELOG
phackstock Jul 25, 2025
06403fe
Update requirements.txt
phackstock Jul 25, 2025
499ab2d
Update README.md
phackstock Jul 25, 2025
dcebb4c
Fix accidentally broken test
phackstock Jul 25, 2025
280c4e4
Fix the docs build
phackstock Jul 25, 2025
0b834d5
Small fix in readthedocs.yaml
phackstock Jul 25, 2025
e18fe14
Fix readthedocs.yaml (again)
phackstock Jul 25, 2025
8e2d191
Rename doc folder to docs for consistency
phackstock Jul 25, 2025
0d331ab
Translate CHANGELOG to markdown
phackstock Jul 25, 2025
24c8eef
Translate RELEASING to markdown
phackstock Jul 25, 2025
7a728e4
Rename to .yaml for consistency
phackstock Jul 25, 2025
561688e
Update link
phackstock Jul 25, 2025
c9b845a
Change RELEASING to markdown
phackstock Jul 25, 2025
3626203
Update changelog
phackstock Jul 25, 2025
bb94c08
Add information about poetry 2.x
phackstock Jul 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci-cd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ jobs:
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.13"
cache: poetry

- name: Install poetry dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"

- name: Install dev dependencies
shell: bash
run: |
Expand Down Expand Up @@ -62,6 +65,10 @@ jobs:
with:
python-version: ${{ matrix.python_version }}
cache: poetry

- name: Install poetry dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"

- name: Install test dependencies and package
shell: bash
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
python-version: ${{ matrix.python_version }}
cache: poetry

- name: Install poetry dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"

- name: Install test dependencies and package
shell: bash
run: |
Expand Down
58 changes: 32 additions & 26 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,35 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- if: github.event_name != 'release'
name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- if: github.event_name == 'release'
name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.13"
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.1.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install poetry dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build package
run: poetry build
- if: github.event_name == 'release'
name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- if: github.event_name != 'release'
name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
8 changes: 7 additions & 1 deletion .github/workflows/wg3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
python_version: ["3.11", "3.12", "3.13"]
fail-fast: false
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -37,6 +37,9 @@ jobs:
python-version: ${{ matrix.python_version }}
cache: poetry

- name: Install poetry dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"

- name: Install test dependencies and package
shell: bash
run: |
Expand Down Expand Up @@ -85,6 +88,9 @@ jobs:
python-version: ${{ matrix.python_version }}
cache: poetry

- name: Install poetry dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"

- name: Install test dependencies and package
shell: bash
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ repos:
language: fail
files: "\\.rej$"
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.8'
rev: 'v0.12.5'
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-format
- repo: https://github.com/python-poetry/poetry
rev: '1.7.0'
rev: '2.1.3'
hooks:
- id: poetry-check
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ master

Added
~~~~~
- (`#74 https://github.com/iiasa/climate-assessment/pull/74`_) Fix various issues
- (`#68 https://github.com/iiasa/climate-assessment/pull/68`_) Update supported dependencies and python versions
- (`#58 https://github.com/iiasa/climate-assessment/pull/58`_) Update requirements
- (`#50 https://github.com/iiasa/climate-assessment/pull/50`_) Update scmdata and other dependencies and rewrite a few functions
Expand Down
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# `climate-assessment` - Assessing the climate outcomes of future emissions scenarios

[![image](https://zenodo.org/badge/501176611.svg)](https://zenodo.org/badge/latestdoi/501176611)

------------------------------------------------------------------------

*Please note that `climate-assessment` is still in early developmental stages, thus*
*all interfaces are subject to change.*

The package `climate-assessment` provides the possibility to reproduce the climate
variable data for the working group III (WGIII or WG3) contribution to the IPCC Sixth
Assessment (AR6) report, using climate emulators that were used in the working group I
(WGI or WG1) contribution to AR6. It also allows for assessing new emissions pathways in
a way that is fully consistent with AR6.

## Installation

Note: the package's requirements are currently extremely strict. This is done to make it
more likely that installation will result in a valid environment. If you want a fully
specified environment, please use the `poetry.lock` or `requirements.txt` file provided
in this repository. We hope to make the package more libary-like, with looser
requirements, in future.

### Using `pip`

[pip](https://pip.pypa.io/en/stable/user_guide/) is Python's default package management
system.

> [!CAUTION]
> Due to the better dependency resolution installing with `pip>=22` is
> recommended.

If you install Anaconda, then `pip` is also usable. `pip` can also be used when Python
is installed directly, *without* using Anaconda.

1. Ensure `pip` is installed ---with Anaconda, or according to the pip documentation.
2. Open a command prompt and run:

```console
pip install climate-assessment
```

### From source

(Optional) If you intend to contribute changes to `climate-assessment`, installing
directly from [source](https://github.com/iiasa/climate-assessment) is the way to go.

Detailed instructions on how to do this can be found in the
documentation under
<https://climate-assessment.readthedocs.io/en/latest/install.html>.

## Documentation

All documentation, including installation instructions, can be found at
<https://climate-assessment.readthedocs.io/>.

## License

Licensed under an MIT License. See the LICENSE file for more
information.

## Development

### Raising an issue

If you have a suggestion for development, or find a bug, please report
this under: <https://github.com/iiasa/climate-assessment/issues>.

### Running the tests

The tests can be run with `pytest`. On a Linux system, you should run something like
`MAGICC_PROBABILISTIC_FILE=path/to/probabilistic-file pytest tests`. Note that for the
tests to work properly, you must set up your `.env` file (see \"Environment\" section
above). On Windows, the environment variables (like
`MAGICC_PROBABILISTIC_FILE=path/to/probabilistic-file`) should be set system-wide, and
the command reads `pytest tests`.

### Formatting code

Before committing or merging code, the following lines should be run to
ensure that the formatting is consistent with what is expected by the
Continuous Integration setup (for users with `make` installed,
`make checks` will run these for you):

``` bash
black src scripts tests setup.py
isort src scripts tests setup.py
flake8 src scripts tests setup.py
```
82 changes: 0 additions & 82 deletions README.rst

This file was deleted.

4 changes: 1 addition & 3 deletions notebooks/run-example-ciceroscm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@
"outputs": [],
"source": [
"import os.path\n",
"import tempfile\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"import pandas.testing as pdt\n",
"import pooch\n",
"import pyam\n",
"import tempfile\n",
"\n",
"from climate_assessment.cli import run_workflow"
]
Expand Down
4 changes: 1 addition & 3 deletions notebooks/run-example-custom.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import pandas.testing as pdt\n",
"import pooch\n",
"import pyam\n",
"\n",
"from climate_assessment.cli import run_workflow"
Expand Down Expand Up @@ -435,7 +433,7 @@
"metadata": {},
"outputs": [],
"source": [
"ax = output.filter(variable=f\"*Infilled|Emissions|Sulfur\").plot(color=\"scenario\")\n",
"ax = output.filter(variable=\"*Infilled|Emissions|Sulfur\").plot(color=\"scenario\")\n",
"ax.set_ylim(ymin=0)"
]
},
Expand Down
3 changes: 1 addition & 2 deletions notebooks/run-example-fair.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@
"outputs": [],
"source": [
"import os.path\n",
"import pooch\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"import pandas.testing as pdt\n",
"import pooch\n",
"import pyam\n",
"\n",
"from climate_assessment.cli import run_workflow"
Expand Down
4 changes: 1 addition & 3 deletions notebooks/run-example-magicc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@
"outputs": [],
"source": [
"import os.path\n",
"import tempfile\n",
"\n",
"import dotenv\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"import pandas.testing as pdt\n",
"import pooch\n",
"import pyam\n",
"import tempfile\n",
"\n",
"from climate_assessment.cli import run_workflow"
]
Expand Down
Loading
Loading