Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
116 changes: 58 additions & 58 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,69 +16,69 @@ jobs:
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-latest
python-version:
- '3.10'
- '3.13'

fail-fast: false


runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} py${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Pandoc
uses: r-lib/actions/setup-pandoc@v2

#------------------------------
# install & configure poetry
#------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.1.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#------------------------------------------
# update dependencies to latest versions
#------------------------------------------
- name: Update dependencies
run: poetry update dev,docs,optional_io_formats,optional_plotting,tutorials,wbdata --lock

#------------------------------------
# load cached venv if cache exists
#------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
#------------------------------------------------
# install dependencies if cache does not exist
#------------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --with calamine,dev,docs,optional_io_formats,optional_plotting,tutorials,wbdata --no-root

#------------------------
# install root project
#------------------------
- name: Install library
run: poetry install --no-interaction --only-root

- name: Test with pytest (including Matplotlib)
run: poetry run pytest tests --mpl

- name: Build the docs
run: poetry run make --directory=docs html
- uses: actions/checkout@v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- name: Install Pandoc
uses: r-lib/actions/setup-pandoc@v2

#------------------------------
# install & configure poetry
#------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.1.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#------------------------------------------
# update dependencies to latest versions
#------------------------------------------
- name: Update dependencies
run: poetry update dev,docs,optional_io_formats,optional_plotting,tutorials,wbdata --lock

#------------------------------------
# load cached venv if cache exists
#------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

#------------------------------------------------
# install dependencies if cache does not exist
#------------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --with calamine,dev,docs,optional_io_formats,optional_plotting,tutorials,wbdata --no-root

#------------------------
# install root project
#------------------------
- name: Install library
run: poetry install --no-interaction --only-root

- name: Test with pytest (including Matplotlib)
run: poetry run pytest tests --mpl

- name: Build the docs
run: poetry run make --directory=docs html
58 changes: 29 additions & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,36 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- uses: actions/setup-python@v5
- uses: actions/setup-python@v7

#------------------------------
# install & configure poetry
#------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.1.2
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
#------------------------------
# install & configure poetry
#------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.1.2
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

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
if: github.event_name == 'release'
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
if: github.event_name == 'release'
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/pytest-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
python-version: '3.10'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
name: ${{ matrix.os }} py${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: astral-sh/ruff-action@v4.1.0
9 changes: 8 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Next release
# Release v3.5.0

## Highlights

Support the central 90% interval [p5-p95] as a limits setting in the statistics module.

## API changes

The method `len(df)` is marked as deprecated. Use either `len(df.series)` for the number
of datapoints or `len(df.index)` for the number of scenarios.

The method `Statistics.summarize()` includes a new argument `limits` that can take the
values 'full range', 'interquartile' or 'central 90%'. The previous boolean arguments
`fullrange` and `interquartile` are marked as deprecated.
Expand Down
9 changes: 3 additions & 6 deletions pyam/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,9 @@ def __getitem__(self, key):
return self.get_data_column(key)

def __len__(self):
# TODO deprecate with release v4.0, return `len(df.index)`instead
deprecation_warning(
"Use `len(df.series)` instead. In the future, "
"`len(df)` will return `len(df.index)`.",
"The method `len()`",
)
# TODO deprecated, add DeprecationWarning with release v4.0 pointing to
# `len(df.series)` and `len(df.index)`
deprecation_warning("Use `len(df.series)` instead.", "The method `len()`")
return len(self._data)

def __repr__(self):
Expand Down
1 change: 1 addition & 0 deletions pyam/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def swap_year_for_time(df, inplace=False):
time = list(map(dateutil.parser.parse, [f"{y}-{s}" for y, s in time_values]))
index = index.droplevel(["year", "subannual"])
ret.extra_cols.remove("subannual")
delattr(ret, "subannual")
else:
time = index.get_level_values("year")
index = index.droplevel(["year"])
Expand Down
Loading