Skip to content

Commit 53af0f2

Browse files
authored
Merge pull request #77 from cokelaer/add_python39
Fixing deprecated function of Scipy.
2 parents 636b74a + 524b8b2 commit 53af0f2

File tree

9 files changed

+58
-37
lines changed

9 files changed

+58
-37
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
strategy:
1414
max-parallel: 5
1515
matrix:
16-
python: [3.6, 3.7, 3.8]
16+
python: [3.7, 3.8,3.9]
17+
fail-fast: false
1718

1819
steps:
1920
- uses: actions/checkout@v2
@@ -23,17 +24,12 @@ jobs:
2324
python-version: ${{ matrix.python }}
2425
- name: Install the package itself
2526
run: |
26-
pip install .
27-
27+
pip install .[testing]
2828
- name: Test with pytest
2929
run: |
30-
pip install easydev
31-
pip install pytest
32-
pip install pytest-cov
33-
pip install coverage
3430
pytest --cov-report term --cov=spectrum
3531
36-
- name: coveralls
32+
- name: coveralls
3733
run: |
3834
pip install coveralls
3935
coveralls --service=github

README.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ Contributions
7070

7171
Please see `github <http://github.com/cokelaer/spectrum>`_ for any issues/bugs/comments/contributions.
7272

73+
Changelog (summary)
74+
===================
75+
76+
========== ==========================================================
77+
release description
78+
========== ==========================================================
79+
0.8.1 * move CI to github actions
80+
* include python 3.9 support
81+
* include PR from tikuma-lshhsc contributor to speedup
82+
eigenfre module
83+
* fix deprecated warnings
84+
========== ==========================================================
85+
86+
7387

7488
Some notebooks (external contributions)
7589
-------------------------------------------

doc/ChangeLog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ ChangeLog Summary
44
Version 0.8 (2020)
55
------------------
66

7+
* 0.8.1: Jul 2021
8+
9+
* move CI to github actions
10+
* include PR from tikuma-lshhsc contributor to speedup eigenfre module
11+
* fix deprecated warnings
12+
713
* 0.8.0: Nov 2020
814

915
* Fixed documentation related to https://github.com/cokelaer/spectrum/issues/57

requirements-dev.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
easydev
12
numpy
23
scipy
34
matplotlib

setup.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ upload_dir=doc/build/html/
66
[upload_sphinx]
77
upload-dir = doc/build/html
88

9-
[aliases]
10-
test=pytest
119

12-
[tool:pytest]
10+
11+
12+
#[tool:pytest]
1313
# do not use --cov because it interfers with travis command
14-
addopts= --durations=10 --verbose --cov spectrum --cov-report term-missing
14+
#addopts= --durations=10 --verbose --cov spectrum --cov-report term-missing
1515

setup.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
_MAJOR = 0
99
_MINOR = 8
10-
_MICRO = 0
10+
_MICRO = 1
1111
version = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
1212
release = '%d.%d' % (_MAJOR, _MINOR)
1313

@@ -35,10 +35,23 @@
3535
# Dependencies
3636
install_requires=open("requirements.txt").read(),
3737
extras_require={
38-
'plot': ['matplotlib']
38+
'plot': ['matplotlib'],
39+
"testing": [
40+
"pytest",
41+
"pytest-cov",
42+
"pytest-xdist",
43+
"pytest-mock",
44+
"pytest-timeout",
45+
"pytest-runner",
46+
"coveralls",
47+
],
48+
"doc": [
49+
'sphinx',
50+
'sphinx_rtd_theme'
51+
]
52+
3953
},
40-
# specific packages for testing
41-
tests_require = open('requirements-dev.txt').read().split(),
54+
4255

4356
package_data = {
4457
'spectrum.data' : ['*'],

src/spectrum/mtm.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,11 @@ def dpss(N, NW=None, k=None):
324324
if k is None:
325325
k = min(round(2*NW),N)
326326
k = int(max(k,1))
327-
from numpy import dot, zeros, arange, sqrt
328327
mtspeclib.multitap.restype = None
329328

330-
lam = zeros(k, dtype=float)
331-
tapers = zeros(k*N, dtype=float)
332-
tapsum = zeros(k, dtype=float)
329+
lam = np.zeros(k, dtype=float)
330+
tapers = np.zeros(k*N, dtype=float)
331+
tapsum = np.zeros(k, dtype=float)
333332

334333
res = mtspeclib.multitap(
335334
c_int(N),
@@ -341,7 +340,7 @@ def dpss(N, NW=None, k=None):
341340
)
342341

343342
# normalisation by sqtr(N). It is required to have normalised windows
344-
tapers = tapers.reshape(k,N).transpose() / sqrt(N)
343+
tapers = tapers.reshape(k,N).transpose() / np.sqrt(N)
345344

346345
for i in range(k):
347346
# By convention (Percival and Walden, 1993 pg 379)
@@ -362,11 +361,11 @@ def dpss(N, NW=None, k=None):
362361

363362
# The values returned in lam are not exacly the same as in the following methods.
364363
acvs = _autocov(tapers.transpose(), debias=False) * N
365-
nidx = arange(N)
364+
nidx = np.arange(N)
366365
W = float(NW)/N
367366
r = 4*W*np.sinc(2*W*nidx)
368367
r[0] = 2*W
369-
eigvals = dot(acvs, r)
368+
eigvals = np.dot(acvs, r)
370369

371370
#return (tapers, lam)
372371
return [tapers, eigvals]
@@ -540,8 +539,13 @@ def _fftconvolve(in1, in2, mode="full", axis=None):
540539
"""
541540
#Locally import stuff only required for this:
542541
from scipy.fftpack import fftn, fft, ifftn, ifft
543-
from scipy.signal.signaltools import _centered
544542
from numpy import array, product
543+
try:
544+
from scipy.signal._signaltools import _centered
545+
except ModuleNotFoundError:
546+
from scipy.signal.signaltools import _centered
547+
548+
545549

546550

547551
s1 = array(in1.shape)

test/pytest.ini

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)