pyfastnoiselite-ledfx 0.0.8__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 (30) hide show
  1. pyfastnoiselite_ledfx-0.0.8/.github/workflows/build.yml +163 -0
  2. pyfastnoiselite_ledfx-0.0.8/.github/workflows/zizmor.yml +30 -0
  3. pyfastnoiselite_ledfx-0.0.8/.gitignore +13 -0
  4. pyfastnoiselite_ledfx-0.0.8/.gitmodules +3 -0
  5. pyfastnoiselite_ledfx-0.0.8/.python-version +1 -0
  6. pyfastnoiselite_ledfx-0.0.8/LICENSE +21 -0
  7. pyfastnoiselite_ledfx-0.0.8/MAINTAINING.md +80 -0
  8. pyfastnoiselite_ledfx-0.0.8/MANIFEST.in +7 -0
  9. pyfastnoiselite_ledfx-0.0.8/PKG-INFO +90 -0
  10. pyfastnoiselite_ledfx-0.0.8/README.md +65 -0
  11. pyfastnoiselite_ledfx-0.0.8/SECURITY.md +8 -0
  12. pyfastnoiselite_ledfx-0.0.8/ext/CPPWrapper/FastNoiseLitePy.h +15 -0
  13. pyfastnoiselite_ledfx-0.0.8/ext/FastNoise/Cpp/FastNoiseLite.h +2586 -0
  14. pyfastnoiselite_ledfx-0.0.8/ext/FastNoise/LICENSE +22 -0
  15. pyfastnoiselite_ledfx-0.0.8/pyproject.toml +61 -0
  16. pyfastnoiselite_ledfx-0.0.8/renovate.json +41 -0
  17. pyfastnoiselite_ledfx-0.0.8/setup.cfg +4 -0
  18. pyfastnoiselite_ledfx-0.0.8/setup.py +38 -0
  19. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite/__init__.py +0 -0
  20. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite/cppfastnoiselite.pxd +114 -0
  21. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite/pyfastnoiselite.pyx +379 -0
  22. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite_ledfx.egg-info/PKG-INFO +90 -0
  23. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite_ledfx.egg-info/SOURCES.txt +28 -0
  24. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite_ledfx.egg-info/dependency_links.txt +1 -0
  25. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite_ledfx.egg-info/requires.txt +1 -0
  26. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite_ledfx.egg-info/scm_file_list.json +42 -0
  27. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite_ledfx.egg-info/scm_version.json +8 -0
  28. pyfastnoiselite_ledfx-0.0.8/src/pyfastnoiselite_ledfx.egg-info/top_level.txt +1 -0
  29. pyfastnoiselite_ledfx-0.0.8/tests/test_noise.py +149 -0
  30. pyfastnoiselite_ledfx-0.0.8/uv.lock +245 -0
