waveport 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. waveport-0.1.0/.github/workflows/docs.yml +60 -0
  2. waveport-0.1.0/.github/workflows/tests.yml +41 -0
  3. waveport-0.1.0/.github/workflows/wheels.yml +99 -0
  4. waveport-0.1.0/.gitignore +13 -0
  5. waveport-0.1.0/.pre-commit-config.yaml +24 -0
  6. waveport-0.1.0/CMakeLists.txt +29 -0
  7. waveport-0.1.0/LICENSE.txt +674 -0
  8. waveport-0.1.0/PKG-INFO +72 -0
  9. waveport-0.1.0/README.md +46 -0
  10. waveport-0.1.0/cmake/CPM.cmake +28 -0
  11. waveport-0.1.0/docs/Makefile +14 -0
  12. waveport-0.1.0/docs/conf.py +59 -0
  13. waveport-0.1.0/docs/contributing.rst +86 -0
  14. waveport-0.1.0/docs/explanation/index.rst +18 -0
  15. waveport-0.1.0/docs/how-to/index.rst +42 -0
  16. waveport-0.1.0/docs/index.rst +31 -0
  17. waveport-0.1.0/docs/installation.rst +23 -0
  18. waveport-0.1.0/docs/make.bat +13 -0
  19. waveport-0.1.0/docs/reference/cuts.rst +33 -0
  20. waveport-0.1.0/docs/reference/grids.rst +33 -0
  21. waveport-0.1.0/docs/reference/index.rst +25 -0
  22. waveport-0.1.0/docs/reference/swe.rst +18 -0
  23. waveport-0.1.0/docs/tutorials/index.rst +24 -0
  24. waveport-0.1.0/logo/waveport-logo.png +0 -0
  25. waveport-0.1.0/logo/waveport-logo.svg +46 -0
  26. waveport-0.1.0/logo/waveport-logo.txt +16 -0
  27. waveport-0.1.0/pyproject.toml +59 -0
  28. waveport-0.1.0/ruff.toml +2 -0
  29. waveport-0.1.0/src/component_type.hpp +43 -0
  30. waveport-0.1.0/src/cuts.cpp +80 -0
  31. waveport-0.1.0/src/cuts.hpp +171 -0
  32. waveport-0.1.0/src/grids.cpp +362 -0
  33. waveport-0.1.0/src/grids.hpp +185 -0
  34. waveport-0.1.0/src/main.cpp +266 -0
  35. waveport-0.1.0/src/parse_numbers.hpp +109 -0
  36. waveport-0.1.0/src/range.hpp +45 -0
  37. waveport-0.1.0/src/swe.cpp +180 -0
  38. waveport-0.1.0/src/swe.hpp +146 -0
  39. waveport-0.1.0/src/text_cursor.cpp +116 -0
  40. waveport-0.1.0/src/text_cursor.hpp +65 -0
  41. waveport-0.1.0/src/waveport/__init__.py +79 -0
  42. waveport-0.1.0/src/waveport/_core.pyi +123 -0
  43. waveport-0.1.0/src/waveport/common.py +52 -0
  44. waveport-0.1.0/src/waveport/cuts.py +121 -0
  45. waveport-0.1.0/src/waveport/data/cylindrical.grd +447 -0
  46. waveport-0.1.0/src/waveport/data/cylindrical_axial.cut +40 -0
  47. waveport-0.1.0/src/waveport/data/cylindrical_circular.cut +36 -0
  48. waveport-0.1.0/src/waveport/data/hertzian_e_dipole_x.sph.gz +0 -0
  49. waveport-0.1.0/src/waveport/data/hertzian_e_dipole_y.sph.gz +0 -0
  50. waveport-0.1.0/src/waveport/data/hertzian_e_dipole_z.sph.gz +0 -0
  51. waveport-0.1.0/src/waveport/data/hertzian_h_dipole_x.sph.gz +0 -0
  52. waveport-0.1.0/src/waveport/data/hertzian_h_dipole_y.sph.gz +0 -0
  53. waveport-0.1.0/src/waveport/data/hertzian_h_dipole_z.sph.gz +0 -0
  54. waveport-0.1.0/src/waveport/data/multifrequency_swe.sph.gz +0 -0
  55. waveport-0.1.0/src/waveport/data/planar_circular.cut +36 -0
  56. waveport-0.1.0/src/waveport/data/planar_radial.cut +40 -0
  57. waveport-0.1.0/src/waveport/data/planar_rho_phi.grd +324 -0
  58. waveport-0.1.0/src/waveport/data/planar_xy.grd +447 -0
  59. waveport-0.1.0/src/waveport/data/spherical_az_over_el.grd +448 -0
  60. waveport-0.1.0/src/waveport/data/spherical_az_over_el_edx.grd +447 -0
  61. waveport-0.1.0/src/waveport/data/spherical_conical.cut +36 -0
  62. waveport-0.1.0/src/waveport/data/spherical_el_and_az.grd +448 -0
  63. waveport-0.1.0/src/waveport/data/spherical_el_over_az.grd +448 -0
  64. waveport-0.1.0/src/waveport/data/spherical_el_over_az_edx.grd +447 -0
  65. waveport-0.1.0/src/waveport/data/spherical_polar.cut +40 -0
  66. waveport-0.1.0/src/waveport/data/spherical_theta_phi.grd +447 -0
  67. waveport-0.1.0/src/waveport/data/spherical_uv.grd +447 -0
  68. waveport-0.1.0/src/waveport/data/surface.grd +443 -0
  69. waveport-0.1.0/src/waveport/data/surface_circular.cut +36 -0
  70. waveport-0.1.0/src/waveport/data/surface_radial.cut +40 -0
  71. waveport-0.1.0/src/waveport/example_files.py +44 -0
  72. waveport-0.1.0/src/waveport/grids.py +81 -0
  73. waveport-0.1.0/src/waveport/py.typed +0 -0
  74. waveport-0.1.0/src/waveport/swe.py +107 -0
  75. waveport-0.1.0/tests/test_cuts.py +385 -0
  76. waveport-0.1.0/tests/test_grids.py +291 -0
  77. waveport-0.1.0/tests/test_swe.py +100 -0
  78. waveport-0.1.0/uv.lock +856 -0
