e2D 2.0.2__tar.gz → 2.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 (56) hide show
  1. e2d-2.1.0/DEVELOPER_GUIDE.md +323 -0
  2. {e2d-2.0.2 → e2d-2.1.0}/LICENSE +21 -21
  3. {e2d-2.0.2 → e2d-2.1.0}/MANIFEST.in +33 -31
  4. {e2d-2.0.2/e2D.egg-info → e2d-2.1.0}/PKG-INFO +347 -329
  5. {e2d-2.0.2 → e2d-2.1.0}/README.md +297 -279
  6. e2d-2.1.0/docs/API_REFERENCE.md +349 -0
  7. {e2d-2.0.2 → e2d-2.1.0}/e2D/__init__.py +697 -587
  8. {e2d-2.0.2 → e2d-2.1.0}/e2D/ccolors.c +34511 -34514
  9. {e2d-2.0.2 → e2d-2.1.0}/e2D/ccolors.pyi +51 -51
  10. {e2d-2.0.2 → e2d-2.1.0}/e2D/ccolors.pyx +350 -350
  11. {e2d-2.0.2 → e2d-2.1.0}/e2D/color_defs.py +238 -238
  12. {e2d-2.0.2 → e2d-2.1.0}/e2D/colors.py +380 -380
  13. {e2d-2.0.2 → e2d-2.1.0}/e2D/commons.py +83 -83
  14. {e2d-2.0.2 → e2d-2.1.0}/e2D/cvectors.c +28732 -27800
  15. {e2d-2.0.2 → e2d-2.1.0}/e2D/cvectors.pxd +56 -56
  16. {e2d-2.0.2 → e2d-2.1.0}/e2D/cvectors.pyi +248 -243
  17. {e2d-2.0.2 → e2d-2.1.0}/e2D/cvectors.pyx +605 -561
  18. {e2d-2.0.2 → e2d-2.1.0}/e2D/devices.py +87 -86
  19. {e2d-2.0.2 → e2d-2.1.0}/e2D/plots.py +611 -610
  20. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/curve_fragment.glsl +6 -6
  21. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/curve_vertex.glsl +16 -16
  22. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/line_instanced_vertex.glsl +37 -37
  23. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/plot_grid_fragment.glsl +48 -48
  24. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/plot_grid_vertex.glsl +7 -7
  25. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/segment_fragment.glsl +6 -6
  26. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/segment_vertex.glsl +9 -9
  27. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/stream_fragment.glsl +11 -11
  28. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/stream_shift_compute.glsl +16 -16
  29. {e2d-2.0.2 → e2d-2.1.0}/e2D/shaders/stream_vertex.glsl +27 -27
  30. {e2d-2.0.2 → e2d-2.1.0}/e2D/shapes.py +1119 -1118
  31. {e2d-2.0.2 → e2d-2.1.0}/e2D/test_colors.py +122 -122
  32. {e2d-2.0.2 → e2d-2.1.0}/e2D/text_renderer.py +528 -520
  33. {e2d-2.0.2 → e2d-2.1.0}/e2D/types.py +52 -58
  34. {e2d-2.0.2 → e2d-2.1.0}/e2D/types.pyi +55 -60
  35. e2d-2.1.0/e2D/vectors.py +189 -0
  36. {e2d-2.0.2 → e2d-2.1.0}/e2D/winrec.py +275 -275
  37. {e2d-2.0.2 → e2d-2.1.0/e2D.egg-info}/PKG-INFO +347 -329
  38. {e2d-2.0.2 → e2d-2.1.0}/e2D.egg-info/SOURCES.txt +2 -10
  39. {e2d-2.0.2 → e2d-2.1.0}/e2D.egg-info/not-zip-safe +1 -1
  40. {e2d-2.0.2 → e2d-2.1.0}/pyproject.toml +72 -72
  41. {e2d-2.0.2 → e2d-2.1.0}/setup.cfg +70 -70
  42. {e2d-2.0.2 → e2d-2.1.0}/setup.py +105 -105
  43. e2d-2.0.2/QUICKSTART.md +0 -165
  44. e2d-2.0.2/e2D/__init__.pyi +0 -145
  45. e2d-2.0.2/e2D/colors.pyi +0 -104
  46. e2d-2.0.2/e2D/commons.pyi +0 -79
  47. e2d-2.0.2/e2D/devices.pyi +0 -65
  48. e2d-2.0.2/e2D/plots.pyi +0 -238
  49. e2d-2.0.2/e2D/shapes.pyi +0 -272
  50. e2d-2.0.2/e2D/text_renderer.pyi +0 -118
  51. e2d-2.0.2/e2D/vectors.py +0 -339
  52. e2d-2.0.2/e2D/vectors.pyi +0 -106
  53. e2d-2.0.2/e2D/winrec.pyi +0 -87
  54. {e2d-2.0.2 → e2d-2.1.0}/e2D.egg-info/dependency_links.txt +0 -0
  55. {e2d-2.0.2 → e2d-2.1.0}/e2D.egg-info/requires.txt +0 -0
  56. {e2d-2.0.2 → e2d-2.1.0}/e2D.egg-info/top_level.txt +0 -0
