pynsn 0.8.9__tar.gz → 0.9.dev3__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 (118) hide show
  1. pynsn-0.9.dev3/.gitignore +56 -0
  2. pynsn-0.9.dev3/.readthedocs.yaml +26 -0
  3. pynsn-0.9.dev3/LICENSE +21 -0
  4. pynsn-0.9.dev3/Makefile +29 -0
  5. pynsn-0.9.dev3/PKG-INFO +90 -0
  6. pynsn-0.9.dev3/README.md +60 -0
  7. pynsn-0.9.dev3/docs/euro_flag_demo.html +14780 -0
  8. pynsn-0.9.dev3/docs/index.html +2 -0
  9. pynsn-0.9.dev3/docs/make_object_arrays_demo.html +14809 -0
  10. pynsn-0.9.dev3/docs/pynsn_demo.html +15189 -0
  11. pynsn-0.9.dev3/documentation/Makefile +23 -0
  12. pynsn-0.9.dev3/documentation/_static/euro_flag_demo.html +14780 -0
  13. pynsn-0.9.dev3/documentation/_static/make_object_arrays_demo.html +14809 -0
  14. pynsn-0.9.dev3/documentation/_static/pynsn_demo.html +15189 -0
  15. pynsn-0.9.dev3/documentation/api.rst +17 -0
  16. pynsn-0.9.dev3/documentation/arrays.rst +95 -0
  17. pynsn-0.9.dev3/documentation/check_api_reference.py +61 -0
  18. pynsn-0.9.dev3/documentation/colours.rst +30 -0
  19. pynsn-0.9.dev3/documentation/conf.py +85 -0
  20. pynsn-0.9.dev3/documentation/distributions.rst +70 -0
  21. pynsn-0.9.dev3/documentation/examples.rst +8 -0
  22. pynsn-0.9.dev3/documentation/index.rst +18 -0
  23. pynsn-0.9.dev3/documentation/install.rst +11 -0
  24. pynsn-0.9.dev3/documentation/make.bat +35 -0
  25. pynsn-0.9.dev3/documentation/misc.rst +4 -0
  26. pynsn-0.9.dev3/documentation/modules.rst +4 -0
  27. pynsn-0.9.dev3/documentation/random_arrays.rst +23 -0
  28. pynsn-0.9.dev3/examples/Makefile +23 -0
  29. pynsn-0.9.dev3/examples/euro_flag_demo.ipynb +141 -0
  30. pynsn-0.9.dev3/examples/eurostar.png +0 -0
  31. pynsn-0.9.dev3/examples/further_demo.ipynb +405 -0
  32. pynsn-0.9.dev3/examples/make_object_arrays_demo.ipynb +98 -0
  33. pynsn-0.9.dev3/examples/pynsn_demo.ipynb +269 -0
  34. pynsn-0.9.dev3/pynsn/__init__.py +25 -0
  35. pynsn-0.9.dev3/pynsn/_misc.py +132 -0
  36. pynsn-0.9.dev3/pynsn/_shapes/__init__.py +3 -0
  37. pynsn-0.9.dev3/pynsn/_shapes/abc_shapes.py +273 -0
  38. pynsn-0.9.dev3/pynsn/_shapes/circ_shapes.py +268 -0
  39. pynsn-0.9.dev3/pynsn/_shapes/colour.py +331 -0
  40. pynsn-0.9.dev3/pynsn/_shapes/ellipse_geometry.py +25 -0
  41. pynsn-0.9.dev3/pynsn/_shapes/shapes.py +191 -0
  42. pynsn-0.9.dev3/pynsn/_stimulus/__init__.py +3 -0
  43. pynsn-0.9.dev3/pynsn/_stimulus/convex_hull.py +40 -0
  44. pynsn-0.9.dev3/pynsn/_stimulus/factory.py +106 -0
  45. pynsn-0.9.dev3/pynsn/_stimulus/nsn_stimulus.py +324 -0
  46. pynsn-0.9.dev3/pynsn/_stimulus/properties.py +288 -0
  47. pynsn-0.9.dev3/pynsn/_stimulus/shape_array.py +434 -0
  48. pynsn-0.9.dev3/pynsn/_stimulus/stimulus_colours.py +122 -0
  49. pynsn-0.9.dev3/pynsn/_stimulus/target_area.py +111 -0
  50. pynsn-0.9.dev3/pynsn/defaults.py +13 -0
  51. pynsn-0.9.dev3/pynsn/errors.py +8 -0
  52. pynsn-0.9.dev3/pynsn/fit.py +289 -0
  53. pynsn-0.9.dev3/pynsn/image/_base.py +192 -0
  54. {pynsn-0.8.9 → pynsn-0.9.dev3}/pynsn/image/expyriment_stimulus.py +18 -28
  55. pynsn-0.9.dev3/pynsn/image/mpl_figure.py +90 -0
  56. pynsn-0.9.dev3/pynsn/image/pil_image.py +102 -0
  57. pynsn-0.9.dev3/pynsn/image/pygame_surface.py +18 -0
  58. pynsn-0.9.dev3/pynsn/image/svg_file.py +103 -0
  59. pynsn-0.9.dev3/pynsn/matrix/__init__.py +5 -0
  60. pynsn-0.9.dev3/pynsn/matrix/matrix.py +54 -0
  61. pynsn-0.9.dev3/pynsn/rnd/__init__.py +5 -0
  62. pynsn-0.9.dev3/pynsn/rnd/_distributions.py +368 -0
  63. pynsn-0.9.dev3/pynsn/rnd/_distributions_2d.py +242 -0
  64. pynsn-0.9.dev3/pynsn/rnd/_random_shape.py +315 -0
  65. pynsn-0.9.dev3/pynsn/rnd/_rng.py +144 -0
  66. pynsn-0.9.dev3/pynsn/typing.py +16 -0
  67. pynsn-0.9.dev3/pyproject.toml +33 -0
  68. pynsn-0.9.dev3/requirements.txt +10 -0
  69. pynsn-0.9.dev3/testing.py +31 -0
  70. pynsn-0.9.dev3/tests/Dockerfile-py310 +14 -0
  71. pynsn-0.9.dev3/tests/Dockerfile-py38 +14 -0
  72. pynsn-0.9.dev3/tests/shapes_test_picture.py +79 -0
  73. pynsn-0.9.dev3/tests/test_dot_array.py +93 -0
  74. pynsn-0.9.dev3/tests/test_images.py +44 -0
  75. pynsn-0.9.dev3/tests/test_rect_array.py +71 -0
  76. pynsn-0.9.dev3/tests/test_save_load.py +73 -0
  77. pynsn-0.9.dev3/tox.ini +9 -0
  78. pynsn-0.9.dev3/visual_testing.py +51 -0
  79. pynsn-0.8.9/PKG-INFO +0 -85
  80. pynsn-0.8.9/README.md +0 -62
  81. pynsn-0.8.9/pynsn/__init__.py +0 -30
  82. pynsn-0.8.9/pynsn/database/__init__.py +0 -1
  83. pynsn-0.8.9/pynsn/database/sql_db.py +0 -98
  84. pynsn-0.8.9/pynsn/dot_array/convex_hull.py +0 -58
  85. pynsn-0.8.9/pynsn/dot_array/dot_array.py +0 -687
  86. pynsn-0.8.9/pynsn/dot_array/item_attributes.py +0 -72
  87. pynsn-0.8.9/pynsn/dot_array/match.py +0 -324
  88. pynsn-0.8.9/pynsn/dot_array/random_dot_array.py +0 -91
  89. pynsn-0.8.9/pynsn/dot_array/shape.py +0 -174
  90. pynsn-0.8.9/pynsn/dot_array/visual_features.py +0 -239
  91. pynsn-0.8.9/pynsn/gui.py +0 -20
  92. pynsn-0.8.9/pynsn/image/pil.py +0 -124
  93. pynsn-0.8.9/pynsn/image/pygame_surface.py +0 -19
  94. pynsn-0.8.9/pynsn/image/svg.py +0 -39
  95. pynsn-0.8.9/pynsn/lib/__init__.py +0 -0
  96. pynsn-0.8.9/pynsn/lib/colour.py +0 -258
  97. pynsn-0.8.9/pynsn/lib/coordinate2D.py +0 -96
  98. pynsn-0.8.9/pynsn/lib/geometry.py +0 -92
  99. pynsn-0.8.9/pynsn/lib/misc.py +0 -183
  100. pynsn-0.8.9/pynsn/qt/__init__.py +0 -1
  101. pynsn-0.8.9/pynsn/qt/dialogs.py +0 -317
  102. pynsn-0.8.9/pynsn/qt/gui_main_window.py +0 -339
  103. pynsn-0.8.9/pynsn/qt/main_widget.py +0 -97
  104. pynsn-0.8.9/pynsn/qt/misc.py +0 -191
  105. pynsn-0.8.9/pynsn/qt/sequence_display.py +0 -69
  106. pynsn-0.8.9/pynsn/sequence/__init__.py +0 -0
  107. pynsn-0.8.9/pynsn/sequence/dot_array_archive.py +0 -140
  108. pynsn-0.8.9/pynsn/sequence/dot_array_sequence.py +0 -247
  109. pynsn-0.8.9/pynsn.egg-info/PKG-INFO +0 -85
  110. pynsn-0.8.9/pynsn.egg-info/SOURCES.txt +0 -39
  111. pynsn-0.8.9/pynsn.egg-info/dependency_links.txt +0 -1
  112. pynsn-0.8.9/pynsn.egg-info/entry_points.txt +0 -3
  113. pynsn-0.8.9/pynsn.egg-info/requires.txt +0 -18
  114. pynsn-0.8.9/pynsn.egg-info/top_level.txt +0 -1
  115. pynsn-0.8.9/setup.cfg +0 -4
  116. pynsn-0.8.9/setup.py +0 -88
  117. {pynsn-0.8.9/pynsn/dot_array → pynsn-0.9.dev3/pynsn/image}/__init__.py +0 -0
  118. {pynsn-0.8.9/pynsn/image → pynsn-0.9.dev3/tests}/__init__.py +0 -0
