Skip to content

Commit c837b98

Browse files
committed
Merge branch 'master' into release
2 parents 4c6d1d6 + b12f82d commit c837b98

File tree

17 files changed

+2218
-1766
lines changed

17 files changed

+2218
-1766
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
strategy:
1111
matrix:
1212
platform: [ubuntu-latest, macos-latest, windows-latest]
13-
python-version: ['3.7', '3.8', '3.10', '3.11']
13+
python-version: ['3.8', '3.10', '3.11', '3.12']
1414
defaults:
1515
run:
1616
shell: bash
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v4
20+
uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
- name: Upgrade pip
@@ -43,19 +43,19 @@ jobs:
4343
run: poetry run flake8 ./staircase
4444
- name: Test with pytest
4545
run: |
46-
poetry run pytest ./tests --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=staircase --cov-report=xml
46+
poetry run pytest ./tests --junitxml=junit/test-results-${{ matrix.platform }}-${{ matrix.python-version }}.xml --cov=staircase --cov-report=xml
4747
codecov
4848
- name: Upload pytest test results
49-
uses: actions/upload-artifact@v2
49+
uses: actions/upload-artifact@v4
5050
with:
51-
name: pytest-results-${{ matrix.python-version }}
52-
path: junit/test-results-${{ matrix.python-version }}.xml
51+
name: pytest-results-${{ matrix.platform }}-${{ matrix.python-version }}
52+
path: junit/test-results-${{ matrix.platform }}-${{ matrix.python-version }}.xml
5353
# Use always() to always run this step to publish test results when there are test failures
5454
if: ${{ always() }}
5555
- name: Upload coverage to Codecov
56-
uses: codecov/codecov-action@v3
56+
uses: codecov/codecov-action@v4
5757
with:
5858
token: ${{ secrets.CODECOV_TOKEN }}
59-
fail_ci_if_error: true
59+
fail_ci_if_error: false
6060

6161

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
group: ${{ github.ref }}-pre-commit
1212
cancel-in-progress: ${{github.event_name == 'pull_request'}}
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v3
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
1616
- uses: pre-commit/[email protected]

docs/release_notes/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Changelog
66
=========
77

88

9+
**v2.6.0 2024-06-24**
10+
11+
- support for Python 3.12 added
12+
- support for Python 3.7 removed
13+
14+
915
**v2.5.2 2023-07-04**
1016

1117
- support for Python 3.11

poetry.lock

Lines changed: 2150 additions & 1720 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Poetry pyproject.toml: https://python-poetry.org/docs/pyproject/
22

33
[build-system]
4-
requires = ["poetry>=1.0"]
5-
build-backend = "poetry.masonry.api"
4+
requires = ["poetry-core>=1.0.0"]
5+
build-backend = "poetry.core.masonry.api"
66

77
[tool.poetry]
88
name = "staircase"
9-
version = "2.5.2"
9+
version = "2.6.0"
1010
description = "A data analysis package based on modelling and manipulation of mathematical step functions. Strongly aligned with pandas."
1111
readme = "README.md"
1212
authors = ["Riley Clement <[email protected]>"]
@@ -30,11 +30,11 @@ keywords=[
3030
classifiers=[
3131
'Operating System :: OS Independent',
3232
'Intended Audience :: Science/Research',
33-
'Programming Language :: Python :: 3.7',
3433
'Programming Language :: Python :: 3.8',
3534
'Programming Language :: Python :: 3.9',
3635
'Programming Language :: Python :: 3.10',
3736
'Programming Language :: Python :: 3.11',
37+
'Programming Language :: Python :: 3.12',
3838
'Topic :: Scientific/Engineering',
3939
]
4040

@@ -43,28 +43,28 @@ classifiers=[
4343

4444

4545
[tool.poetry.dependencies]
46-
python = "^3.7"
46+
python = "^3.8"
4747
pytz = "*"
4848
typing-extensions = "^4.4.0"
4949

5050
[[tool.poetry.dependencies.pandas]]
51-
python = ">=3.7,<3.10"
51+
python = ">=3.8,<3.10"
5252
version = "^1"
5353

5454
[[tool.poetry.dependencies.pandas]]
5555
python = "^3.10"
5656
version = ">=1.3.4,<3"
5757

5858
[[tool.poetry.dependencies.numpy]]
59-
python = ">=3.7,<3.10"
60-
version = "^1.15"
59+
python = ">=3.8,<3.10"
60+
version = "^1.16"
6161

6262
[[tool.poetry.dependencies.numpy]]
6363
python = "^3.10"
6464
version = "^1.21.2"
6565

6666
[[tool.poetry.dependencies.matplotlib]]
67-
python = ">=3.7,<3.11"
67+
python = ">=3.8,<3.11"
6868
version = ">=2"
6969

7070
[[tool.poetry.dependencies.matplotlib]]

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
max-line-length = 88
3-
ignore = E203, E231, E402, E501, F401, W503
3+
ignore = E203, E231, E402, E501, F401, W503, W604
44
exclude = docs

staircase/core/layering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _layer_scalar(self, start, end, value):
115115
if start in deltas.index:
116116
deltas.loc[start] += value
117117
else:
118-
deltas.loc[start] = value
118+
deltas.loc[start] = float(value)
119119
if deltas.loc[start] == 0:
120120
deltas.drop(start, inplace=True)
121121

staircase/core/ops/masking.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,15 @@ def _make_data_fillna_method(self, value):
173173
data = None
174174
else:
175175
values = self._get_values().copy()
176+
fillmethod = {
177+
"pad": pd.Series.ffill,
178+
"ffill": pd.Series.ffill,
179+
"backfill": pd.Series.bfill,
180+
"bfill": pd.Series.bfill,
181+
}[value]
176182
if value in ("pad", "ffill") and np.isnan(values.iloc[0]):
177183
values.iloc[0] = self.initial_value
178-
values = values.fillna(method=value)
184+
values = fillmethod(values)
179185
if value in ("backfill", "bfill") and np.isnan(self.initial_value):
180186
initial_value = values.iloc[0]
181187
data = pd.DataFrame({"value": values})

staircase/core/stairs.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
staircase is a MIT licensed library, written in pure-Python, for
77
modelling step functions. See :ref:`Getting Started <getting_started>` for more information.
88
"""
9+
910
from __future__ import annotations
1011

1112
import warnings
@@ -33,9 +34,11 @@
3334

3435
def _make_deltas_from_vals(init_val, vals: pd.DataFrame) -> pd.Series:
3536
if not np.isnan(vals).any():
36-
result = pd.Series(np.diff((np.append([init_val], vals.values))))
37+
result = pd.Series(
38+
np.diff((np.append([init_val], vals.values))), dtype="float64"
39+
)
3740
else:
38-
temp = pd.Series(np.append([init_val], vals.values))
41+
temp = pd.Series(np.append([init_val], vals.values), dtype="float64")
3942
result = pd.Series.add(
4043
temp[pd.notnull(temp)].diff(), temp[pd.isnull(temp)], fill_value=0
4144
)[1:]
@@ -570,7 +573,10 @@ def __bool__(self) -> bool:
570573
def describe(
571574
self,
572575
where: tuple[float | int, float | int]
573-
| list[float | int, float | int] = (-inf, inf),
576+
| list[float | int, float | int] = (
577+
-inf,
578+
inf,
579+
),
574580
percentiles: list[float | int] | tuple[float | int] = (25, 50, 75),
575581
) -> pd.Series:
576582
"""

staircase/util/_decorators.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
class Appender:
9-
109
"""
1110
A function decorator that will append an addendum to the docstring
1211
of the target function.

0 commit comments

Comments
 (0)