Framework-LED-Matrix 0.1.1__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 (27) hide show
  1. framework_led_matrix-0.1.1/Framework_LED_Matrix.egg-info/PKG-INFO +159 -0
  2. framework_led_matrix-0.1.1/Framework_LED_Matrix.egg-info/SOURCES.txt +25 -0
  3. framework_led_matrix-0.1.1/Framework_LED_Matrix.egg-info/dependency_links.txt +1 -0
  4. framework_led_matrix-0.1.1/Framework_LED_Matrix.egg-info/entry_points.txt +2 -0
  5. framework_led_matrix-0.1.1/Framework_LED_Matrix.egg-info/requires.txt +8 -0
  6. framework_led_matrix-0.1.1/Framework_LED_Matrix.egg-info/top_level.txt +2 -0
  7. framework_led_matrix-0.1.1/LICENSE +674 -0
  8. framework_led_matrix-0.1.1/PKG-INFO +159 -0
  9. framework_led_matrix-0.1.1/README.md +134 -0
  10. framework_led_matrix-0.1.1/cli.py +669 -0
  11. framework_led_matrix-0.1.1/framework_led_matrix/__init__.py +0 -0
  12. framework_led_matrix-0.1.1/framework_led_matrix/apps/__init__.py +0 -0
  13. framework_led_matrix-0.1.1/framework_led_matrix/apps/background_runner.py +125 -0
  14. framework_led_matrix-0.1.1/framework_led_matrix/apps/runtime.py +185 -0
  15. framework_led_matrix-0.1.1/framework_led_matrix/core/__init__.py +0 -0
  16. framework_led_matrix-0.1.1/framework_led_matrix/core/led_commands.py +406 -0
  17. framework_led_matrix-0.1.1/framework_led_matrix/core/math_engine.py +294 -0
  18. framework_led_matrix-0.1.1/framework_led_matrix/simulations/BihamMiddletonLevineTrafficModel.py +238 -0
  19. framework_led_matrix-0.1.1/framework_led_matrix/simulations/HardyPomeauPazzis.py +241 -0
  20. framework_led_matrix-0.1.1/framework_led_matrix/simulations/__init__.py +0 -0
  21. framework_led_matrix-0.1.1/framework_led_matrix/simulations/inner_totalistic.py +47 -0
  22. framework_led_matrix-0.1.1/framework_led_matrix/simulations/outer_totalistic.py +112 -0
  23. framework_led_matrix-0.1.1/framework_led_matrix/utils/__init__.py +0 -0
  24. framework_led_matrix-0.1.1/framework_led_matrix/utils/anagrams.py +39 -0
  25. framework_led_matrix-0.1.1/framework_led_matrix/utils/text_rendering.py +281 -0
  26. framework_led_matrix-0.1.1/pyproject.toml +41 -0
  27. framework_led_matrix-0.1.1/setup.cfg +4 -0