@@ -0,0 +1,56 @@
1
+ *.py[cod]
2
+
3
+ # C extensions
4
+ *.so
5
+
6
+ # Packages
7
+ *.egg
8
+ *.egg-info
9
+ dist
10
+ build
11
+ eggs
12
+ parts
13
+ bin
14
+ var
15
+ sdist
16
+ develop-eggs
17
+ .installed.cfg
18
+ __pycache__
19
+
20
+ # vim files
21
+ *.swp
22
+
23
+ # Unit test / coverage reports
24
+ .coverage
25
+ .tox
26
+ nosetests.xml
27
+
28
+
29
+ # PyCharm
30
+ .idea
31
+
32
+ #vscode
33
+ .vscode
34
+
35
+ # PyPi
36
+ .pypirc
37
+
38
+ data/
39
+ events/
40
+ log/
41
+ _build/
42
+ venv/
43
+
44
+ # backup file
45
+ .bak
46
+ .Rproj.user
47
+
48
+ #examples
49
+ */.ipynb_checkpoints/
50
+ examples/pynsn
51
+
52
+ test-*
53
+ *.json
54
+ *.svg
55
+ *.png
56
+ *.tmp
@@ -0,0 +1,26 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ # Set the version of Python and other tools you might need
9
+ build:
10
+ os: ubuntu-20.04
11
+ tools:
12
+ python: "3.9"
13
+
14
+
15
+ # Build documentation in the docs/ directory with Sphinx
16
+ sphinx:
17
+ configuration: documentation/conf.py
18
+
19
+ # If using Sphinx, optionally build your docs in additional formats such as PDF
20
+ # formats:
21
+ # - pdf
22
+
23
+ # Optionally declare the Python requirements required to build your docs
24
+ python:
25
+ install:
26
+ - requirements: requirements.txt
pynsn-0.9.dev3/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Oliver Lindemann
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,29 @@
1
+ .PHONY: install clean build
2
+
3
+
4
+ docker_unittest:
5
+ docker build -t pynsn38 -f tests/Dockerfile-py38 . && \
6
+ docker build -t pynsn310 -f tests/Dockerfile-py310 .
7
+ docker run --rm pynsn38
8
+ docker run --rm pynsn310
9
+
10
+ apiref:
11
+ cd documentation && \
12
+ make html check_api
13
+
14
+ jupyter_examples:
15
+ cd examples && \
16
+ make html
17
+
18
+ unittest:
19
+ python -m unittest discover tests/
20
+
21
+ clean:
22
+ @rm -rf build \
23
+ dist \
24
+ pynsn.egg-info \
25
+ .tox \
26
+ .pytest_cache \
27
+ examples\pynsn
28
+ cd documentation && make clean
29
+ py3clean .
@@ -0,0 +1,90 @@
1
+ Metadata-Version: 2.3
2
+ Name: pynsn
3
+ Version: 0.9.dev3
4
+ Summary: Creating Non-Symbolic Number Displays
5
+ Author-email: Oliver Lindemann <lindemann@essb.eur.nl>
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Requires-Dist: numpy>=2.1.3
10
+ Requires-Dist: shapely>=2.0
11
+ Requires-Dist: orjson>=3.10
12
+ Requires-Dist: Pillow>=11.0
13
+ Requires-Dist: Sphinx>=5.1 ; extra == "doc"
14
+ Requires-Dist: sphinx-autodoc-typehints ; extra == "doc"
15
+ Requires-Dist: sphinx-rtd-theme ; extra == "doc"
16
+ Requires-Dist: expyriment>=0.10 ; extra == "expyriment"
17
+ Requires-Dist: matplotlib>=3.9 ; extra == "matplotlib"
18
+ Requires-Dist: pygame>=2.5 ; extra == "pygame"
19
+ Requires-Dist: svgwrite>=1.4 ; extra == "svg"
20
+ Requires-Dist: pytest >=2.7.3 ; extra == "test"
21
+ Project-URL: Documentation, https://github.com/lindemann09/PyNSN
22
+ Project-URL: Source, https://github.com/lindemann09/PyNSN
23
+ Provides-Extra: doc
24
+ Provides-Extra: expyriment
25
+ Provides-Extra: matplotlib
26
+ Provides-Extra: pygame
27
+ Provides-Extra: svg
28
+ Provides-Extra: test
29
+
30
+ PyNSN
31
+ =====
32
+
33
+ **Python Library for Creating Non-Symbolic Number Displays**
34
+
35
+ ---
36
+
37
+ [![GitHub license](https://img.shields.io/github/license/lindemann09/PyNSN)](https://github.com/lindemann09/PyNSN/blob/master/LICENSE)
38
+ [![Python Version](https://img.shields.io/pypi/pyversions/pynsn?style=flat)](https://www.python.org)
39
+ [![PyPI](https://img.shields.io/pypi/v/pynsn?style=flat)](https://pypi.org/project/pynsn/)
40
+
41
+ (c) Oliver Lindemann (lindemann@cognitive-psychology.eu)
42
+
43
+ Project homepage: https://github.com/lindemann09/PyNSN
44
+
45
+
46
+ ## Dependencies
47
+
48
+ * Python 3 (>=3.8)
49
+ * numpy (>=1.26)
50
+ * shapely (>=2.0)
51
+ * orjson (>=3.9)
52
+ * Pillow (>=5.0)
53
+
54
+ ### Optional requirements
55
+
56
+ Additional Python packages, which are optional and required only for
57
+ some features:
58
+
59
+ * matplotlib (>=3.2)
60
+ * svgwrite (>=1.4)
61
+ * pygame (>=2)
62
+ * expyriment (>=0.9)
63
+
64
+
65
+
66
+ ## Installing via `pip`
67
+
68
+ ```
69
+ python -m pip install pynsn
70
+ ```
71
+
72
+ ## Image formats
73
+
74
+ By default, PyNSN is able to write [SVG](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics)
75
+ or [Pillow](https://pillow.readthedocs.io/en/stable/) images.
76
+ To generate [Pygame](https://www.pygame.org/news) or
77
+ [Matplotlib](https://matplotlib.org/stable/index.html) images or stimuli
78
+ for [Expyriment](http://expyriment.org), please install the respective
79
+ packages.
80
+
81
+ ## Examples
82
+ * [making arrays](https://lindemann09.github.io/PyNSN/make_object_arrays_demo.html): manually creating nsn stimuluss and exporting picture file
83
+ ([binder](https://mybinder.org/v2/gh/lindemann09/PyNSN/jupyter?labpath=examples%2Fmake_object_arrays_demo.ipynb))
84
+ * [random arrays](https://lindemann09.github.io/PyNSN/pynsn_demo.html): Creating random nsn stimuli
85
+ ([binder](https://mybinder.org/v2/gh/lindemann09/PyNSN/jupyter?labpath=examples%2Fpynsn_demo.ipynb))
86
+ * matching visual features
87
+ * data base, sequences
88
+ * [Euro flag example](https://lindemann09.github.io/PyNSN/euro_flag_demo.html): using pictures as objects in array
89
+ ([binder](https://mybinder.org/v2/gh/lindemann09/PyNSN/jupyter?labpath=examples%2Feuro_flag_demo.ipynb))
90
+
@@ -0,0 +1,60 @@
1
+ PyNSN
2
+ =====
3
+
4
+ **Python Library for Creating Non-Symbolic Number Displays**
5
+
6
+ ---
7
+
8
+ [![GitHub license](https://img.shields.io/github/license/lindemann09/PyNSN)](https://github.com/lindemann09/PyNSN/blob/master/LICENSE)
9
+ [![Python Version](https://img.shields.io/pypi/pyversions/pynsn?style=flat)](https://www.python.org)
10
+ [![PyPI](https://img.shields.io/pypi/v/pynsn?style=flat)](https://pypi.org/project/pynsn/)
11
+
12
+ (c) Oliver Lindemann (lindemann@cognitive-psychology.eu)
13
+
14
+ Project homepage: https://github.com/lindemann09/PyNSN
15
+
16
+
17
+ ## Dependencies
18
+
19
+ * Python 3 (>=3.8)
20
+ * numpy (>=1.26)
21
+ * shapely (>=2.0)
22
+ * orjson (>=3.9)
23
+ * Pillow (>=5.0)
24
+
25
+ ### Optional requirements
26
+
27
+ Additional Python packages, which are optional and required only for
28
+ some features:
29
+
30
+ * matplotlib (>=3.2)
31
+ * svgwrite (>=1.4)
32
+ * pygame (>=2)
33
+ * expyriment (>=0.9)
34
+
35
+
36
+
37
+ ## Installing via `pip`
38
+
39
+ ```
40
+ python -m pip install pynsn
41
+ ```
42
+
43
+ ## Image formats
44
+
45
+ By default, PyNSN is able to write [SVG](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics)
46
+ or [Pillow](https://pillow.readthedocs.io/en/stable/) images.
47
+ To generate [Pygame](https://www.pygame.org/news) or
48
+ [Matplotlib](https://matplotlib.org/stable/index.html) images or stimuli
49
+ for [Expyriment](http://expyriment.org), please install the respective
50
+ packages.
51
+
52
+ ## Examples
53
+ * [making arrays](https://lindemann09.github.io/PyNSN/make_object_arrays_demo.html): manually creating nsn stimuluss and exporting picture file
54
+ ([binder](https://mybinder.org/v2/gh/lindemann09/PyNSN/jupyter?labpath=examples%2Fmake_object_arrays_demo.ipynb))
55
+ * [random arrays](https://lindemann09.github.io/PyNSN/pynsn_demo.html): Creating random nsn stimuli
56
+ ([binder](https://mybinder.org/v2/gh/lindemann09/PyNSN/jupyter?labpath=examples%2Fpynsn_demo.ipynb))
57
+ * matching visual features
58
+ * data base, sequences
59
+ * [Euro flag example](https://lindemann09.github.io/PyNSN/euro_flag_demo.html): using pictures as objects in array
60
+ ([binder](https://mybinder.org/v2/gh/lindemann09/PyNSN/jupyter?labpath=examples%2Feuro_flag_demo.ipynb))