Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize Python compatibilities and bump lspopt version #9

Closed
wants to merge 34 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
73bd42b
Prepared for PyPI release
hbldh Jun 19, 2019
5362fdc
Fix for axure-pipelines.yml
hbldh Jun 19, 2019
5407ff3
Version 1.1.0 - Fixes #1
hbldh Jun 19, 2019
27b3300
Fix for incorrect trove classifier.
hbldh Jun 19, 2019
6ba11aa
Create Dependabot config file
dependabot-preview[bot] Sep 25, 2020
99e665f
Merge pull request #3 from hbldh/dependabot/add-v2-config-file
hbldh Sep 25, 2020
0bc758d
Github Actions for lspopt
hbldh Sep 28, 2020
0795d2a
CHANGELOG and version bump
hbldh Sep 28, 2020
473d28f
Add changelog to sdist
hoechenberger Jun 7, 2022
4e20b79
Merge pull request #5 from hoechenberger/patch-1
hbldh Jun 8, 2022
46401bf
Version 1.2.0 - Source Dist fix
hbldh Jun 8, 2022
8040b4e
CI Test modification
hbldh Jun 8, 2022
3de36be
CI Test modification
hbldh Jun 8, 2022
e27d570
Update README.md
hbldh Jun 8, 2022
c03e5be
Update README.md
hbldh Jun 8, 2022
73be156
Updated link to paper
hbldh Jun 8, 2022
0b1f4fe
Delete dependabot.yml
hbldh Jan 24, 2023
57662af
Update build_and_test.yml
hbldh Jan 24, 2023
4303dac
Version 1.3.0
hbldh Jan 24, 2023
6867aa9
Update CHANGELOG.md
hbldh Jan 24, 2023
c13df6e
replace pkg_resources with importlib.resources
remrama Dec 29, 2024
255c200
Merge pull request #8 from remrama/pkg_to_importlib
hbldh Dec 29, 2024
9218aa1
fix README typo
remrama Jan 7, 2025
667c6dd
ignore local python environments
remrama Jan 7, 2025
4495181
workflow tests python 3.8-3.12
remrama Jan 7, 2025
a34d8ba
add .toml file
remrama Jan 7, 2025
23a7c98
update python versions in setup.py
remrama Jan 7, 2025
e6fde75
remove __future__ and unused imports
remrama Jan 7, 2025
b20e86b
bump version and update changelog
remrama Jan 7, 2025
5109ada
float --> str python versions
remrama Jan 7, 2025
158ce0d
bump all gh-action versions
remrama Jan 7, 2025
22c847e
add windows and macos tests
remrama Jan 7, 2025
abb4464
update changelog
remrama Jan 7, 2025
04cf84c
bump gh-action versions in pypi workflow
remrama Jan 7, 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
Prev Previous commit
Next Next commit
Version 1.3.0
Dropped Pyton 2.7 and 3.6
Increased reqs for numpy and scipy due to vulns
Removed dependency on six
hbldh authored Jan 24, 2023
commit 4303dac2f3cd32c2216e83f8549513cbb0336a85
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [2.7, 3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
4 changes: 2 additions & 2 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.0] - 2023-01-24

### Changed

- Modified test matrix in CI

### Removed

- Support for Python 2.7 and 3.6.
- Dependency on `six`.


## [1.2.0] - 2022-06-08

### Added
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# LSPOpt

