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