Skip to content

Commit

Permalink
Merge pull request #65 from v0lta/update_tests
Browse files Browse the repository at this point in the history
test update.
  • Loading branch information
v0lta authored Aug 8, 2023
2 parents 818dc75 + 991902a commit 71b6ccc
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 10 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on: [ push, pull_request ]

jobs:
tests:
name: Tests
name: tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.8, 3.11 ]
python-version: [3.9, 3.11]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -20,13 +20,13 @@ jobs:
run: pip install nox
- name: Test with pytest
run:
nox -s fast-test
nox -s test
lint:
name: Lint
name: lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8, 3.11 ]
python-version: [3.9, 3.11]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -37,5 +37,35 @@ jobs:
run: pip install nox
- name: Run flake8
run: nox -s lint
typing:
name: typing
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, 3.11]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install nox
- name: Run mypy
run: nox -s typing
package-check:
name: pyroma
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install nox
- name: Run pyroma
run: nox -s check-package
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
:width: 32
:target: https://pypi.org/project/ptwt/

********************************
******************************************
|favicon| Pytorch Wavelet Toolbox (`ptwt`)
********************************
******************************************

.. image:: https://github.com/v0lta/PyTorch-Wavelet-Toolbox/actions/workflows/tests.yml/badge.svg
:target: https://github.com/v0lta/PyTorch-Wavelet-Toolbox/actions/workflows/tests.yml
Expand Down
7 changes: 7 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,10 @@ def finish(session):
session.run("git", "push", external=True)
session.run("bumpversion", "patch", external=True)
session.run("git", "push", external=True)


@nox.session(name="check-package")
def pyroma(session):
"""Run pyroma to check if the package is ok."""
session.install("pyroma")
session.run("pyroma", ".")
12 changes: 11 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ project_urls =
Bug Tracker = https://github.com/v0lta/PyTorch-Wavelet-Toolbox/issues
Source Code = https://github.com/v0lta/PyTorch-Wavelet-Toolbox


keywords =
Wavelets
Wavelet Transform
Fast Wavelet Transform
Boundary Wavelets
PyTorch

# Author information
author = Moritz Wolter and Felix Blanke
author_email = moritz@wolter.tech
Expand All @@ -32,7 +40,7 @@ classifiers =
Intended Audience :: Science/Research
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3 :: Only
Topic :: Scientific/Engineering :: Artificial Intelligence
Expand All @@ -48,6 +56,8 @@ install_requires =
pytest
nox

python_requires = >=3.9

packages = find:
package_dir =
= src
Expand Down
4 changes: 2 additions & 2 deletions tests/test_convolution_fwt_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def _cat_batch_list(batch_lists: List) -> List:
cat_list = batch_list
else:
for pos, (cat_el, batch_el) in enumerate(zip(cat_list, batch_list)):
if type(cat_el) is np.ndarray:
if isinstance(cat_el, np.ndarray):
cat_list[pos] = np.concatenate([cat_el, batch_el])
elif type(cat_el) is dict:
elif isinstance(cat_el, dict):
for key, tensor in cat_el.items():
cat_el[key] = np.concatenate([tensor, batch_el[key]])
else:
Expand Down

0 comments on commit 71b6ccc

Please sign in to comment.