vibeproj 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 (62) hide show
  1. vibeproj-0.1.0/.github/workflows/ci.yml +39 -0
  2. vibeproj-0.1.0/.github/workflows/docs.yml +41 -0
  3. vibeproj-0.1.0/.github/workflows/publish.yml +98 -0
  4. vibeproj-0.1.0/.gitignore +11 -0
  5. vibeproj-0.1.0/CHANGELOG.md +12 -0
  6. vibeproj-0.1.0/CLAUDE.md +55 -0
  7. vibeproj-0.1.0/LICENSE +192 -0
  8. vibeproj-0.1.0/PKG-INFO +125 -0
  9. vibeproj-0.1.0/README.md +100 -0
  10. vibeproj-0.1.0/docs/_static/css/vibespatial.css +901 -0
  11. vibeproj-0.1.0/docs/_static/js/vibespatial.js +346 -0
  12. vibeproj-0.1.0/docs/conf.py +47 -0
  13. vibeproj-0.1.0/docs/dev/adding-projections.md +219 -0
  14. vibeproj-0.1.0/docs/dev/architecture.md +85 -0
  15. vibeproj-0.1.0/docs/dev/fused-kernels.md +125 -0
  16. vibeproj-0.1.0/docs/dev/index.md +10 -0
  17. vibeproj-0.1.0/docs/dev/testing.md +136 -0
  18. vibeproj-0.1.0/docs/index.md +64 -0
  19. vibeproj-0.1.0/docs/user/api.md +117 -0
  20. vibeproj-0.1.0/docs/user/index.md +12 -0
  21. vibeproj-0.1.0/docs/user/install.md +43 -0
  22. vibeproj-0.1.0/docs/user/precision.md +60 -0
  23. vibeproj-0.1.0/docs/user/projections.md +88 -0
  24. vibeproj-0.1.0/docs/user/quickstart.md +96 -0
  25. vibeproj-0.1.0/docs/user/vibespatial.md +153 -0
  26. vibeproj-0.1.0/pyproject.toml +61 -0
  27. vibeproj-0.1.0/scripts/pipeline_demo.py +204 -0
  28. vibeproj-0.1.0/src/vibeproj/__init__.py +7 -0
  29. vibeproj-0.1.0/src/vibeproj/_ds_device_fns.py +158 -0
  30. vibeproj-0.1.0/src/vibeproj/crs.py +240 -0
  31. vibeproj-0.1.0/src/vibeproj/ellipsoid.py +50 -0
  32. vibeproj-0.1.0/src/vibeproj/fused_kernels.py +1794 -0
  33. vibeproj-0.1.0/src/vibeproj/gpu_detect.py +51 -0
  34. vibeproj-0.1.0/src/vibeproj/pipeline.py +282 -0
  35. vibeproj-0.1.0/src/vibeproj/projections/__init__.py +45 -0
  36. vibeproj-0.1.0/src/vibeproj/projections/albers_equal_area.py +141 -0
  37. vibeproj-0.1.0/src/vibeproj/projections/azimuthal_equidistant.py +68 -0
  38. vibeproj-0.1.0/src/vibeproj/projections/base.py +52 -0
  39. vibeproj-0.1.0/src/vibeproj/projections/cylindrical_equal_area.py +87 -0
  40. vibeproj-0.1.0/src/vibeproj/projections/equal_earth.py +63 -0
  41. vibeproj-0.1.0/src/vibeproj/projections/geostationary.py +105 -0
  42. vibeproj-0.1.0/src/vibeproj/projections/gnomonic.py +56 -0
  43. vibeproj-0.1.0/src/vibeproj/projections/lambert_azimuthal_equal_area.py +204 -0
  44. vibeproj-0.1.0/src/vibeproj/projections/lambert_conformal_conic.py +142 -0
  45. vibeproj-0.1.0/src/vibeproj/projections/mercator.py +99 -0
  46. vibeproj-0.1.0/src/vibeproj/projections/mollweide.py +57 -0
  47. vibeproj-0.1.0/src/vibeproj/projections/natural_earth.py +70 -0
  48. vibeproj-0.1.0/src/vibeproj/projections/oblique_stereographic.py +135 -0
  49. vibeproj-0.1.0/src/vibeproj/projections/orthographic.py +55 -0
  50. vibeproj-0.1.0/src/vibeproj/projections/plate_carree.py +45 -0
  51. vibeproj-0.1.0/src/vibeproj/projections/robinson.py +142 -0
  52. vibeproj-0.1.0/src/vibeproj/projections/sinusoidal.py +40 -0
  53. vibeproj-0.1.0/src/vibeproj/projections/stereographic.py +117 -0
  54. vibeproj-0.1.0/src/vibeproj/projections/transverse_mercator.py +337 -0
  55. vibeproj-0.1.0/src/vibeproj/projections/winkel_tripel.py +76 -0
  56. vibeproj-0.1.0/src/vibeproj/py.typed +0 -0
  57. vibeproj-0.1.0/src/vibeproj/runtime.py +44 -0
  58. vibeproj-0.1.0/src/vibeproj/transformer.py +156 -0
  59. vibeproj-0.1.0/tests/conftest.py +12 -0
  60. vibeproj-0.1.0/tests/test_crs.py +80 -0
  61. vibeproj-0.1.0/tests/test_fused_kernels.py +639 -0
  62. vibeproj-0.1.0/tests/test_transformer.py +709 -0