@@ -0,0 +1,159 @@
1
+ Metadata-Version: 2.4
2
+ Name: Framework-LED-Matrix
3
+ Version: 0.1.1
4
+ Summary: A comprehensive CLI and library for the Framework 16 LED Matrix modules, featuring simulations, text rendering, and math visualizations.
5
+ Author: mariobx
6
+ License: GPL-3.0-only
7
+ Project-URL: Homepage, https://github.com/mariobx/Framework-LED-Matrix
8
+ Project-URL: Bug Tracker, https://github.com/mariobx/Framework-LED-Matrix/issues
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Topic :: System :: Hardware
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: numpy>=1.21.0
17
+ Requires-Dist: matplotlib>=3.5.0
18
+ Requires-Dist: pyserial>=3.5
19
+ Requires-Dist: cellpylib>=2.4.0
20
+ Requires-Dist: nltk>=3.7
21
+ Requires-Dist: pillow>=9.0.0
22
+ Requires-Dist: tqdm>=4.64.0
23
+ Requires-Dist: click>=8.1.0
24
+ Dynamic: license-file
25
+
26
+ # Framework 16 LED Matrix Modules
27
+
28
+ I remember how surprised I was at the lack of tools for the LED matrix 16. I had gotten them knowing they were programmable and I could do cool things, yet no one yet has made a tool for them to do much (at least to my research).
29
+
30
+ This should allow programming novices to run cool simulations of their own on the Framework 16 LED matrix besides the simple boot animations.
31
+
32
+ The `core/` directory defines the core API of the tool, such as creating a simpler way to interact with the defined LED functions, the path of the LEDs, sending of both greyscale and regular payloads, clearing the matricies, etc.
33
+
34
+ This suite allows you to run a variety of visual experiments:
35
+ * **Anagrams & Text:** Anagrams of random words gliding across the screen or custom text rendered vertically and horizontally.
36
+ * **Cellular Automata:** Complex simulations including Conway’s Game of Life, the Biham-Middleton-Levine (BML) traffic model, and Hardy-Pomeau-Pazzis (HPP) lattice gas collisions.
37
+ * **Mathematical Visualizations:** Plotting math functions like `sin`, `cos`, `exp`, and `tanh` directly onto the matrix.
38
+ * **Hybrid Simulations:** Seeding Game of Life or HPP simulations using math function graphs or anagrammed text as the initial starting states.
39
+ * **Noise & Hardware Effects:** Generating hardware-level greyscale noise and controlling internal hardware animations.
40
+
41
+ ---
42
+
43
+ ## Global Options
44
+ * `-v, --verbose`: Enable detailed verbose logging for all commands.
45
+
46
+ ---
47
+
48
+ ## Commands & Sub-arguments
49
+
50
+ ### `background` (aliases: `bg`)
51
+ Run the background runner (screensaver mode).
52
+
53
+ ---
54
+
55
+ ### `led`
56
+ * `version`: Get firmware version from modules.
57
+ * `clear`: Clear both displays (all LEDs OFF).
58
+ * `fill`:
59
+ * `--hold <float>`: Seconds to hold the filled screen (default: `0`).
60
+ * `start-anim`: Start hardware animation (e.g., fades).
61
+ * `stop-anim`: Stop hardware animation.
62
+ * `reset`: Clear display and stop animation.
63
+ * `ports`: Show available serial ports (for debugging).
64
+
65
+ ---
66
+
67
+ ### `text`
68
+ * **`vertical <text>`**: Render text vertically.
69
+ * `<text>`: The text string to render.
70
+ * `--font-size <int>`: Force a specific font size (default: `auto`).
71
+ * `--which <choice>`: Which module: `left`, `right`, `both` (default: `both`).
72
+ * `--row-offset <int>`: Row offset from the top (default: `0`).
73
+ * `--hold <float>`: Seconds to hold the text on screen (default: `0`).
74
+ * **`horizontal <text>`**: Render text horizontally.
75
+ * `<text>`: The text string to render.
76
+ * `--font-size <int>`: Force a specific font size (default: `auto`).
77
+ * `--which <choice>`: Which module: `left`, `right`, `both` (default: `both`).
78
+ * `--x-offset <int>`: Horizontal scroll offset (default: `0`).
79
+ * `--y-offset <int>`: Vertical position offset (default: `centered`).
80
+ * `--hold <float>`: Seconds to hold the text on screen (default: `0`).
81
+
82
+ ---
83
+
84
+ ### `anagram`
85
+ * **`draw <word>`**: Find and draw anagrams for a word.
86
+ * `<word>`: The word to find anagrams for.
87
+ * `--which <choice>`: Which module: `left`, `right`, `both` (default: `both`).
88
+ * `--no-animate`: Disable animation between words.
89
+
90
+ ---
91
+
92
+ ### `sim`
93
+ * **`bml`**: Run Biham-Middleton-Levine traffic model (cars moving on a grid).
94
+ * `--density <float>`: Car density 0.0 to 1.0 (default: `0.35`).
95
+ * `--steps <int>`: Total half-steps to simulate (default: `500`).
96
+ * `--delay <float>`: Delay in seconds between frames (default: `0.05`).
97
+ * **`bml-local`**: Run BML traffic model locally in a Matplotlib window.
98
+ * `--density <float>`: Particle density 0.0 to 1.0 (default: `0.5`).
99
+ * `--steps <int>`: Simulation steps (default: `500`).
100
+ * `--density <float>`: Car density 0.0 to 1.0 (default: `0.35`).
101
+ * `--steps <int>`: Total half-steps to simulate (default: `500`).
102
+ * **`hpp`**: Run Hardy-Pomeau-Pazzis lattice gas (particle collision simulation).
103
+ * `--density <float>`: Particle density 0.0 to 1.0 (default: `0.5`).
104
+ * `--steps <int>`: Simulation steps (default: `500`).
105
+ * `--delay <float>`: Delay in seconds between frames (default: `0.05`).
106
+ * `--which <choice>`: Which module: `left`, `right`, `both` (default: `both`).
107
+ * **`hpp-math`**: Run HPP simulation seeded with math function graphs as the initial state.
108
+ * `--density <float>`: Particle density 0.0 to 1.0 (default: `0.3`).
109
+ * `--steps <int>`: Simulation steps per graph (default: `500`).
110
+ * `--delay <float>`: Delay in seconds between frames (default: `0.05`).
111
+ * `--graphs <int>`: Number of math graphs to run (default: `5`).
112
+ * **`outer`**: Run generic Outer-Totalistic CA using Birth/Survival rules.
113
+ * `--b-rule <list>`: Birth rule, comma-separated (e.g., `'3,6'`).
114
+ * `--s-rule <list>`: Survival rule, comma-separated (e.g., `'2,3'`).
115
+ * `--steps <int>`: Simulation steps (default: `200`).
116
+ * `--delay <float>`: Delay in seconds between frames (default: `0.1`).
117
+ * `--oscil-max <int>`: Steps to detect oscillation (default: `20`).
118
+ * `--still-max <int>`: Steps to detect still life (default: `10`).
119
+ * `--empty-max <int>`: Steps to detect empty board (default: `5`).
120
+ * **`gof`**: Run Conway's Game of Life (B3/S23).
121
+ * `--board <choice>`: Initial state: `random` or named pattern (`glider`, `acorn`, etc.).
122
+ * `--steps <int>`: Simulation steps (default: `200`).
123
+ * `--delay <float>`: Delay in seconds between frames (default: `0.1`).
124
+ * `--which <choice>`: Which module: `left`, `right`, `both` (default: `both`).
125
+ * **`inner`**: Run Inner-Totalistic CA (Wolfram NKS style).
126
+ * `<rule>`: The rule number (integer, e.g., `777`).
127
+ * `--steps <int>`: Simulation steps (default: `200`).
128
+ * `--delay <float>`: Delay in seconds between frames (default: `0.1`).
129
+ * **`random-grey`**: Display hardware-level greyscale noise.
130
+ * `--duration <int>`: Duration in seconds (default: `10`).
131
+ * `--no-animate`: Disable hardware animation (for pure noise).
132
+ * **`anagram-gof`**: Finds anagrams for random words and uses the text as the Game of Life starting state.
133
+ * `--words <int>`: Number of random words to use (default: `4`).
134
+ * `--steps <int>`: GoL steps per anagram (default: `100`).
135
+ * `--delay <float>`: Delay in seconds between GoL frames (default: `0.1`).
136
+ * `--which <choice>`: Which module: `left`, `right`, `both` (default: `both`).
137
+ * **`anagram-draw`**: Sequentially find and draw anagrams for random words.
138
+ * `--words <int>`: Number of random words to use (default: `3`).
139
+ * `--which <choice>`: Which module: `left`, `right`, `both` (default: `both`).
140
+ * **`math-gof`**: Plot math graphs and use them as the Game of Life starting state.
141
+ * `--steps <int>`: GoL steps per graph (default: `100`).
142
+ * `--delay <float>`: Delay in seconds between GoL frames (default: `0.1`).
143
+ * **`math-graphs`**: Show a cycling sequence of random math graphs.
144
+ * `--num <int>`: Number of graphs to show (default: `5`).
145
+ * `--delay <float>`: Delay in seconds between graphs (default: `2.0`).
146
+ * `--which <choice>`: Which module: `left`, `right`, `both` (default: `both`).
147
+ * `--hold <float>`: Seconds to hold the *final* graph on screen (default: `0`).
148
+
149
+ ---
150
+
151
+ ### `math`
152
+ * **`plot <function>`**: Plot a function locally and on the matrix.
153
+ * `<function>`: Predefined function: `sin`, `cos`, `tan`, `exp`, `log`, `tanh`, etc.
154
+ * `--points <int>`: Number of points to plot (default: `500`).
155
+
156
+ ---
157
+
158
+ ## Testing
159
+ * `./cli.py --test`: Run a built-in test suite that cycles through various commands to verify hardware and software functionality.
@@ -0,0 +1,25 @@
1
+ LICENSE
2
+ README.md
3
+ cli.py
4
+ pyproject.toml
5
+ Framework_LED_Matrix.egg-info/PKG-INFO
6
+ Framework_LED_Matrix.egg-info/SOURCES.txt
7
+ Framework_LED_Matrix.egg-info/dependency_links.txt
8
+ Framework_LED_Matrix.egg-info/entry_points.txt
9
+ Framework_LED_Matrix.egg-info/requires.txt
10
+ Framework_LED_Matrix.egg-info/top_level.txt
11
+ framework_led_matrix/__init__.py
12
+ framework_led_matrix/apps/__init__.py
13
+ framework_led_matrix/apps/background_runner.py
14
+ framework_led_matrix/apps/runtime.py
15
+ framework_led_matrix/core/__init__.py
16
+ framework_led_matrix/core/led_commands.py
17
+ framework_led_matrix/core/math_engine.py
18
+ framework_led_matrix/simulations/BihamMiddletonLevineTrafficModel.py
19
+ framework_led_matrix/simulations/HardyPomeauPazzis.py
20
+ framework_led_matrix/simulations/__init__.py
21
+ framework_led_matrix/simulations/inner_totalistic.py
22
+ framework_led_matrix/simulations/outer_totalistic.py
23
+ framework_led_matrix/utils/__init__.py
24
+ framework_led_matrix/utils/anagrams.py
25
+ framework_led_matrix/utils/text_rendering.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ frameworkled = cli:main
@@ -0,0 +1,8 @@
1
+ numpy>=1.21.0
2
+ matplotlib>=3.5.0
3
+ pyserial>=3.5
4
+ cellpylib>=2.4.0
5
+ nltk>=3.7
6
+ pillow>=9.0.0
7
+ tqdm>=4.64.0
8
+ click>=8.1.0
@@ -0,0 +1,2 @@
1
+ cli
2
+ framework_led_matrix