@@ -0,0 +1,323 @@
1
+ # Developer Guide - e2D Package
2
+
3
+ ## 📁 Project Structure
4
+
5
+ ```
6
+ e2D_2.0/
7
+ ├── .github/
8
+ │ └── workflows/
9
+ │ ├── publish.yml # Automated PyPI publishing
10
+ │ └── test.yml # CI testing on multiple Python versions
11
+ ├── docs/
12
+ │ └── API_REFERENCE.md # Complete API documentation
13
+ ├── e2D/ # Main package
14
+ │ ├── __init__.py # Package initialization & RootEnv
15
+ │ ├── __init__.pyi # Type stubs
16
+ │ ├── cvectors.pyx # Cython-optimized vector implementation
17
+ │ ├── cvectors.pxd # Cython header
18
+ │ ├── cvectors.pyi # Vector type stubs
19
+ │ ├── cvectors.c # Compiled C extension
20
+ │ ├── ccolors.pyx # Cython color operations (optional)
21
+ │ ├── ccolors.pyi # Color type stubs
22
+ │ ├── ccolors.c # Compiled C extension
23
+ │ ├── vectors.py # Python utilities and fallback
24
+ │ ├── vectors.pyi # Vector type stubs
25
+ │ ├── colors.py # Color class and operations
26
+ │ ├── colors.pyi # Color type stubs
27
+ │ ├── color_defs.py # 80+ pre-defined colors
28
+ │ ├── commons.py # Common utilities
29
+ │ ├── commons.pyi # Type stubs
30
+ │ ├── devices.py # Input handling (Keyboard/Mouse)
31
+ │ ├── devices.pyi # Type stubs
32
+ │ ├── plots.py # Plotting utilities
33
+ │ ├── plots.pyi # Type stubs
34
+ │ ├── shapes.py # Shape rendering
35
+ │ ├── shapes.pyi # Type stubs
36
+ │ ├── text_renderer.py # Text rendering with PIL
37
+ │ ├── text_renderer.pyi # Type stubs
38
+ │ ├── types.py # Type definitions
39
+ │ ├── types.pyi # Type stubs
40
+ │ ├── winrec.py # Screen recording
41
+ │ ├── winrec.pyi # Type stubs
42
+ │ ├── test_colors.py # Color system tests
43
+ │ └── shaders/ # GLSL shader files
44
+ │ ├── curve_fragment.glsl
45
+ │ ├── curve_vertex.glsl
46
+ │ ├── line_instanced_vertex.glsl
47
+ │ ├── plot_grid_fragment.glsl
48
+ │ ├── plot_grid_vertex.glsl
49
+ │ ├── segment_fragment.glsl
50
+ │ ├── segment_vertex.glsl
51
+ │ ├── stream_fragment.glsl
52
+ │ ├── stream_shift_compute.glsl
53
+ │ └── stream_vertex.glsl
54
+ ├── e2D.egg-info/ # Package metadata (auto-generated)
55
+ ├── dist/ # Built distributions (auto-generated)
56
+ ├── setup.py # Build configuration
57
+ ├── setup.cfg # Package metadata
58
+ ├── pyproject.toml # Modern Python packaging (PEP 517)
59
+ ├── MANIFEST.in # Distribution manifest
60
+ ├── README.md # Main documentation & PyPI landing page
61
+ ├── DEVELOPER_GUIDE.md # This file
62
+ ├── PUBLISHING.md # GitHub Actions publishing guide
63
+ ├── LICENSE # MIT License
64
+ ├── new_version.py # Version updater helper script
65
+ └── build_dev.bat # Local development build script (optional)
66
+ ```
67
+
68
+ **Note**: `.bat` files are optional local helpers.
69
+
70
+ ## 🔧 Development Workflow
71
+
72
+ ### 1. Initial Setup
73
+
74
+ ```bash
75
+ # Clone or navigate to project
76
+ cd path/to/e2D-package
77
+
78
+ # Install in development mode
79
+ pip install -e .[dev]
80
+ ```
81
+
82
+ This installs the package in "editable" mode, so changes are immediately reflected.
83
+
84
+ ### 2. Making Changes
85
+
86
+ #### Modifying Python Code
87
+ - Edit files in `e2D/`
88
+ - Changes are immediately available (no reinstall needed)
89
+
90
+ #### Modifying Cython Code
91
+ If you modify `cvectors.pyx` or `cvectors.pxd`:
92
+
93
+ ```bash
94
+ # Recompile the extension
95
+ python setup.py build_ext --inplace
96
+ ```
97
+
98
+ ### 3. Testing
99
+
100
+ ```bash
101
+ # Test basic import
102
+ python -c "import e2D; print(e2D.__version__)"
103
+
104
+ # Test installation from scratch
105
+ pip uninstall e2D
106
+ pip install .
107
+ ```
108
+
109
+ ### 4. Updating Version
110
+
111
+ ```bash
112
+ # Run the version updater
113
+ python new_version.py
114
+ ```
115
+
116
+ This updates:
117
+ - `setup.cfg` → `version`
118
+ - `e2D/__init__.py` → `__version__`
119
+
120
+ ### 5. Building Distribution
121
+
122
+ ```bash
123
+ # Clean previous builds
124
+ python clean.bat # Windows
125
+ rm -rf build dist *.egg-info # Linux/Mac
126
+
127
+ # Build source and wheel distributions
128
+ python -m build
129
+ ```
130
+
131
+ This creates:
132
+ - `dist/e2D-x.x.x.tar.gz` (source distribution)
133
+ - `dist/e2D-x.x.x-*.whl` (wheel distribution)
134
+
135
+ ### 6. Testing Distribution
136
+
137
+ ```bash
138
+ # Test in a virtual environment
139
+ python -m venv test_env
140
+ test_env\Scripts\activate # Windows
141
+ source test_env/bin/activate # Linux/Mac
142
+
143
+ # Install from wheel
144
+ pip install dist/e2D-2.0.0-*.whl
145
+
146
+ # Test it works
147
+ python -c "from e2D import Vector2D; v = Vector2D(1, 2); print(v)"
148
+ ```
149
+
150
+ ### 7. Publishing to PyPI
151
+
152
+ Just push everything in the main e2D folder to this git repo, create a new release and send request to me, it will automatically build it, debug back if errors are found, and if everything works fine it will create a Pypi deployment request to the repo authors (me).
153
+ No build necessary if not for local testing.
154
+
155
+ ## 📋 Pre-Release Checklist
156
+
157
+ Before publishing a new version:
158
+
159
+ - [ ] All tests pass
160
+ - [ ] Examples run without errors
161
+ - [ ] Version number updated in all files
162
+ - [ ] README.md is up to date
163
+ - [ ] CHANGELOG updated (if you have one)
164
+ - [ ] Cython extensions compile on Windows, Linux, Mac
165
+ - [ ] License file is included
166
+ - [ ] No sensitive data (API keys, tokens) in code
167
+
168
+ ## 🔍 Troubleshooting
169
+
170
+ ### Cython Won't Compile
171
+
172
+ **Problem**: `error: Microsoft Visual C++ 14.0 is required`
173
+
174
+ **Solution**: Install [Visual C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
175
+
176
+ **Alternative**: Package will use pure Python fallback (slower but functional)
177
+
178
+ ### Import Errors
179
+
180
+ **Problem**: `ImportError: cannot import name 'Vector2D'`
181
+
182
+ **Solutions**:
183
+ ```bash
184
+ # Ensure package is installed
185
+ pip list | grep e2D
186
+
187
+ # Reinstall in development mode
188
+ pip install -e .
189
+
190
+ # Check Python path
191
+ python -c "import sys; print(sys.path)"
192
+ ```
193
+
194
+ ### Version Not Updating
195
+
196
+ **Problem**: Old version still shows after update
197
+
198
+ **Solutions**:
199
+ ```bash
200
+ # Clear Python cache
201
+ find . -type d -name __pycache__ -exec rm -rf {} +
202
+ rm -rf build dist *.egg-info
203
+
204
+ # Reinstall
205
+ pip uninstall e2D
206
+ pip install -e .
207
+ ```
208
+
209
+ ### Build Fails
210
+
211
+ **Problem**: `error: command 'gcc' failed`
212
+
213
+ **Linux Solution**:
214
+ ```bash
215
+ sudo apt-get install build-essential python3-dev
216
+ ```
217
+
218
+ **Mac Solution**:
219
+ ```bash
220
+ xcode-select --install
221
+ ```
222
+
223
+ ## 🚀 Performance Optimization
224
+
225
+ ### Checking Compilation Status
226
+
227
+ ```python
228
+ import e2D
229
+ print(f"Version: {e2D.__version__}")
230
+ ```
231
+
232
+ ### Benchmarking
233
+
234
+ ```python
235
+ from e2D.vectors import benchmark
236
+ benchmark(iterations=100000)
237
+ ```
238
+
239
+ ### Profiling
240
+
241
+ ```python
242
+ import cProfile
243
+ import pstats
244
+
245
+ cProfile.run('your_simulation_code()', 'profile_stats')
246
+ stats = pstats.Stats('profile_stats')
247
+ stats.sort_stats('cumulative')
248
+ stats.print_stats(20)
249
+ ```
250
+
251
+ ## 📦 Distribution Best Practices
252
+
253
+ ### Source Distribution
254
+ - Includes all source code
255
+ - Users compile on their machine
256
+ - Works on any platform
257
+ - Requires compiler
258
+
259
+ ### Wheel Distribution
260
+ - Pre-compiled for specific platform
261
+ - Quick installation
262
+ - No compiler needed
263
+ - Platform-specific
264
+
265
+ ### Building Wheels for Multiple Platforms
266
+
267
+ Use `cibuildwheel` for automated multi-platform builds:
268
+
269
+ ```yaml
270
+ # .github/workflows/build.yml
271
+ name: Build wheels
272
+ on: [push, pull_request]
273
+ jobs:
274
+ build_wheels:
275
+ runs-on: ${{ matrix.os }}
276
+ strategy:
277
+ matrix:
278
+ os: [ubuntu-latest, windows-latest, macos-latest]
279
+ steps:
280
+ - uses: actions/checkout@v2
281
+ - uses: pypa/cibuildwheel@v2.11.0
282
+ ```
283
+
284
+ ## 🔐 Security
285
+
286
+ - **Never commit** your PyPI token
287
+ - Store token in environment variable or keyring
288
+ - Use API tokens instead of passwords
289
+ - Enable 2FA on PyPI account
290
+
291
+ ## 📝 Version Numbering
292
+
293
+ Follow [Semantic Versioning](https://semver.org/):
294
+
295
+ - **MAJOR.MINOR.PATCH** (e.g., 2.0.0)
296
+ - **MAJOR**: Breaking changes
297
+ - **MINOR**: New features (backward compatible)
298
+ - **PATCH**: Bug fixes
299
+
300
+ Examples:
301
+ - `2.0.0` → `2.0.1`: Bug fix
302
+ - `2.0.0` → `2.1.0`: New feature
303
+ - `2.0.0` → `3.0.0`: Breaking change
304
+
305
+ ## 🤝 Contributing
306
+
307
+ 1. Fork the repository
308
+ 2. Create a feature branch
309
+ 3. Make your changes
310
+ 4. Run tests
311
+ 5. Submit a pull request
312
+
313
+ ## 📞 Support
314
+
315
+ - **Issues**: [GitHub Issues](https://github.com/marick-py/e2D/issues)
316
+ - **Email**: riccardo.mariani@emptyhead.dev
317
+ - **Documentation**: README.md
318
+
319
+ ---
320
+
321
+ Happy developing! 🚀
322
+
323
+
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Riccardo Mariani
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Riccardo Mariani
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.
@@ -1,31 +1,33 @@
1
- # Include Cython source files for compilation during install
2
- include e2D/*.pyx
3
- include e2D/*.pxd
4
- include e2D/*.pyi
5
-
6
- # Include shader files
7
- recursive-include e2D/shaders *.glsl
8
-
9
- # Include documentation
10
- include README.md
11
- include LICENSE
12
- include QUICKSTART.md
13
-
14
- # Include configuration files
15
- include pyproject.toml
16
- include setup.py
17
- include setup.cfg
18
-
19
- # Include examples
20
- recursive-include examples *.py
21
-
22
- # Exclude build artifacts
23
- global-exclude __pycache__
24
- global-exclude *.py[co]
25
- global-exclude *.so
26
- global-exclude *.pyd
27
- global-exclude .DS_Store
28
-
29
- # SECURITY: Exclude version management scripts (contain API keys)
30
- exclude new_version.bat
31
- exclude new_version.py
1
+ # Include Cython source files for compilation during install
2
+ include e2D/*.pyx
3
+ include e2D/*.pxd
4
+ include e2D/*.pyi
5
+
6
+ # Include shader files
7
+ recursive-include e2D/shaders *.glsl
8
+
9
+ # Include documentation
10
+ include README.md
11
+ include LICENSE
12
+ include DEVELOPER_GUIDE.md
13
+ include PUBLISHING.md
14
+ recursive-include docs *.md
15
+
16
+ # Include configuration files
17
+ include pyproject.toml
18
+ include setup.py
19
+ include setup.cfg
20
+
21
+ # Include examples
22
+ recursive-include examples *.py
23
+
24
+ # Exclude build artifacts
25
+ global-exclude __pycache__
26
+ global-exclude *.py[co]
27
+ global-exclude *.so
28
+ global-exclude *.pyd
29
+ global-exclude .DS_Store
30
+
31
+ # SECURITY: Exclude version management scripts (contain API keys)
32
+ exclude new_version.bat
33
+ exclude new_version.py