![Build and Test](https://github.com/hbldh/lspopt/workflows/Build%20and%20Test/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/hbldh/lspopt/badge.svg?branch=master)](https://coveralls.io/github/hbldh/lspopt?branch=master)
[![PyPI version](https://img.shields.io/pypi/v/lspopt.svg)](https://pypi.org/project/lspopt/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

@@ -32,10 +31,9 @@ If you prefer to use `conda`, see [instructions in this repo](https://github.com

Test with `pytest`:

pytest tests/
pytest tests/

Tests are run at every commit to GitHub and the results of this, as well as test
coverage, can be studied at [Azure Pipelines](https://dev.azure.com/hbldh/github/_build/latest?definitionId=7&branchName=master).
See test badge at the top of this README for link to test coverage and reports.

## Usage

6 changes: 0 additions & 6 deletions lspopt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import


from lspopt.lsp import lspopt, spectrogram_lspopt
from lspopt.__version__ import __version__, version

2 changes: 1 addition & 1 deletion lspopt/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

version = "1.2.0"
version = "1.3.0"
__version__ = version
5 changes: 0 additions & 5 deletions lspopt/data/__init__.py
Original file line number Diff line number Diff line change
@@ -8,11 +8,6 @@

"""

from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import

from pkg_resources import resource_filename

import numpy as np
8 changes: 1 addition & 7 deletions lspopt/lsp.py
Original file line number Diff line number Diff line change
@@ -14,12 +14,6 @@

"""

from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import

import six
import numpy as np
from scipy.signal import spectrogram

@@ -60,7 +54,7 @@ def lspopt(n, c_parameter=20.0):

t1 = np.arange(-(n / 2) + 1, (n / 2) + 0.1, step=1.0) / f_h(n, K)
h = np.vstack((np.ones((n,)), 2 * t1))
for i in six.moves.range(1, K - 1):
for i in range(1, K - 1):
h = np.vstack((h, (2 * t1 * h.T[:, i]) - 2 * i * h.T[:, i - 1]))

H = h.T * np.outer(np.exp(-(t1 ** 2) / 2), np.ones((K,), "float"))
5 changes: 0 additions & 5 deletions lspopt/utils.py
Original file line number Diff line number Diff line change
@@ -14,11 +14,6 @@

"""

from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import

import numpy as np
from scipy.linalg import sqrtm

5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
numpy>=1.7.0
scipy>=0.16.1
six>=1.10.0
numpy>=1.21.6
scipy>=1.7.3
15 changes: 7 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -22,13 +22,12 @@
URL = 'https://github.com/hbldh/lspopt'
EMAIL = '[email protected]'
AUTHOR = 'Henrik Blidh'
REQUIRES_PYTHON = '>=2.7.10'
REQUIRES_PYTHON = '>=3.7'
VERSION = None

REQUIRED = [
'numpy',
'scipy',
'six'
'numpy>=1.21.6',
'scipy>=1.7.3',
]

here = os.path.abspath(os.path.dirname(__file__))
@@ -114,12 +113,12 @@ def run(self):
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy'
],
8 changes: 1 addition & 7 deletions tests/lspopt_ref.py
Original file line number Diff line number Diff line change
@@ -14,12 +14,6 @@

"""

from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import

import six
import numpy as np

from lspopt.data import C, WEIGHTS
@@ -73,7 +67,7 @@ def lspopt_ref(n, c_parameter=20.0):
h = np.vstack((h, (2 * t1 * h.T[:, i]) - 2 * i * h.T[:, i - 1]))
H = h.T * np.outer(np.exp(-(t1 ** 2) / 2), np.ones((K,), "float"))

for i in six.moves.range(K):
for i in range(K):
H[:, i] = H[:, i] / np.sqrt(H[:, i].T.dot(H[:, i])) # Norm

return H.T, wei
3 changes: 1 addition & 2 deletions tests/test_implementation.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@
import unittest

import pytest
import six
import numpy as np
from numpy.testing import assert_allclose
from scipy.signal import chirp, spectrogram
@@ -31,7 +30,7 @@
from .lspopt_ref import lspopt_ref


@pytest.mark.parametrize("n", six.moves.range(64, 1024))
@pytest.mark.parametrize("n", range(64, 1024))
def test_different_n(n):
"""Test against reference implementation for different N."""
h1, w1 = lspopt(n)
1 change: 0 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
from __future__ import absolute_import

import pytest
import six
import numpy as np
from numpy.testing import assert_allclose