@@ -0,0 +1,39 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v4
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ run: uv python install ${{ matrix.python-version }}
21
+ - name: Install dependencies
22
+ run: uv sync
23
+ - name: Run tests
24
+ run: uv run pytest --tb=short
25
+ - name: Lint
26
+ run: uv run ruff check src/ tests/
27
+
28
+ lint:
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - name: Install uv
33
+ uses: astral-sh/setup-uv@v4
34
+ - name: Install dependencies
35
+ run: uv sync
36
+ - name: Ruff check
37
+ run: uv run ruff check src/ tests/
38
+ - name: Ruff format check
39
+ run: uv run ruff format --check src/ tests/
@@ -0,0 +1,41 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: read
9
+ pages: write
10
+ id-token: write
11
+
12
+ concurrency:
13
+ group: pages
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v4
23
+ - name: Install dependencies
24
+ run: uv sync
25
+ - name: Build docs
26
+ run: uv run sphinx-build -b html docs/ docs/_build/html
27
+ - name: Upload artifact
28
+ uses: actions/upload-pages-artifact@v3
29
+ with:
30
+ path: docs/_build/html
31
+
32
+ deploy:
33
+ needs: build
34
+ runs-on: ubuntu-latest
35
+ environment:
36
+ name: github-pages
37
+ url: ${{ steps.deployment.outputs.page_url }}
38
+ steps:
39
+ - name: Deploy to GitHub Pages
40
+ id: deployment
41
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,98 @@
1
+ name: Publish to PyPI
2
+
3
+ # Triggered when a GitHub Release is published.
4
+ # Versioning follows effVer (MACRO.MESO.MICRO):
5
+ # https://jacobtomlinson.dev/effver/
6
+ #
7
+ # Release workflow:
8
+ # 1. Bump version in pyproject.toml + src/vibeproj/__init__.py
9
+ # 2. Create a GitHub Release with tag "v{version}" (e.g. v0.2.0)
10
+ # 3. This workflow builds the wheel, attaches it to the release, and publishes to PyPI
11
+ #
12
+ # PyPI setup (one-time):
13
+ # 1. Go to https://pypi.org/manage/project/vibeproj/settings/publishing/
14
+ # 2. Add a "trusted publisher" for GitHub Actions:
15
+ # Repository: vibeProj/vibeProj
16
+ # Workflow: publish.yml
17
+ # Environment: pypi
18
+ on:
19
+ release:
20
+ types: [published]
21
+
22
+ permissions:
23
+ contents: read
24
+
25
+ jobs:
26
+ # ── 1. Validate release tag matches pyproject.toml version ──────────────
27
+ validate:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - name: Check tag matches package version
32
+ run: |
33
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
34
+ PKG_VERSION=$(python3 -c "
35
+ import tomllib
36
+ with open('pyproject.toml', 'rb') as f:
37
+ print(tomllib.load(f)['project']['version'])
38
+ ")
39
+ if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
40
+ echo "::error::Tag version ($TAG_VERSION) does not match pyproject.toml version ($PKG_VERSION)"
41
+ exit 1
42
+ fi
43
+ echo "Version validated: $TAG_VERSION"
44
+
45
+ # ── 2. Build sdist + wheel ──────────────────────────────────────────────
46
+ build:
47
+ needs: validate
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+ - name: Install uv
52
+ uses: astral-sh/setup-uv@v4
53
+ - name: Build package
54
+ run: uv build
55
+ - name: Verify distributions
56
+ run: |
57
+ ls -lh dist/
58
+ test $(ls dist/*.tar.gz | wc -l) -eq 1
59
+ test $(ls dist/*.whl | wc -l) -eq 1
60
+ - name: Upload build artifacts
61
+ uses: actions/upload-artifact@v4
62
+ with:
63
+ name: dist
64
+ path: dist/
65
+ if-no-files-found: error
66
+
67
+ # ── 3. Attach wheel + sdist to the GitHub Release ──────────────────────
68
+ release-assets:
69
+ needs: build
70
+ runs-on: ubuntu-latest
71
+ permissions:
72
+ contents: write # Required to upload release assets
73
+ steps:
74
+ - name: Download build artifacts
75
+ uses: actions/download-artifact@v4
76
+ with:
77
+ name: dist
78
+ path: dist/
79
+ - name: Upload assets to GitHub Release
80
+ env:
81
+ GH_TOKEN: ${{ github.token }}
82
+ run: gh release upload "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY"
83
+
84
+ # ── 4. Publish to PyPI (trusted publishing / OIDC) ─────────────────────
85
+ publish-pypi:
86
+ needs: build
87
+ runs-on: ubuntu-latest
88
+ environment: pypi
89
+ permissions:
90
+ id-token: write # Required for OIDC trusted publishing
91
+ steps:
92
+ - name: Download build artifacts
93
+ uses: actions/download-artifact@v4
94
+ with:
95
+ name: dist
96
+ path: dist/
97
+ - name: Publish to PyPI
98
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,11 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ .pytest_cache/
8
+ *.egg
9
+ .ruff_cache/
10
+ docs/_build/
11
+ uv.lock
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 — 2026-03-15
4
+
5
+ Initial release.
6
+
7
+ - 20 coordinate projections with fused NVRTC GPU kernels
8
+ - pyproj-compatible `Transformer` API (`from_crs`, `transform`)
9
+ - Zero-copy `transform_buffers()` API for vibeSpatial integration
10
+ - NumPy fallback for all projections (CPU path)
11
+ - Double-single (ds) experimental precision mode for Transverse Mercator
12
+ - Automatic GPU detection and precision selection
@@ -0,0 +1,55 @@
1
+ # vibeProj
2
+
3
+ GPU-accelerated coordinate projection library. 20 projections, each with a fused NVRTC kernel.
4
+
5
+ ## Architecture
6
+
7
+ - **Fused NVRTC kernels** (`src/vibeproj/fused_kernels.py`) — 40 CUDA kernels (20 projections × fwd/inv).
8
+ Each runs the full pipeline in one kernel launch: axis swap → deg/rad → central meridian →
9
+ projection math → scale/offset → axis swap output. Compiled at runtime via CuPy `RawKernel`.
10
+ - **xp fallback path** (`src/vibeproj/projections/`) — NumPy/CuPy element-wise implementations.
11
+ Used on CPU and as reference for testing. Each projection is a class with `setup()`, `forward()`, `inverse()`.
12
+ - **Pipeline** (`src/vibeproj/pipeline.py`) — chains pre/post ops. `_try_fused()` fast-path intercepts
13
+ CuPy arrays and dispatches to fused kernels when available.
14
+ - **CRS resolution** (`src/vibeproj/crs.py`) — uses pyproj to extract projection parameters from EPSG codes.
15
+ Maps pyproj method names → internal projection names via `_METHOD_MAP`.
16
+ - **GPU detection** (`src/vibeproj/gpu_detect.py`) — queries `SingleToDoublePrecisionPerfRatio` to classify
17
+ consumer (1:64) vs datacenter (1:2) GPU. Auto precision always uses fp64 (projection math is SFU-bound).
18
+ - **Double-single arithmetic** (`src/vibeproj/_ds_device_fns.py`) — experimental ds fp32 pair arithmetic
19
+ for fp64-equivalent accuracy at fp32 throughput. Available via `precision="ds"`.
20
+
21
+ ## Key conventions
22
+
23
+ - Kernel I/O is always `double*` (fp64 storage per ADR-0002). Compute precision is parameterized via `{real_t}`.
24
+ - Fused kernel preambles handle axis order (CRS-dependent `north_first` flags).
25
+ - Tests validate against pyproj. GPU tests compare fused kernel output against NumPy xp path.
26
+ - `transform_buffers()` is the zero-copy API for vibeSpatial integration (pre-allocated output arrays).
27
+
28
+ ## Adding a new projection
29
+
30
+ 1. Create `src/vibeproj/projections/<name>.py` with a class that has `setup()`, `forward()`, `inverse()`
31
+ 2. Register it: `register("<name>", MyProjection())` at module bottom
32
+ 3. Import it in `src/vibeproj/projections/__init__.py`
33
+ 4. Add pyproj method name mapping in `src/vibeproj/crs.py` `_METHOD_MAP`
34
+ 5. Add fused kernel source strings in `src/vibeproj/fused_kernels.py`:
35
+ - Forward + inverse kernel source using `_FWD_PREAMBLE`/`_FWD_POSTAMBLE` etc.
36
+ - Add to `_SOURCE_MAP`, `_SUPPORTED`, and `fused_transform()` arg packing
37
+ 6. Add tests in `tests/test_fused_kernels.py`
38
+
39
+ ## Running tests
40
+
41
+ ```bash
42
+ uv run pytest # all 85 tests
43
+ uv run pytest tests/test_fused_kernels.py # GPU kernel tests (needs CuPy + GPU)
44
+ uv run pytest tests/test_transformer.py # CPU xp path tests
45
+ ```
46
+
47
+ ## vibeSpatial integration
48
+
49
+ ```python
50
+ from vibeproj import Transformer
51
+
52
+ t = Transformer.from_crs(src_crs, dst_crs)
53
+ # Zero-copy: reads device buffers, writes to pre-allocated device buffers
54
+ t.transform_buffers(buf.x, buf.y, out_x=new_x, out_y=new_y)
55
+ ```
vibeproj-0.1.0/LICENSE ADDED
@@ -0,0 +1,192 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but not
33
+ limited to compiled object code, generated documentation, and
34
+ conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2023 NVIDIA CORPORATION
180
+ Copyright 2025 vibeProj Contributors
181
+
182
+ Licensed under the Apache License, Version 2.0 (the "License");
183
+ you may not use this file except in compliance with the License.
184
+ You may obtain a copy of the License at
185
+
186
+ http://www.apache.org/licenses/LICENSE-2.0
187
+
188
+ Unless required by applicable law or agreed to in writing, software
189
+ distributed under the License is distributed on an "AS IS" BASIS,
190
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
191
+ See the License for the specific language governing permissions and
192
+ limitations under the License.
@@ -0,0 +1,125 @@
1
+ Metadata-Version: 2.4
2
+ Name: vibeproj
3
+ Version: 0.1.0
4
+ Summary: GPU-accelerated coordinate projection library
5
+ Project-URL: Homepage, https://github.com/vibeProj/vibeProj
6
+ Project-URL: Repository, https://github.com/vibeProj/vibeProj
7
+ Project-URL: Documentation, https://vibeproj.github.io/vibeProj/
8
+ Project-URL: Issues, https://github.com/vibeProj/vibeProj/issues
9
+ Author: vibeProj Contributors
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: coordinate,cuda,cupy,geospatial,gis,gpu,projection
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Scientific/Engineering :: GIS
19
+ Requires-Python: >=3.12
20
+ Requires-Dist: numpy>=2
21
+ Requires-Dist: pyproj>=3.7.0
22
+ Provides-Extra: gpu
23
+ Requires-Dist: cupy-cuda12x>=13; extra == 'gpu'
24
+ Description-Content-Type: text/markdown
25
+
26
+ # vibeProj
27
+
28
+ GPU-accelerated coordinate projection library. Extracted from [RAPIDS cuProj](https://github.com/rapidsai/cuspatial), re-engineered as a pure Python + CuPy package, and expanded from 1 to 20 projections — each with a fused NVRTC kernel that runs the full transform pipeline in a single GPU kernel launch.
29
+
30
+ ## Performance
31
+
32
+ On an RTX 4090 vs i9-13900k, 1M coordinates:
33
+ (Note: datacenter GPUs will see far higher speedups due to better double precision performance)
34
+
35
+ | Projection | GPU | vs CPU |
36
+ |---|---|---|
37
+ | Transverse Mercator / UTM | 0.50 ms | 260x |
38
+ | Lambert Conformal Conic | 0.54 ms | 82x |
39
+ | Albers Equal Area | 0.28 ms | 114x |
40
+ | Web Mercator | 0.15 ms | 95x |
41
+ | Equal Earth | 0.21 ms | 139x |
42
+ | Plate Carrée | 0.04 ms | 169x |
43
+
44
+ All 20 projections run sub-millisecond at 1M coordinates. See full benchmark in the repo.
45
+
46
+ ## Supported Projections
47
+
48
+ | Projection | Internal Name | EPSG Examples |
49
+ |---|---|---|
50
+ | Transverse Mercator / UTM | `tmerc` | 32601–32760, 27700 |
51
+ | Web Mercator | `webmerc` | 3857 |
52
+ | Mercator (ellipsoidal) | `merc` | 3395 |
53
+ | Lambert Conformal Conic | `lcc` | 2154 |
54
+ | Albers Equal Area | `aea` | 5070 |
55
+ | Polar Stereographic | `stere` | 3031, 3413 |
56
+ | Lambert Azimuthal Equal Area | `laea` | 3035 |
57
+ | Oblique Stereographic | `sterea` | 28992 |
58
+ | Plate Carrée | `eqc` | 4087 |
59
+ | Sinusoidal | `sinu` | — |
60
+ | Equal Earth | `eqearth` | 8857 |
61
+ | Cylindrical Equal Area | `cea` | 6933 |
62
+ | Orthographic | `ortho` | — |
63
+ | Gnomonic | `gnom` | — |
64
+ | Mollweide | `moll` | — |
65
+ | Robinson | `robin` | — |
66
+ | Winkel Tripel | `wintri` | — |
67
+ | Natural Earth | `natearth` | — |
68
+ | Azimuthal Equidistant | `aeqd` | — |
69
+ | Geostationary Satellite | `geos` | — |
70
+
71
+ ## Install
72
+
73
+ ```bash
74
+ pip install vibeproj # CPU-only (NumPy fallback)
75
+ pip install vibeproj[gpu] # with CuPy for GPU acceleration
76
+ ```
77
+
78
+ For development:
79
+
80
+ ```bash
81
+ uv sync # CPU-only
82
+ uv sync --group gpu # with CuPy
83
+ ```
84
+
85
+ ## Usage
86
+
87
+ ```python
88
+ from vibeproj import Transformer
89
+
90
+ # Default: native CRS axis order (matches pyproj)
91
+ t = Transformer.from_crs("EPSG:4326", "EPSG:32631")
92
+ x, y = t.transform(49.0, 2.0) # (lat, lon) in, (easting, northing) out
93
+
94
+ # always_xy=True: (lon, lat) order — matches shapely/geopandas
95
+ t = Transformer.from_crs("EPSG:4326", "EPSG:32631", always_xy=True)
96
+ x, y = t.transform(2.0, 49.0) # (lon, lat) in, (easting, northing) out
97
+ ```
98
+
99
+ ### vibeSpatial Integration (zero-copy GPU)
100
+
101
+ ```python
102
+ # Pre-allocated output, no intermediate allocations, stays on GPU
103
+ t = Transformer.from_crs(src_crs, dst_crs, always_xy=True)
104
+ new_x = cp.empty_like(buf.x)
105
+ new_y = cp.empty_like(buf.y)
106
+ t.transform_buffers(buf.x, buf.y, out_x=new_x, out_y=new_y)
107
+ ```
108
+
109
+ `transform_buffers()` accepts pre-allocated CuPy output arrays, writes results directly into them, and returns the same objects. No host round-trip, no intermediate allocation. Designed for vibeSpatial's `OwnedGeometryArray` coordinate buffers.
110
+
111
+ ## Architecture
112
+
113
+ - **Pure Python + CuPy** — no compiled extensions, no CMake
114
+ - **Fused NVRTC kernels** — each projection's full pipeline (axis swap, deg/rad, central meridian, projection math, scale/offset) runs in a single CUDA kernel launch via CuPy `RawKernel`
115
+ - **NumPy fallback** — all projections work on CPU when CuPy is unavailable
116
+ - **pyproj for CRS metadata** — EPSG codes resolved via pyproj, transform math is ours
117
+ - **fp64 I/O** — input/output arrays always double precision (ADR-0002 compliant)
118
+ - **Auto GPU detection** — queries `SingleToDoublePrecisionPerfRatio` to classify consumer vs datacenter GPU
119
+
120
+ ## Test
121
+
122
+ ```bash
123
+ uv run pytest # all tests (85 total)
124
+ uv run pytest tests/test_fused_kernels.py # GPU kernel tests (requires CuPy)
125
+ ```
@@ -0,0 +1,100 @@
1
+ # vibeProj
2
+
3
+ GPU-accelerated coordinate projection library. Extracted from [RAPIDS cuProj](https://github.com/rapidsai/cuspatial), re-engineered as a pure Python + CuPy package, and expanded from 1 to 20 projections — each with a fused NVRTC kernel that runs the full transform pipeline in a single GPU kernel launch.
4
+
5
+ ## Performance
6
+
7
+ On an RTX 4090 vs i9-13900k, 1M coordinates:
8
+ (Note: datacenter GPUs will see far higher speedups due to better double precision performance)
9
+
10
+ | Projection | GPU | vs CPU |
11
+ |---|---|---|
12
+ | Transverse Mercator / UTM | 0.50 ms | 260x |
13
+ | Lambert Conformal Conic | 0.54 ms | 82x |
14
+ | Albers Equal Area | 0.28 ms | 114x |
15
+ | Web Mercator | 0.15 ms | 95x |
16
+ | Equal Earth | 0.21 ms | 139x |
17
+ | Plate Carrée | 0.04 ms | 169x |
18
+
19
+ All 20 projections run sub-millisecond at 1M coordinates. See full benchmark in the repo.
20
+
21
+ ## Supported Projections
22
+
23
+ | Projection | Internal Name | EPSG Examples |
24
+ |---|---|---|
25
+ | Transverse Mercator / UTM | `tmerc` | 32601–32760, 27700 |
26
+ | Web Mercator | `webmerc` | 3857 |
27
+ | Mercator (ellipsoidal) | `merc` | 3395 |
28
+ | Lambert Conformal Conic | `lcc` | 2154 |
29
+ | Albers Equal Area | `aea` | 5070 |
30
+ | Polar Stereographic | `stere` | 3031, 3413 |
31
+ | Lambert Azimuthal Equal Area | `laea` | 3035 |
32
+ | Oblique Stereographic | `sterea` | 28992 |
33
+ | Plate Carrée | `eqc` | 4087 |
34
+ | Sinusoidal | `sinu` | — |
35
+ | Equal Earth | `eqearth` | 8857 |
36
+ | Cylindrical Equal Area | `cea` | 6933 |
37
+ | Orthographic | `ortho` | — |
38
+ | Gnomonic | `gnom` | — |
39
+ | Mollweide | `moll` | — |
40
+ | Robinson | `robin` | — |
41
+ | Winkel Tripel | `wintri` | — |
42
+ | Natural Earth | `natearth` | — |
43
+ | Azimuthal Equidistant | `aeqd` | — |
44
+ | Geostationary Satellite | `geos` | — |
45
+
46
+ ## Install
47
+
48
+ ```bash
49
+ pip install vibeproj # CPU-only (NumPy fallback)
50
+ pip install vibeproj[gpu] # with CuPy for GPU acceleration
51
+ ```
52
+
53
+ For development:
54
+
55
+ ```bash
56
+ uv sync # CPU-only
57
+ uv sync --group gpu # with CuPy
58
+ ```
59
+
60
+ ## Usage
61
+
62
+ ```python
63
+ from vibeproj import Transformer
64
+
65
+ # Default: native CRS axis order (matches pyproj)
66
+ t = Transformer.from_crs("EPSG:4326", "EPSG:32631")
67
+ x, y = t.transform(49.0, 2.0) # (lat, lon) in, (easting, northing) out
68
+
69
+ # always_xy=True: (lon, lat) order — matches shapely/geopandas
70
+ t = Transformer.from_crs("EPSG:4326", "EPSG:32631", always_xy=True)
71
+ x, y = t.transform(2.0, 49.0) # (lon, lat) in, (easting, northing) out
72
+ ```
73
+
74
+ ### vibeSpatial Integration (zero-copy GPU)
75
+
76
+ ```python
77
+ # Pre-allocated output, no intermediate allocations, stays on GPU
78
+ t = Transformer.from_crs(src_crs, dst_crs, always_xy=True)
79
+ new_x = cp.empty_like(buf.x)
80
+ new_y = cp.empty_like(buf.y)
81
+ t.transform_buffers(buf.x, buf.y, out_x=new_x, out_y=new_y)
82
+ ```
83
+
84
+ `transform_buffers()` accepts pre-allocated CuPy output arrays, writes results directly into them, and returns the same objects. No host round-trip, no intermediate allocation. Designed for vibeSpatial's `OwnedGeometryArray` coordinate buffers.
85
+
86
+ ## Architecture
87
+
88
+ - **Pure Python + CuPy** — no compiled extensions, no CMake
89
+ - **Fused NVRTC kernels** — each projection's full pipeline (axis swap, deg/rad, central meridian, projection math, scale/offset) runs in a single CUDA kernel launch via CuPy `RawKernel`
90
+ - **NumPy fallback** — all projections work on CPU when CuPy is unavailable
91
+ - **pyproj for CRS metadata** — EPSG codes resolved via pyproj, transform math is ours
92
+ - **fp64 I/O** — input/output arrays always double precision (ADR-0002 compliant)
93
+ - **Auto GPU detection** — queries `SingleToDoublePrecisionPerfRatio` to classify consumer vs datacenter GPU
94
+
95
+ ## Test
96
+
97
+ ```bash
98
+ uv run pytest # all tests (85 total)
99
+ uv run pytest tests/test_fused_kernels.py # GPU kernel tests (requires CuPy)
100
+ ```