Skip to content

Commit 6db5ef6

Browse files
authored
Update requirements.txt (#22)
* Upgrade deps * bump version
1 parent 17c12b9 commit 6db5ef6

6 files changed

Lines changed: 22 additions & 19 deletions

File tree

.github/workflows/pythonpackage.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on: [push]
44

55
jobs:
66
checks:
7-
# fail-fast: false
87
runs-on: ${{ matrix.os }}
98
strategy:
9+
# fail-fast: false
1010
max-parallel: 4
1111
matrix:
1212
os: [ubuntu-latest]
13-
python-version: [3.7, 3.8, 3.9, 3.10.5]
13+
python-version: [3.8, 3.9, '3.10', 3.11]
1414

1515
steps:
1616
- uses: actions/checkout@master
@@ -20,9 +20,9 @@ jobs:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install dependencies
2222
run: |
23-
python -m pip install --upgrade pip
24-
pip install -e .[dev]
25-
pip install coveralls
23+
python -m pip install --upgrade 'pip<23.0.0' 'setuptools<63.0.0'
24+
pip3 install -e .[dev]
25+
pip3 install coveralls
2626
- name: Code flake8 check
2727
run: |
2828
flake8

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.8
1+
0.9.9

numpy_ext.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def apply_map(func: Callable[[Any], Any], array: Union[List, np.ndarray]) -> np.
161161
#############################
162162

163163

164-
def nans(shape: Union[int, Tuple[int, ...]], dtype=np.float64) -> np.ndarray:
164+
def nans(shape: Union[int, Tuple[int, ...]], dtype=float) -> np.ndarray:
165165
"""
166166
Return a new array of a given shape and type, filled with np.nan values.
167167
@@ -187,9 +187,12 @@ def nans(shape: Union[int, Tuple[int, ...]], dtype=np.float64) -> np.ndarray:
187187
array(['NaT', 'NaT'], dtype=datetime64)
188188
"""
189189
if np.issubdtype(dtype, np.integer):
190-
dtype = np.float
190+
dtype = float
191191
arr = np.empty(shape, dtype=dtype)
192-
arr.fill(np.nan)
192+
if np.issubdtype(arr.dtype, np.datetime64):
193+
arr.fill(np.datetime64('NaT'))
194+
else:
195+
arr.fill(np.nan)
193196
return arr
194197

195198

@@ -292,7 +295,7 @@ def prepend_na(array: np.ndarray, n: int) -> np.ndarray:
292295
return np.hstack((nans(n), array))
293296

294297
elem = array[0]
295-
dtype = np.float64
298+
dtype = float
296299
if hasattr(elem, 'dtype'):
297300
dtype = elem.dtype
298301

@@ -494,7 +497,7 @@ def rows_gen():
494497

495498
yield from (array[:i] for i in np.arange(min_periods, array.size + 1))
496499

497-
return np.array([row for row in rows_gen()]) if as_array else rows_gen()
500+
return np.array([row for row in rows_gen()], dtype=object) if as_array else rows_gen()
498501

499502

500503
def expanding_apply(
@@ -553,7 +556,7 @@ def expanding_apply(
553556
raise ValueError('Arrays must be the same length')
554557

555558
def _apply_func_to_arrays(idxs):
556-
return func(*[array[idxs.astype(np.int)] for array in arrays], **kwargs)
559+
return func(*[array[idxs.astype(int)] for array in arrays], **kwargs)
557560

558561
array = arrays[0]
559562
rolls = expanding(

requirements.dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
flake8~=3.7.9
2-
pytest>=4.3.0,<=7.12
3-
pytest-cov>=2.8.1,<=3.0.0
4-
pandas>=1.3.0,<1.5.0
2+
pytest>=4.3.0,<8.0.0
3+
pytest-cov>=2.8.1,<5.0.0
4+
pandas>=1.3.0,<3.0.0
55
numpydoc~=0.9.2
66
sphinx~=2.4.4
77
Jinja2<3.1

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
numpy>=1.20.1,<=1.23.1
2-
joblib>=1.0.1,<1.1.0
1+
numpy>=1.20.1,<1.30.0
2+
joblib>=1.0.1,<1.4.0

test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def test_rolling_apply_wrong_window_type(window, apply):
273273

274274

275275
@pytest.mark.parametrize(
276-
'dtype', [np.float64, np.datetime64, np.int64]
276+
'dtype', [float, np.datetime64, int]
277277
)
278278
def test_nans_array(dtype):
279279
arr = npext.nans(5, dtype)
@@ -289,7 +289,7 @@ def test_nans_array(dtype):
289289
np.array([-1.0, -2.0, -3.5, -5.75, -9.125, -14.1875, -21.78125, -33.171875, -50.2578125, -75.88671875])
290290
),
291291
(
292-
dict(start=1, end=100, min_step=1, step_mult=1.5, round_func=lambda a: a.astype(np.int)),
292+
dict(start=1, end=100, min_step=1, step_mult=1.5, round_func=lambda a: a.astype(int)),
293293
np.array([1, 2, 3, 5, 9, 14, 21, 33, 50, 75])
294294
),
295295
(

0 commit comments

Comments
 (0)