Skip to content

Commit

Permalink
Add pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Aug 22, 2024
1 parent 04e2275 commit fe4ff63
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Build and install
run: pip install --verbose -r requirements.txt
run: pip install --verbose .[test]

- name: Test
run: pytest --cov=python --cov-branch src/python/test
run: pytest --cov=pffdtd --cov-branch

# - name: Upload coverage report
# uses: codecov/codecov-action@v4
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: detect-private-key
- id: requirements-txt-fixer
- id: check-case-conflict
# - id: check-added-large-files
58 changes: 58 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "pffdtd"
version = "0.1.0"
description = "Pretty Fast FDTD"
readme = "README.md"
license = { file = "LICENSE.txt" }
authors = [{ name = "Tobias Hienzsch", email = "post@tobias-hienzsch.de" }]
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

dependencies = [
"h5py>=3.2.1",
"matplotlib>=3.4.1",
"mayavi>=4.7.2",
"memory_profiler>=0.58.0",
"numba>=0.53.0",
"numpy>=1.20.1",
"opencv-python>=4.10.0",
"optuna>=3.6.1",
"pandas>=2.2.2",
"plotly>=5.22.0",
"polyscope>=0.1.6",
"psutil>=5.8.0",
"resampy>=0.2.2",
"scipy>=1.7.0",
"tqdm>=4.58.0",
"vtk>=9.0.1",
]

[project.urls]
Homepage = "https://github.com/tobanteAudio/pffdtd"
Issues = "https://github.com/tobanteAudio/pffdtd/issues"

[project.optional-dependencies]
dev = ["conan>=2.6.0", "pre-commit>=3.8.0", "pylint>=3.2.6"]
test = ["pytest>=8.3.2", "pytest-cov>=5.0.0"]

[project.scripts]
pffdtd = "pffdtd.cli:main"

[tool.setuptools.packages.find]
where = ["src/python"]

[tool.pytest.ini_options]
minversion = "7.0"
addopts = ["-ra", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = ["error"]
testpaths = ["src/python/test/*"]
File renamed without changes.
2 changes: 2 additions & 0 deletions src/python/pffdtd/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("pffdtd")
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cv2
import numpy as np

from diffusor.qrd import quadratic_residue_diffuser
from pffdtd.diffusor.qrd import quadratic_residue_diffuser

# fmax calculation matches multiple online calculators. Not sure about fmin

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/python/sim2d/fdtd.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import numba as nb
from tqdm import tqdm

from diffusor.design import diffusor_bandwidth
from diffusor.qrd import quadratic_residue_diffuser
from diffusor.prd import primitive_root_diffuser
from pffdtd.diffusor.design import diffusor_bandwidth
from pffdtd.diffusor.qrd import quadratic_residue_diffuser
from pffdtd.diffusor.prd import primitive_root_diffuser


def to_ixy(x, y, Nx, Ny, order="row"):
Expand Down
2 changes: 1 addition & 1 deletion src/python/sim2d/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np
import scipy.signal as signal

from diffusor.measurement import polar_response
from pffdtd.diffusor.measurement import polar_response


def main():
Expand Down
2 changes: 1 addition & 1 deletion src/python/test/test_diffusor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from ..diffusor.qrd import quadratic_residue_diffuser
from pffdtd.diffusor.qrd import quadratic_residue_diffuser


def test_quadratic_residue_diffuser():
Expand Down

0 comments on commit fe4ff63

Please sign in to comment.