-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
44 create and automate test suite (#46)
* Basic test and workflow. * Workflow installing pytest. * Wrong command. * Running linting first. * Proper unit test. * Fix test dependency. * Removed non-working spectrogram code. * Fixing version mechanism ---------
- Loading branch information
Showing
63 changed files
with
1,603 additions
and
10,687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip --upgrade-strategy eager | ||
pip install -r requirements.txt | ||
- name: Build package | ||
run: | | ||
python -m pip install . | ||
- name: Lint with flake8 | ||
run: | | ||
pip3 install flake8 | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pip install pytest | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ timm==0.5.4 | |
segmentation_models_pytorch | ||
pytorch_lightning | ||
sympy | ||
numba | ||
torchmetrics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import os | ||
import setuptools | ||
from distutils.core import setup | ||
import setuptools | ||
|
||
with open("README.md") as f: | ||
long_description = f.read() | ||
|
||
exec(open('torchsig/version.py').read()) | ||
|
||
setup( | ||
name='torchsig', | ||
version=__version__, | ||
description='Signal Processing Machine Learning Toolkit', | ||
name="torchsig", | ||
version="0.1.0", | ||
description="Signal Processing Machine Learning Toolkit", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author='TorchSig Team', | ||
url='https://github.com/torchdsp/torchsig', | ||
author="TorchSig Team", | ||
url="https://github.com/torchdsp/torchsig", | ||
packages=setuptools.find_packages(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from torchsig.datasets.sig53 import Sig53 | ||
from unittest import TestCase | ||
|
||
|
||
class GenerateSig53(TestCase): | ||
def test_can_generate_sig53_clean_train(self): | ||
x = 2 + 2 | ||
self.assertEqual(x, 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
from . import iq_models | ||
from . import spectrogram_models | ||
from torchsig.models.iq_models import * | ||
from torchsig.models.spectrogram_models import * |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.