@@ -0,0 +1,60 @@
1
+ name: Documentation
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ name: Build Sphinx documentation
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v6
18
+ with:
19
+ persist-credentials: false
20
+
21
+ - name: Set up uv and Python
22
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
23
+ with:
24
+ version: "0.13.6"
25
+ python-version: "3.13"
26
+ enable-cache: true
27
+
28
+ - name: Build the package and install documentation dependencies
29
+ run: uv sync --locked --no-dev --group docs
30
+
31
+ - name: Build HTML with warnings treated as errors
32
+ run: uv run --no-sync sphinx-build -M html docs docs/_build -W --keep-going
33
+
34
+ - name: Upload GitHub Pages artifact
35
+ if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
36
+ uses: actions/upload-pages-artifact@v4
37
+ with:
38
+ path: docs/_build/html
39
+
40
+ deploy:
41
+ name: Deploy to GitHub Pages
42
+ if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
43
+ needs: build
44
+ runs-on: ubuntu-latest
45
+ permissions:
46
+ pages: write
47
+ id-token: write
48
+ environment:
49
+ name: github-pages
50
+ url: ${{ steps.deployment.outputs.page_url }}
51
+ concurrency:
52
+ group: github-pages
53
+ cancel-in-progress: false
54
+ steps:
55
+ - name: Configure GitHub Pages
56
+ uses: actions/configure-pages@v5
57
+
58
+ - name: Deploy documentation
59
+ id: deployment
60
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,41 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ pytest:
13
+ name: Python ${{ matrix.python-version }}
14
+ runs-on: ubuntu-latest
15
+ # Python 3.15 is still a pre-release: report its failures without failing the workflow
16
+ continue-on-error: ${{ matrix.python-version == '3.15' }}
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
21
+
22
+ steps:
23
+ - uses: actions/checkout@v6
24
+ with:
25
+ persist-credentials: false
26
+
27
+ - name: Set up uv and Python
28
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
29
+ with:
30
+ version: "0.13.6"
31
+ python-version: ${{ matrix.python-version }}
32
+ enable-cache: true
33
+
34
+ - name: Check formatting
35
+ run: uv run ruff format --check .
36
+
37
+ - name: Lint the code
38
+ run: uv run ruff check .
39
+
40
+ - name: Run tests
41
+ run: uv run pytest
@@ -0,0 +1,99 @@
1
+ name: Build wheels
2
+
3
+ on:
4
+ # Build wheels and publish them on PyPI when a release is tagged (e.g., `v1.2.3`)…
5
+ push:
6
+ tags:
7
+ - "v*"
8
+ # …or build them (without publishing) when triggered manually, e.g., to check
9
+ # wheels before tagging.
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ wheels:
17
+ name: Wheels on ${{ matrix.os }}
18
+ runs-on: ${{ matrix.os }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ os: [ubuntu-latest, windows-latest, macos-15-intel, macos-15]
23
+
24
+ steps:
25
+ - uses: actions/checkout@v6
26
+ with:
27
+ persist-credentials: false
28
+
29
+ - name: Build and test wheels
30
+ uses: pypa/cibuildwheel@v4.3.5
31
+ env:
32
+ CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-* cp315-*"
33
+ CIBW_ARCHS: native
34
+ CIBW_TEST_REQUIRES: pytest
35
+ CIBW_TEST_COMMAND: "python -m pytest {project}/tests"
36
+ MACOSX_DEPLOYMENT_TARGET: "13.3"
37
+
38
+ - name: Upload wheels
39
+ uses: actions/upload-artifact@v7
40
+ with:
41
+ name: wheels-${{ matrix.os }}
42
+ path: wheelhouse/*.whl
43
+ if-no-files-found: error
44
+
45
+ sdist:
46
+ name: Source distribution
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@v6
50
+ with:
51
+ persist-credentials: false
52
+
53
+ - name: Set up uv and Python
54
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
55
+ with:
56
+ version: "0.13.6"
57
+ python-version: "3.13"
58
+
59
+ - name: Check that the tag matches the version in pyproject.toml
60
+ if: startsWith(github.ref, 'refs/tags/v')
61
+ env:
62
+ TAG: ${{ github.ref_name }}
63
+ run: |
64
+ VERSION=$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
65
+ if [ "v$VERSION" != "$TAG" ]; then
66
+ echo "::error::Tag $TAG does not match version $VERSION in pyproject.toml"
67
+ exit 1
68
+ fi
69
+
70
+ - name: Build the source distribution
71
+ run: uv build --sdist
72
+
73
+ - name: Upload the source distribution
74
+ uses: actions/upload-artifact@v7
75
+ with:
76
+ name: sdist
77
+ path: dist/*.tar.gz
78
+ if-no-files-found: error
79
+
80
+ publish:
81
+ name: Publish on PyPI
82
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
83
+ needs: [wheels, sdist]
84
+ runs-on: ubuntu-latest
85
+ environment:
86
+ name: pypi
87
+ url: https://pypi.org/project/waveport/
88
+ permissions:
89
+ # Required by PyPI's Trusted Publishing (no API token needed)
90
+ id-token: write
91
+ steps:
92
+ - name: Download wheels and source distribution
93
+ uses: actions/download-artifact@v7
94
+ with:
95
+ path: dist
96
+ merge-multiple: true
97
+
98
+ - name: Publish on PyPI
99
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,13 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # Sphinx output
13
+ docs/_build/
@@ -0,0 +1,24 @@
1
+ default_install_hook_types: [pre-commit]
2
+ default_stages: [pre-commit]
3
+
4
+ repos:
5
+ - repo: local
6
+ hooks:
7
+ - id: ruff-format
8
+ name: Check formatting
9
+ entry: uv run --frozen ruff format --check .
10
+ language: system
11
+ pass_filenames: false
12
+ always_run: true
13
+ - id: ruff-check
14
+ name: Lint Python code
15
+ entry: uv run --frozen ruff check .
16
+ language: system
17
+ pass_filenames: false
18
+ always_run: true
19
+ - id: ty-check
20
+ name: Check Python types
21
+ entry: uv run --frozen ty check .
22
+ language: system
23
+ pass_filenames: false
24
+ always_run: true
@@ -0,0 +1,29 @@
1
+ cmake_minimum_required(VERSION 3.15...4.0)
2
+
3
+ if(CMAKE_HOST_APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
4
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "13.3" CACHE STRING
5
+ "Minimum macOS deployment version" FORCE)
6
+ endif()
7
+
8
+ project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)
9
+
10
+ find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
11
+ find_package(nanobind CONFIG REQUIRED)
12
+ nanobind_add_module(_core
13
+ src/main.cpp
14
+ src/cuts.cpp
15
+ src/grids.cpp
16
+ src/swe.cpp
17
+ src/text_cursor.cpp
18
+ )
19
+ target_compile_features(_core PRIVATE cxx_std_20)
20
+
21
+ include(cmake/CPM.cmake)
22
+
23
+ CPMAddPackage(
24
+ NAME fast_float
25
+ GITHUB_REPOSITORY "fastfloat/fast_float"
26
+ GIT_TAG v8.2.10)
27
+ target_link_libraries(_core PUBLIC fast_float)
28
+
29
+ install(TARGETS _core DESTINATION ${SKBUILD_PROJECT_NAME})