From 0441b0544b61ee1af157c0a4ddb2be7efa35ce6c Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 31 May 2023 03:32:58 +0000 Subject: automatic import of python-perlin-noise --- .gitignore | 1 + python-perlin-noise.spec | 273 +++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 275 insertions(+) create mode 100644 python-perlin-noise.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..7f4cd4e 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/perlin_noise-1.12.tar.gz diff --git a/python-perlin-noise.spec b/python-perlin-noise.spec new file mode 100644 index 0000000..a423bd4 --- /dev/null +++ b/python-perlin-noise.spec @@ -0,0 +1,273 @@ +%global _empty_manifest_terminate_build 0 +Name: python-perlin-noise +Version: 1.12 +Release: 1 +Summary: Python implementation for Perlin Noise with unlimited coordinates space +License: MIT License +URL: https://pypi.org/project/perlin-noise/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/02/82/4762c741b3edee5cda7207d45592c959760797860f1e8e69b143cf1805bc/perlin_noise-1.12.tar.gz +BuildArch: noarch + + +%description +Smooth random noise generator +read more https://en.wikipedia.org/wiki/Perlin_noise + +source code: https://github.com/salaxieb/perlin_noise + + +noise = PerlinNoise(octaves=3.5, seed=777) +     octaves : number of sub rectangles in each [0, 1] range +     seed : specific seed with which you want to initialize random generator + + +```python +from perlin_noise import PerlinNoise + + +noise = PerlinNoise() +# accepts as argument float and/or list[float] +noise(0.5) == noise([0.5]) +--> True +# noise not limited in space dimension and seamless in any space size +noise([0.5, 0.5]) == noise([0.5, 0.5, 0, 0, 0]) +--> True +``` + +Usage examples: +```python +import matplotlib.pyplot as plt +from perlin_noise import PerlinNoise + +noise = PerlinNoise(octaves=10, seed=1) +xpix, ypix = 100, 100 +pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)] + +plt.imshow(pic, cmap='gray') +plt.show() +``` +![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_4_0.png) + +```python +import matplotlib.pyplot as plt +from perlin_noise import PerlinNoise + +noise1 = PerlinNoise(octaves=3) +noise2 = PerlinNoise(octaves=6) +noise3 = PerlinNoise(octaves=12) +noise4 = PerlinNoise(octaves=24) + +xpix, ypix = 100, 100 +pic = [] +for i in range(xpix): + row = [] + for j in range(ypix): + noise_val = noise1([i/xpix, j/ypix]) + noise_val += 0.5 * noise2([i/xpix, j/ypix]) + noise_val += 0.25 * noise3([i/xpix, j/ypix]) + noise_val += 0.125 * noise4([i/xpix, j/ypix]) + + row.append(noise_val) + pic.append(row) + +plt.imshow(pic, cmap='gray') +plt.show() +``` + +![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_5_0.png) + + + + +%package -n python3-perlin-noise +Summary: Python implementation for Perlin Noise with unlimited coordinates space +Provides: python-perlin-noise +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-perlin-noise +Smooth random noise generator +read more https://en.wikipedia.org/wiki/Perlin_noise + +source code: https://github.com/salaxieb/perlin_noise + + +noise = PerlinNoise(octaves=3.5, seed=777) +     octaves : number of sub rectangles in each [0, 1] range +     seed : specific seed with which you want to initialize random generator + + +```python +from perlin_noise import PerlinNoise + + +noise = PerlinNoise() +# accepts as argument float and/or list[float] +noise(0.5) == noise([0.5]) +--> True +# noise not limited in space dimension and seamless in any space size +noise([0.5, 0.5]) == noise([0.5, 0.5, 0, 0, 0]) +--> True +``` + +Usage examples: +```python +import matplotlib.pyplot as plt +from perlin_noise import PerlinNoise + +noise = PerlinNoise(octaves=10, seed=1) +xpix, ypix = 100, 100 +pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)] + +plt.imshow(pic, cmap='gray') +plt.show() +``` +![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_4_0.png) + +```python +import matplotlib.pyplot as plt +from perlin_noise import PerlinNoise + +noise1 = PerlinNoise(octaves=3) +noise2 = PerlinNoise(octaves=6) +noise3 = PerlinNoise(octaves=12) +noise4 = PerlinNoise(octaves=24) + +xpix, ypix = 100, 100 +pic = [] +for i in range(xpix): + row = [] + for j in range(ypix): + noise_val = noise1([i/xpix, j/ypix]) + noise_val += 0.5 * noise2([i/xpix, j/ypix]) + noise_val += 0.25 * noise3([i/xpix, j/ypix]) + noise_val += 0.125 * noise4([i/xpix, j/ypix]) + + row.append(noise_val) + pic.append(row) + +plt.imshow(pic, cmap='gray') +plt.show() +``` + +![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_5_0.png) + + + + +%package help +Summary: Development documents and examples for perlin-noise +Provides: python3-perlin-noise-doc +%description help +Smooth random noise generator +read more https://en.wikipedia.org/wiki/Perlin_noise + +source code: https://github.com/salaxieb/perlin_noise + + +noise = PerlinNoise(octaves=3.5, seed=777) +     octaves : number of sub rectangles in each [0, 1] range +     seed : specific seed with which you want to initialize random generator + + +```python +from perlin_noise import PerlinNoise + + +noise = PerlinNoise() +# accepts as argument float and/or list[float] +noise(0.5) == noise([0.5]) +--> True +# noise not limited in space dimension and seamless in any space size +noise([0.5, 0.5]) == noise([0.5, 0.5, 0, 0, 0]) +--> True +``` + +Usage examples: +```python +import matplotlib.pyplot as plt +from perlin_noise import PerlinNoise + +noise = PerlinNoise(octaves=10, seed=1) +xpix, ypix = 100, 100 +pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)] + +plt.imshow(pic, cmap='gray') +plt.show() +``` +![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_4_0.png) + +```python +import matplotlib.pyplot as plt +from perlin_noise import PerlinNoise + +noise1 = PerlinNoise(octaves=3) +noise2 = PerlinNoise(octaves=6) +noise3 = PerlinNoise(octaves=12) +noise4 = PerlinNoise(octaves=24) + +xpix, ypix = 100, 100 +pic = [] +for i in range(xpix): + row = [] + for j in range(ypix): + noise_val = noise1([i/xpix, j/ypix]) + noise_val += 0.5 * noise2([i/xpix, j/ypix]) + noise_val += 0.25 * noise3([i/xpix, j/ypix]) + noise_val += 0.125 * noise4([i/xpix, j/ypix]) + + row.append(noise_val) + pic.append(row) + +plt.imshow(pic, cmap='gray') +plt.show() +``` + +![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_5_0.png) + + + + +%prep +%autosetup -n perlin-noise-1.12 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-perlin-noise -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot - 1.12-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..5eff82b --- /dev/null +++ b/sources @@ -0,0 +1 @@ +d6fbeb83c1d5278a2193a359bbf5b8c6 perlin_noise-1.12.tar.gz -- cgit v1.2.3