@@ -0,0 +1,163 @@
1
+ name: pyfastnoiselite
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ["v*"]
7
+ pull_request:
8
+ # Weekly run: wheel tests install the newest NumPy/pytest, so this catches
9
+ # dependency drift between releases.
10
+ schedule:
11
+ - cron: "23 4 * * 1"
12
+ workflow_dispatch:
13
+
14
+ permissions: {}
15
+
16
+ concurrency:
17
+ group: ${{ github.workflow }}-${{ github.ref }}
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ build_wheels:
22
+ name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
23
+ runs-on: ${{ matrix.os }}
24
+ permissions:
25
+ contents: read
26
+ strategy:
27
+ fail-fast: false
28
+ matrix:
29
+ include:
30
+ - os: ubuntu-latest
31
+ arch: x86_64
32
+ # Native ARM64 runner, no QEMU
33
+ - os: ubuntu-24.04-arm
34
+ arch: aarch64
35
+ # 32-bit Raspberry Pi OS, emulated
36
+ - os: ubuntu-latest
37
+ arch: armv7l
38
+ - os: windows-latest
39
+ arch: AMD64
40
+ - os: macos-15-intel
41
+ arch: x86_64
42
+ - os: macos-latest
43
+ arch: arm64
44
+ steps:
45
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
46
+ with:
47
+ persist-credentials: false
48
+ submodules: true
49
+ fetch-depth: 0 # setuptools-scm needs tags for the version
50
+
51
+ - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
52
+ if: matrix.arch == 'armv7l'
53
+ with:
54
+ platforms: arm
55
+
56
+ - name: Build wheels
57
+ uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1
58
+ with:
59
+ extras: uv
60
+ env:
61
+ CIBW_ARCHS: ${{ matrix.arch }}
62
+
63
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
64
+ with:
65
+ name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}
66
+ path: ./wheelhouse/*.whl
67
+ if-no-files-found: error
68
+
69
+ build_sdist:
70
+ name: Build and test source distribution
71
+ runs-on: ubuntu-latest
72
+ permissions:
73
+ contents: read
74
+ steps:
75
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
76
+ with:
77
+ persist-credentials: false
78
+ submodules: true
79
+ fetch-depth: 0 # setuptools-scm needs tags for the version
80
+
81
+ # Anyone with write access can push a tag, and a tag can point at a
82
+ # commit that never went through a reviewed PR. Only publish from main.
83
+ - name: Check the release tag is on main
84
+ if: startsWith(github.ref, 'refs/tags/v')
85
+ run: git merge-base --is-ancestor "$GITHUB_SHA" origin/main
86
+
87
+ - name: Install uv
88
+ uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
89
+ with:
90
+ enable-cache: false # output is published; don't restore a cache
91
+
92
+ # `uv build` builds the sdist, then a wheel *from* the sdist, so a file
93
+ # missing from MANIFEST.in fails here instead of on a user's machine.
94
+ - name: Build sdist and a wheel from it
95
+ run: uv build
96
+
97
+ - name: Test the wheel built from the sdist
98
+ run: |
99
+ uv venv
100
+ uv pip install dist/*.whl --group test
101
+ uv run --no-project pytest tests
102
+
103
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
104
+ with:
105
+ name: cibw-sdist
106
+ path: dist/*.tar.gz
107
+ if-no-files-found: error
108
+
109
+ # Keep the NumPy floor in pyproject.toml honest: oldest supported Python
110
+ # with the oldest allowed NumPy.
111
+ numpy_oldest:
112
+ name: Test oldest supported NumPy
113
+ runs-on: ubuntu-latest
114
+ permissions:
115
+ contents: read
116
+ env:
117
+ UV_PYTHON: "3.11"
118
+ steps:
119
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
120
+ with:
121
+ persist-credentials: false
122
+ submodules: true
123
+
124
+ - name: Install uv
125
+ uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
126
+ with:
127
+ enable-cache: false
128
+
129
+ - name: Build and install with the oldest NumPy
130
+ run: |
131
+ uv venv
132
+ floor=$(sed -n 's/.*"numpy>=\([0-9.]*\)".*/\1/p' pyproject.toml)
133
+ uv pip install . --group test "numpy==$floor"
134
+
135
+ - name: Test
136
+ run: |
137
+ uv run --no-project python -c "import numpy; print('numpy', numpy.__version__)"
138
+ uv run --no-project pytest tests
139
+
140
+ publish:
141
+ name: Publish to PyPI
142
+ needs: [build_wheels, build_sdist, numpy_oldest]
143
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
144
+ runs-on: ubuntu-latest
145
+ environment:
146
+ name: pypi
147
+ url: https://pypi.org/p/pyfastnoiselite-ledfx/
148
+ permissions:
149
+ id-token: write # Required for trusted publishing
150
+ steps:
151
+ - name: Download all artifacts
152
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
153
+ with:
154
+ path: dist
155
+ pattern: cibw-*
156
+ merge-multiple: true
157
+
158
+ - name: Display structure of downloaded files
159
+ run: ls -R dist
160
+
161
+ # Uses trusted publishing and uploads PEP 740 attestations for each file.
162
+ - name: Publish to PyPI
163
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
@@ -0,0 +1,30 @@
1
+ name: zizmor
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ schedule:
8
+ - cron: "23 4 * * 1" # new audits land in zizmor over time
9
+ workflow_dispatch:
10
+
11
+ permissions: {}
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ zizmor:
19
+ name: Audit GitHub Actions workflows
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ contents: read
23
+ steps:
24
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
25
+ with:
26
+ persist-credentials: false
27
+
28
+ - uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
29
+ with:
30
+ advanced-security: false # fail the job instead of uploading SARIF
@@ -0,0 +1,13 @@
1
+ *.pyd
2
+ *.o
3
+ *.so
4
+ *.egg-info
5
+ *.egg
6
+ dist
7
+ build
8
+ wheelhouse
9
+ .venv
10
+ .vscode
11
+ src/pyfastnoiselite/*.cpp
12
+ __pycache__/
13
+ .pytest_cache/
@@ -0,0 +1,3 @@
1
+ [submodule "ext/FastNoise"]
2
+ path = ext/FastNoise
3
+ url = https://github.com/Auburn/FastNoiseLite.git
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Tiziano Bettio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,80 @@
1
+ # Maintaining pyfastnoiselite-ledfx
2
+
3
+ This is a fork of [tizilogic/PyFastNoiseLite](https://github.com/tizilogic/PyFastNoiseLite)
4
+ with a stable-ABI build, armv7l wheels and CI on top. It wraps
5
+ [FastNoise Lite](https://github.com/Auburn/FastNoiseLite), vendored as the git
6
+ submodule `ext/FastNoise`.
7
+
8
+ ## What keeps it current
9
+
10
+ | What | How | Who acts |
11
+ | --- | --- | --- |
12
+ | GitHub Actions, uv.lock, Python deps | Renovate, from the org preset `github>LedFx/renovate-config`. Non-majors automerge on green CI after 14 days; majors wait 30 days and need a person. | Renovate; majors reviewed by a maintainer |
13
+ | FastNoise Lite | Renovate's git-submodules manager on `ext/FastNoise`. Never automerged: it changes the compiled wheel, and possibly the noise LedFx renders. | Maintainer reviews |
14
+ | Upstream fork | Renovate bumps the marker below when `tizilogic/PyFastNoiseLite` moves. The PR is the prompt to review upstream. | Maintainer reviews |
15
+ | New Python releases | Nothing to rebuild: the `cp311-abi3` wheels already install on new CPython versions. Add the version to `[tool.cibuildwheel] build` so CI tests it. | Maintainer |
16
+ | New NumPy releases | Weekly scheduled CI builds and tests every wheel against the newest NumPy. | Whoever sees the red run |
17
+ | Workflow security | zizmor on every change to `.github/` and weekly. | CI |
18
+
19
+ ## Output must not drift
20
+
21
+ `tests/test_noise.py` checks the output against values taken from upstream's
22
+ 0.0.7 wheel, using the settings LedFx's noise effects use. If a FastNoise Lite
23
+ bump or a build change moves those values, the LedFx effects change how they
24
+ look. Decide that on purpose. Don't just regenerate the numbers.
25
+
26
+ ## Syncing upstream
27
+
28
+ Last reviewed upstream commit (Renovate updates this line):
29
+
30
+ upstream: https://github.com/tizilogic/PyFastNoiseLite main@3b6390f486dd837d6f80fe1cd5bc097c752eb6aa
31
+
32
+ When Renovate opens a PR bumping it:
33
+
34
+ ```sh
35
+ git remote add upstream https://github.com/tizilogic/PyFastNoiseLite # once
36
+ git fetch upstream
37
+ git log --oneline <old-sha>..upstream/main
38
+ ```
39
+
40
+ The packaging here differs from upstream (pyproject metadata, setuptools-scm,
41
+ abi3, tests), so port changes to `src/` by hand or `git cherry-pick -x` and
42
+ resolve. Skip upstream CI/release changes; ours is different. Merge the marker
43
+ bump in the same PR as the ports, or on its own if nothing applies.
44
+
45
+ If upstream merges and releases
46
+ [tizilogic/PyFastNoiseLite#3](https://github.com/tizilogic/PyFastNoiseLite/pull/3),
47
+ LedFx can go back to depending on `pyfastnoiselite`, and this fork can be archived.
48
+
49
+ ## Releasing
50
+
51
+ Tag `vX.Y.Z` on `main`. setuptools-scm takes the version from the tag. CI
52
+ builds the wheels and the sdist, then publishes to PyPI through trusted
53
+ publishing from the `pypi` environment, with attestations.
54
+
55
+ ## Repository settings
56
+
57
+ These live in GitHub, not in this repo. Renovate's automerge relies on them:
58
+
59
+ - Ruleset `main`: changes go through PRs (no approval needed), no force pushes
60
+ or deletion, and these checks must pass (from GitHub Actions only): the six
61
+ wheel builds, the sdist build, the oldest-NumPy test and zizmor. Repo admins
62
+ can bypass it on a PR. Rename a job and you must update the ruleset too.
63
+ - `pypi` environment: deploys from `v*` tags only.
64
+ - Actions: workflow token is read-only by default and can't approve PRs.
65
+ - Security: Dependabot alerts are on, so Renovate can read them and raise
66
+ `[SECURITY]` PRs straight away. Dependabot security updates are off, so each
67
+ advisory gets only one PR. Secret scanning, push protection and private
68
+ vulnerability reporting are on.
69
+ - Renovate skips forks that have no config, so `renovate.json` must stay on
70
+ `main`. Its runs are on the Mend dashboard (developer.mend.io).
71
+ - Issues are enabled, for Renovate's Dependency Dashboard and for bug reports.
72
+
73
+ ## Supported versions
74
+
75
+ CPython 3.11+ and NumPy >= 1.23.2. When a CPython version reaches end of life,
76
+ drop it from `[tool.cibuildwheel] build`. When 3.11 goes, raise
77
+ `requires-python`, `Py_LIMITED_API` in `setup.py` and the `py_limited_api` tag
78
+ together. Also raise the NumPy floor to the first release with wheels for the
79
+ new oldest Python. The `numpy_oldest` CI job reads that floor from
80
+ pyproject.toml.
@@ -0,0 +1,7 @@
1
+ recursive-include src *.pyx *.pxd
2
+ include ext/CPPWrapper/*.h
3
+ # Only the C++ header and its license are needed from the FastNoise Lite submodule
4
+ prune ext/FastNoise
5
+ include ext/FastNoise/Cpp/FastNoiseLite.h ext/FastNoise/LICENSE
6
+ # Generated by Cython at build time
7
+ exclude src/pyfastnoiselite/*.cpp
@@ -0,0 +1,90 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyfastnoiselite-ledfx
3
+ Version: 0.0.8
4
+ Summary: Cython wrapper for Auburn's FastNoise Lite noise library, with stable-ABI wheels (LedFx fork of pyfastnoiselite)
5
+ Author: LedFx
6
+ Author-email: Tiziano Bettio <tc@tizilogic.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/LedFx/pyfastnoiselite-ledfx
9
+ Project-URL: Source, https://github.com/LedFx/pyfastnoiselite-ledfx
10
+ Project-URL: Issues, https://github.com/LedFx/pyfastnoiselite-ledfx/issues
11
+ Project-URL: Upstream, https://github.com/tizilogic/PyFastNoiseLite
12
+ Keywords: noise,simplex,perlin,procedural,fastnoise
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Cython
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Topic :: Multimedia :: Graphics
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ License-File: ext/FastNoise/LICENSE
23
+ Requires-Dist: numpy>=1.23.2
24
+ Dynamic: license-file
25
+
26
+ # pyfastnoiselite-ledfx
27
+ > **Note:** This is a fork of the original [PyFastNoiseLite](https://github.com/tizilogic/PyFastNoiseLite) maintained by the [LedFx](https://github.com/LedFx) team.
28
+ >
29
+ > **Why this fork exists:**
30
+ > - The original project is sporadically active, and its 0.0.7 release has no Python 3.14 wheels and no sdist on PyPI
31
+ > - We build against the CPython stable ABI, so one wheel per platform covers Python 3.11 and every later release
32
+ > - We ship armv7l wheels for 32-bit Raspberry Pi OS
33
+ > - LedFx depends on pyfastnoiselite and needs a reliable, up-to-date release
34
+ >
35
+ > All credit for pyfastnoiselite goes to Tiziano Bettio, and for FastNoise Lite to Jordan Peck (Auburn). This fork exists solely to provide maintained releases for projects that depend on it. The build changes are offered upstream in [tizilogic/PyFastNoiseLite#3](https://github.com/tizilogic/PyFastNoiseLite/pull/3).
36
+ >
37
+ > **Original project:** https://github.com/tizilogic/PyFastNoiseLite
38
+ > **This fork:** https://github.com/LedFx/pyfastnoiselite-ledfx
39
+
40
+ [![image](https://img.shields.io/pypi/v/pyfastnoiselite-ledfx.svg)](https://pypi.org/p/pyfastnoiselite-ledfx)[![image](https://img.shields.io/pypi/l/pyfastnoiselite-ledfx.svg)](https://pypi.org/p/pyfastnoiselite-ledfx)[![image](https://img.shields.io/pypi/wheel/pyfastnoiselite-ledfx.svg)](https://pypi.org/p/pyfastnoiselite-ledfx)[![image](https://img.shields.io/pypi/pyversions/pyfastnoiselite-ledfx.svg)](https://pypi.org/p/pyfastnoiselite-ledfx)
41
+
42
+ A Cython wrapper for Auburn's [FastNoise Lite](https://github.com/Auburn/FastNoiseLite) noise generation library.
43
+
44
+ ## Installation
45
+
46
+ ```bash
47
+ pip install pyfastnoiselite-ledfx
48
+ ```
49
+
50
+ Binary wheels are published for CPython 3.11+ on Windows (x86_64), macOS (x86_64, arm64) and Linux glibc/musl (x86_64, aarch64, armv7l). Building from the sdist needs a C++11 compiler.
51
+
52
+ The distribution is renamed but the import name is unchanged, so it is a drop-in replacement for `pyfastnoiselite`. Don't install both: they provide the same module.
53
+
54
+ > **Note:** This wrapper lacks the domain warping functionality.
55
+
56
+ ## Usage
57
+
58
+ ```py
59
+ from pyfastnoiselite.pyfastnoiselite import FastNoiseLite, NoiseType
60
+
61
+ # Initializing with seed
62
+ noise = FastNoiseLite(seed=1337)
63
+ # Set noise type (optional, defaults to OpenSimplex2)
64
+ noise.noise_type = NoiseType.NoiseType_OpenSimplex2S
65
+
66
+ # Get 2D noise
67
+ print(noise.get_noise(34, 22)) # 0.7130074501037598
68
+ print(noise.get_noise(100, 110)) # -0.3495847284793854
69
+
70
+ # Get 3D noise
71
+ print(noise.get_noise(95, 100, 30)) # -0.4522402286529541
72
+
73
+
74
+ import numpy as np
75
+
76
+ Xs = [3, 57, 95]
77
+ Ys = [4, 13, 100]
78
+ Zs = [0, -4, 30]
79
+ coords = np.array([Xs, Ys, Zs], dtype=np.float32)
80
+ # Generate noise for each coordinate
81
+ print(noise.gen_from_coords(coords))
82
+ ```
83
+
84
+ For many points, `gen_from_coords` is much faster than calling `get_noise` in a Python loop. It takes a `float32` array of shape `(2, N)` or `(3, N)` (read-only arrays and views are fine) and returns a `float32` array of shape `(N,)`.
85
+
86
+ For batches of 1024 points or more, `gen_from_coords` releases the GIL, so separate `FastNoiseLite` instances can generate in parallel threads. Don't change an instance's settings from another thread while it is generating.
87
+
88
+ ## License
89
+
90
+ This project is licensed under the [MIT license](LICENSE). FastNoise Lite is also MIT licensed.
@@ -0,0 +1,65 @@
1
+ # pyfastnoiselite-ledfx
2
+ > **Note:** This is a fork of the original [PyFastNoiseLite](https://github.com/tizilogic/PyFastNoiseLite) maintained by the [LedFx](https://github.com/LedFx) team.
3
+ >
4
+ > **Why this fork exists:**
5
+ > - The original project is sporadically active, and its 0.0.7 release has no Python 3.14 wheels and no sdist on PyPI
6
+ > - We build against the CPython stable ABI, so one wheel per platform covers Python 3.11 and every later release
7
+ > - We ship armv7l wheels for 32-bit Raspberry Pi OS
8
+ > - LedFx depends on pyfastnoiselite and needs a reliable, up-to-date release
9
+ >
10
+ > All credit for pyfastnoiselite goes to Tiziano Bettio, and for FastNoise Lite to Jordan Peck (Auburn). This fork exists solely to provide maintained releases for projects that depend on it. The build changes are offered upstream in [tizilogic/PyFastNoiseLite#3](https://github.com/tizilogic/PyFastNoiseLite/pull/3).
11
+ >
12
+ > **Original project:** https://github.com/tizilogic/PyFastNoiseLite
13
+ > **This fork:** https://github.com/LedFx/pyfastnoiselite-ledfx
14
+
15
+ [![image](https://img.shields.io/pypi/v/pyfastnoiselite-ledfx.svg)](https://pypi.org/p/pyfastnoiselite-ledfx)[![image](https://img.shields.io/pypi/l/pyfastnoiselite-ledfx.svg)](https://pypi.org/p/pyfastnoiselite-ledfx)[![image](https://img.shields.io/pypi/wheel/pyfastnoiselite-ledfx.svg)](https://pypi.org/p/pyfastnoiselite-ledfx)[![image](https://img.shields.io/pypi/pyversions/pyfastnoiselite-ledfx.svg)](https://pypi.org/p/pyfastnoiselite-ledfx)
16
+
17
+ A Cython wrapper for Auburn's [FastNoise Lite](https://github.com/Auburn/FastNoiseLite) noise generation library.
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ pip install pyfastnoiselite-ledfx
23
+ ```
24
+
25
+ Binary wheels are published for CPython 3.11+ on Windows (x86_64), macOS (x86_64, arm64) and Linux glibc/musl (x86_64, aarch64, armv7l). Building from the sdist needs a C++11 compiler.
26
+
27
+ The distribution is renamed but the import name is unchanged, so it is a drop-in replacement for `pyfastnoiselite`. Don't install both: they provide the same module.
28
+
29
+ > **Note:** This wrapper lacks the domain warping functionality.
30
+
31
+ ## Usage
32
+
33
+ ```py
34
+ from pyfastnoiselite.pyfastnoiselite import FastNoiseLite, NoiseType
35
+
36
+ # Initializing with seed
37
+ noise = FastNoiseLite(seed=1337)
38
+ # Set noise type (optional, defaults to OpenSimplex2)
39
+ noise.noise_type = NoiseType.NoiseType_OpenSimplex2S
40
+
41
+ # Get 2D noise
42
+ print(noise.get_noise(34, 22)) # 0.7130074501037598
43
+ print(noise.get_noise(100, 110)) # -0.3495847284793854
44
+
45
+ # Get 3D noise
46
+ print(noise.get_noise(95, 100, 30)) # -0.4522402286529541
47
+
48
+
49
+ import numpy as np
50
+
51
+ Xs = [3, 57, 95]
52
+ Ys = [4, 13, 100]
53
+ Zs = [0, -4, 30]
54
+ coords = np.array([Xs, Ys, Zs], dtype=np.float32)
55
+ # Generate noise for each coordinate
56
+ print(noise.gen_from_coords(coords))
57
+ ```
58
+
59
+ For many points, `gen_from_coords` is much faster than calling `get_noise` in a Python loop. It takes a `float32` array of shape `(2, N)` or `(3, N)` (read-only arrays and views are fine) and returns a `float32` array of shape `(N,)`.
60
+
61
+ For batches of 1024 points or more, `gen_from_coords` releases the GIL, so separate `FastNoiseLite` instances can generate in parallel threads. Don't change an instance's settings from another thread while it is generating.
62
+
63
+ ## License
64
+
65
+ This project is licensed under the [MIT license](LICENSE). FastNoise Lite is also MIT licensed.
@@ -0,0 +1,8 @@
1
+ # Security policy
2
+
3
+ Only the latest release on PyPI gets fixes.
4
+
5
+ Report vulnerabilities privately through
6
+ [GitHub's private vulnerability reporting](https://github.com/LedFx/pyfastnoiselite-ledfx/security/advisories/new),
7
+ not in a public issue. Bugs in FastNoise Lite itself belong upstream; tell us
8
+ too so we can update the vendored copy.
@@ -0,0 +1,15 @@
1
+ #pragma once
2
+
3
+ #include "Cpp/FastNoiseLite.h"
4
+
5
+ class FastNoiseLitePy : public FastNoiseLite {
6
+ public:
7
+ FastNoiseLitePy() : FastNoiseLite() {}
8
+ void SetNoiseTypePy(int t) { SetNoiseType(static_cast<NoiseType>(t)); }
9
+ void SetRotationType3DPy(int t) { SetRotationType3D(static_cast<RotationType3D>(t)); }
10
+ void SetFractalTypePy(int t) { SetFractalType(static_cast<FractalType>(t)); }
11
+ void SetCellularDistanceFunctionPy(int t) { SetCellularDistanceFunction(static_cast<CellularDistanceFunction>(t)); }
12
+ void SetCellularReturnTypePy(int t) { SetCellularReturnType(static_cast<CellularReturnType>(t)); }
13
+ void SetDomainWarpTypePy(int t) { SetDomainWarpType(static_cast<DomainWarpType>(t)); }
14
+
15
+ };