Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
46 changes: 22 additions & 24 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,36 @@ name: Python package

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
pip install numpy numba
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install torchlpc
- name: Lint with flake8
run: |
# 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: |
pytest
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install . --no-build-isolation
- name: Lint with flake8
run: |
# 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: |
pytest
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
*.pyc
build/
dist/
*.egg-info/
*.egg-info/
# pixi environments
.pixi/*
!.pixi/config.toml
3,895 changes: 3,895 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[workspace]
authors = ["Chin-Yun Yu <chin-yun.yu@qmul.ac.uk>"]
channels = ["conda-forge", "nvidia"]
platforms = ["linux-64"]

[tasks]

[dependencies]
numba = ">=0.63.1,<0.64"

[pypi-dependencies]
torchlpc = ">=0.7.2, <0.8"
torchcomp = {path = ".", editable = true}

[feature.dev.pypi-dependencies]
build = ">=1.4.0, <2"

[feature.test.dependencies]
pytest = ">=9.0.2,<10"

[feature.cpu.dependencies]
pytorch-cpu = ">=2.9.1,<3"

[feature.gpu.dependencies]
cuda-version = ">=12.9,<13"
pytorch-gpu = ">=2.9.1,<3"
numba-cuda = ">=0.23.0,<0.24"
cuda = { version = ">=12.9.1,<13", channel = "nvidia" }

[feature.gpu.system-requirements]
cuda = "13.0"

[feature.gpu.pypi-options]
no-build-isolation = true

[environments]
default = ["gpu"]
cpu = ["cpu"]
gpu-test = ["gpu", "test"]
cpu-test = ["cpu", "test"]
build = ["dev", "cpu"]
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[tool.setuptools.packages.find]
where = ["."]
exclude = ["tests", "tests.*"]

[project]
name = "torchcomp"
version = "0.2.1"
description = "Fast, efficient, and differentiable dynamic range compression/expansion/limiting for PyTorch."
readme = "README.md"
requires-python = ">=3.9"
authors = [
{name = "Chin-Yun Yu", email = "chin-yun.yu@qmul.ac.uk"},
]
maintainers = [
{name = "Chin-Yun Yu", email = "chin-yun.yu@qmul.ac.uk"},
]
license = "MIT"
license-files = ["LICENSE"]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
dependencies = [
"torch>=2",
"torchlpc",
"numpy",
"numba",
]

[project.urls]
Homepage = "https://github.com/DiffAPF/torchcomp"

28 changes: 0 additions & 28 deletions setup.py

This file was deleted.