aedat 2.2.0__tar.gz → 2.3.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 (33) hide show
  1. {aedat-2.2.0 → aedat-2.3.0}/.github/workflows/build_wheels.yml +46 -22
  2. {aedat-2.2.0 → aedat-2.3.0}/.gitignore +2 -0
  3. {aedat-2.2.0 → aedat-2.3.0}/Cargo.lock +38 -61
  4. aedat-2.3.0/Cargo.toml +22 -0
  5. {aedat-2.2.0 → aedat-2.3.0}/PKG-INFO +30 -9
  6. {aedat-2.2.0 → aedat-2.3.0}/README.md +26 -5
  7. aedat-2.3.0/aedat.pyi +8 -0
  8. aedat-2.3.0/flatbuffers/frame.fbs +28 -0
  9. {aedat-2.2.0 → aedat-2.3.0}/pyproject.toml +13 -2
  10. {aedat-2.2.0 → aedat-2.3.0}/src/aedat_core.rs +17 -8
  11. {aedat-2.2.0 → aedat-2.3.0}/src/events_generated.rs +89 -97
  12. {aedat-2.2.0 → aedat-2.3.0}/src/frame_generated.rs +83 -79
  13. {aedat-2.2.0 → aedat-2.3.0}/src/imus_generated.rs +77 -85
  14. {aedat-2.2.0 → aedat-2.3.0}/src/ioheader_generated.rs +59 -67
  15. aedat-2.3.0/src/lib.rs +737 -0
  16. {aedat-2.2.0 → aedat-2.3.0}/src/triggers_generated.rs +79 -88
  17. aedat-2.3.0/tests/__init__.py +0 -0
  18. aedat-2.3.0/tests/assets.py +42 -0
  19. aedat-2.3.0/tests/data/test_data_gray16.aedat4 +0 -0
  20. aedat-2.3.0/tests/data/test_data_unknown_then_gray16.aedat4 +0 -0
  21. aedat-2.3.0/tests/test_decoders.py +71 -0
  22. aedat-2.3.0/tests/test_frame_formats.py +32 -0
  23. aedat-2.2.0/.github/workflows/install_dependencies.py +0 -24
  24. aedat-2.2.0/Cargo.toml +0 -21
  25. aedat-2.2.0/flatbuffers/frame.fbs +0 -23
  26. aedat-2.2.0/src/lib.rs +0 -620
  27. aedat-2.2.0/test.py +0 -45
  28. {aedat-2.2.0 → aedat-2.3.0}/LICENSE +0 -0
  29. {aedat-2.2.0 → aedat-2.3.0}/flatbuffers/events.fbs +0 -0
  30. {aedat-2.2.0 → aedat-2.3.0}/flatbuffers/imus.fbs +0 -0
  31. {aedat-2.2.0 → aedat-2.3.0}/flatbuffers/ioheader.fbs +0 -0
  32. {aedat-2.2.0 → aedat-2.3.0}/flatbuffers/triggers.fbs +0 -0
  33. {aedat-2.2.0 → aedat-2.3.0/tests/data}/test_data.aedat4 +0 -0
@@ -7,21 +7,27 @@ on:
7
7
  types:
8
8
  - published
9
9
 
10
+ concurrency:
11
+ group: "build"
12
+ cancel-in-progress: true
13
+
10
14
  env:
11
- CIBW_SKIP: cp36-* cp37-* cp38-* pp* *i686 *win32
15
+ CIBW_SKIP: cp315-* cp315t-* pp* *i686 *win32 cp39-win_arm64 cp310-win_arm64
12
16
 
13
17
  # cibuildhweel macOS configuration
14
18
  CIBW_ARCHS_MACOS: native
15
19
 
16
20
  # cibuildhweel linux configuration
17
- CIBW_ARCHS_LINUX: x86_64
21
+ CIBW_ARCHS_LINUX: native
18
22
  CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
19
23
  CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
24
+ # On Linux, wheels are built inside a container on the GitHub runner (unlike macOS and Windows which use the GitHub runner directly)
25
+ # Any build dependencies must thus be installed on the container (using CIBW_BEFORE_ALL_LINUX), *not* on the runner with the regular workflow
20
26
  CIBW_BEFORE_ALL_LINUX: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=stable --profile=minimal -y
21
27
  CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH"'
22
28
 
23
29
  # cibuildhweel Windows configuration
24
- CIBW_ARCHS_WINDOWS: AMD64
30
+ CIBW_ARCHS_WINDOWS: native
25
31
 
26
32
  jobs:
27
33
  build_wheels:
@@ -29,15 +35,16 @@ jobs:
29
35
  runs-on: ${{ matrix.os }}
30
36
  strategy:
31
37
  matrix:
32
- # macos-13 is an Intel runner, macos-latest is an ARM runner
33
- os: [macos-13, macos-latest, ubuntu-latest, windows-latest]
38
+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-15-intel, windows-latest, windows-11-arm]
34
39
  steps:
35
40
  - uses: actions/checkout@v4
36
41
  - uses: dtolnay/rust-toolchain@stable
37
- - run: python -m pip install cibuildwheel==2.21.3
42
+ - uses: astral-sh/setup-uv@v10.1.0
43
+ with:
44
+ version: 0.12.17
38
45
  - run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d '.' -f 1-2)" >> $GITHUB_ENV
39
46
  if: startsWith(matrix.os, 'macos')
40
- - run: python -m cibuildwheel
47
+ - run: uvx cibuildwheel==4.2.1
41
48
  - uses: actions/upload-artifact@v4
42
49
  with:
43
50
  name: ${{ matrix.os }}
@@ -49,36 +56,53 @@ jobs:
49
56
  strategy:
50
57
  matrix:
51
58
  numpy: ["==1.26.4", ">=2"]
52
- python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
53
- # macos-13 is an Intel runner, macos-latest is an ARM runner
54
- os: [macos-13, macos-latest, ubuntu-latest, windows-latest]
59
+ python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
60
+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-15-intel, windows-latest, windows-11-arm]
55
61
  exclude:
56
62
  # this configuration yields 'Windows fatal exception: access violation'
57
63
  # this may get fixed in a maintenance upgrade of 1.26.x (x > 4)
58
64
  - numpy: ==1.26.4
59
65
  os: windows-latest
60
- python: 3.13
66
+ python: "3.13"
67
+ # numpy 1.26.4 has no wheels for Python 3.14 and does not build from source on it
68
+ - numpy: ==1.26.4
69
+ python: "3.14"
70
+ - numpy: ==1.26.4
71
+ python: "3.14t"
72
+ # numpy has no Windows ARM64 wheels before 2.3.0 and none at all for Python 3.9 and 3.10
73
+ - numpy: ==1.26.4
74
+ os: windows-11-arm
75
+ - os: windows-11-arm
76
+ python: "3.9"
77
+ - os: windows-11-arm
78
+ python: "3.10"
61
79
  steps:
62
- - uses: actions/setup-python@v5
63
- with:
64
- python-version: ${{ matrix.python }}
65
80
  - uses: actions/checkout@v4
81
+ - uses: astral-sh/setup-uv@v10.1.0
82
+ with:
83
+ version: 0.12.17
84
+ python-version: ${{ matrix.os == 'windows-11-arm' && format('cpython-{0}-windows-aarch64-none', matrix.python) || matrix.python }}
85
+ activate-environment: true
66
86
  - uses: actions/download-artifact@v4
67
87
  with:
68
88
  name: ${{ matrix.os }}
69
89
  path: wheelhouse
70
- - run: python -m pip install toml
71
- - run: python -m pip install 'numpy${{ matrix.numpy }}'
72
- - run: python .github/workflows/install_dependencies.py
73
- - run: ls wheelhouse
74
- - run: python -m pip install --no-index --find-links wheelhouse aedat
75
- - run: python test.py
90
+ - run: python --version
91
+ - run: uv pip install 'numpy${{ matrix.numpy }}'
92
+ - run: uv pip install --group test
93
+ - run: uv pip install --no-index --find-links wheelhouse aedat
94
+ - run: python -m pytest tests/
95
+ - run: python -c 'import sys, aedat; assert not sys._is_gil_enabled(), "importing aedat re-enabled the GIL"'
96
+ if: endsWith(matrix.python, 't')
76
97
  build_sdist:
77
98
  name: Build source distribution
78
99
  runs-on: ubuntu-latest
79
100
  steps:
80
101
  - uses: actions/checkout@v4
81
- - run: pipx run build --sdist
102
+ - uses: astral-sh/setup-uv@v10.1.0
103
+ with:
104
+ version: 0.12.17
105
+ - run: uvx --from build==1.6.1 pyproject-build --sdist
82
106
  - uses: actions/upload-artifact@v4
83
107
  with:
84
108
  name: dist
@@ -99,6 +123,6 @@ jobs:
99
123
  name: dist
100
124
  path: dist
101
125
  - run: mv wheelhouse/* dist/
102
- - uses: pypa/gh-action-pypi-publish@v1.8.14
126
+ - uses: pypa/gh-action-pypi-publish@v1.12.4
103
127
  with:
104
128
  password: ${{ secrets.PYPI_API_TOKEN }}
@@ -4,3 +4,5 @@ aedat.so
4
4
  aedat.pyd
5
5
  wheelhouse/
6
6
  .venv
7
+ __pycache__/
8
+ .pytest_cache/
@@ -4,7 +4,7 @@ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "aedat"
7
- version = "2.2.0"
7
+ version = "2.3.0"
8
8
  dependencies = [
9
9
  "flatbuffers",
10
10
  "lz4",
@@ -22,9 +22,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
22
22
 
23
23
  [[package]]
24
24
  name = "bitflags"
25
- version = "1.3.2"
25
+ version = "2.13.2"
26
26
  source = "registry+https://github.com/rust-lang/crates.io-index"
27
- checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
27
+ checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
28
28
 
29
29
  [[package]]
30
30
  name = "cc"
@@ -37,17 +37,11 @@ dependencies = [
37
37
  "shlex",
38
38
  ]
39
39
 
40
- [[package]]
41
- name = "cfg-if"
42
- version = "1.0.0"
43
- source = "registry+https://github.com/rust-lang/crates.io-index"
44
- checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
45
-
46
40
  [[package]]
47
41
  name = "flatbuffers"
48
- version = "24.12.23"
42
+ version = "25.12.19"
49
43
  source = "registry+https://github.com/rust-lang/crates.io-index"
50
- checksum = "4f1baf0dbf96932ec9a3038d57900329c015b0bfb7b63d904f3bc27e2b02a096"
44
+ checksum = "35f6839d7b3b98adde531effaf34f0c2badc6f4735d26fe74709d8e513a96ef3"
51
45
  dependencies = [
52
46
  "bitflags",
53
47
  "rustc_version",
@@ -59,12 +53,6 @@ version = "0.5.0"
59
53
  source = "registry+https://github.com/rust-lang/crates.io-index"
60
54
  checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
61
55
 
62
- [[package]]
63
- name = "indoc"
64
- version = "2.0.5"
65
- source = "registry+https://github.com/rust-lang/crates.io-index"
66
- checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
67
-
68
56
  [[package]]
69
57
  name = "jobserver"
70
58
  version = "0.1.31"
@@ -110,13 +98,10 @@ dependencies = [
110
98
  ]
111
99
 
112
100
  [[package]]
113
- name = "memoffset"
114
- version = "0.9.1"
101
+ name = "memchr"
102
+ version = "2.8.3"
115
103
  source = "registry+https://github.com/rust-lang/crates.io-index"
116
- checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
117
- dependencies = [
118
- "autocfg",
119
- ]
104
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
120
105
 
121
106
  [[package]]
122
107
  name = "ndarray"
@@ -160,9 +145,9 @@ dependencies = [
160
145
 
161
146
  [[package]]
162
147
  name = "numpy"
163
- version = "0.23.0"
148
+ version = "0.29.0"
164
149
  source = "registry+https://github.com/rust-lang/crates.io-index"
165
- checksum = "b94caae805f998a07d33af06e6a3891e38556051b8045c615470a71590e13e78"
150
+ checksum = "6a5b15d63a5ff39e378daed0e1340d3a5964703ea9712eb09a0dc66fade996f4"
166
151
  dependencies = [
167
152
  "libc",
168
153
  "ndarray",
@@ -170,14 +155,15 @@ dependencies = [
170
155
  "num-integer",
171
156
  "num-traits",
172
157
  "pyo3",
158
+ "pyo3-build-config",
173
159
  "rustc-hash",
174
160
  ]
175
161
 
176
162
  [[package]]
177
163
  name = "once_cell"
178
- version = "1.19.0"
164
+ version = "1.21.4"
179
165
  source = "registry+https://github.com/rust-lang/crates.io-index"
180
- checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
166
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
181
167
 
182
168
  [[package]]
183
169
  name = "pkg-config"
@@ -202,37 +188,32 @@ dependencies = [
202
188
 
203
189
  [[package]]
204
190
  name = "pyo3"
205
- version = "0.23.4"
191
+ version = "0.29.2"
206
192
  source = "registry+https://github.com/rust-lang/crates.io-index"
207
- checksum = "57fe09249128b3173d092de9523eaa75136bf7ba85e0d69eca241c7939c933cc"
193
+ checksum = "4688ddedf473e32662b9b067670129a8afb8c18e351482c70d62ba4a88171e8b"
208
194
  dependencies = [
209
- "cfg-if",
210
- "indoc",
211
195
  "libc",
212
- "memoffset",
213
196
  "once_cell",
214
197
  "portable-atomic",
215
198
  "pyo3-build-config",
216
199
  "pyo3-ffi",
217
200
  "pyo3-macros",
218
- "unindent",
219
201
  ]
220
202
 
221
203
  [[package]]
222
204
  name = "pyo3-build-config"
223
- version = "0.23.4"
205
+ version = "0.29.2"
224
206
  source = "registry+https://github.com/rust-lang/crates.io-index"
225
- checksum = "1cd3927b5a78757a0d71aa9dff669f903b1eb64b54142a9bd9f757f8fde65fd7"
207
+ checksum = "f41027e41b4bd03f6e60f9f417fe24a6341a6bb744edd62b6f709f2a52ea30e9"
226
208
  dependencies = [
227
- "once_cell",
228
209
  "target-lexicon",
229
210
  ]
230
211
 
231
212
  [[package]]
232
213
  name = "pyo3-ffi"
233
- version = "0.23.4"
214
+ version = "0.29.2"
234
215
  source = "registry+https://github.com/rust-lang/crates.io-index"
235
- checksum = "dab6bb2102bd8f991e7749f130a70d05dd557613e39ed2deeee8e9ca0c4d548d"
216
+ checksum = "e591a95526fead067432c3b3a33fc74770b87b1e04e73671090d9c2055a2b327"
236
217
  dependencies = [
237
218
  "libc",
238
219
  "pyo3-build-config",
@@ -240,9 +221,9 @@ dependencies = [
240
221
 
241
222
  [[package]]
242
223
  name = "pyo3-macros"
243
- version = "0.23.4"
224
+ version = "0.29.2"
244
225
  source = "registry+https://github.com/rust-lang/crates.io-index"
245
- checksum = "91871864b353fd5ffcb3f91f2f703a22a9797c91b9ab497b1acac7b07ae509c7"
226
+ checksum = "73225868fc1cd84eef2c3c230ddb91273bf1de46aeb8a4248da76d32a0924a1c"
246
227
  dependencies = [
247
228
  "proc-macro2",
248
229
  "pyo3-macros-backend",
@@ -252,22 +233,21 @@ dependencies = [
252
233
 
253
234
  [[package]]
254
235
  name = "pyo3-macros-backend"
255
- version = "0.23.4"
236
+ version = "0.29.2"
256
237
  source = "registry+https://github.com/rust-lang/crates.io-index"
257
- checksum = "43abc3b80bc20f3facd86cd3c60beed58c3e2aa26213f3cda368de39c60a27e4"
238
+ checksum = "571575aa3749fa6216757dd47d2a3e7ef360f329a40f0666a9fbd14889024952"
258
239
  dependencies = [
259
240
  "heck",
260
241
  "proc-macro2",
261
- "pyo3-build-config",
262
242
  "quote",
263
243
  "syn",
264
244
  ]
265
245
 
266
246
  [[package]]
267
247
  name = "quote"
268
- version = "1.0.36"
248
+ version = "1.0.47"
269
249
  source = "registry+https://github.com/rust-lang/crates.io-index"
270
- checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
250
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
271
251
  dependencies = [
272
252
  "proc-macro2",
273
253
  ]
@@ -280,9 +260,12 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
280
260
 
281
261
  [[package]]
282
262
  name = "roxmltree"
283
- version = "0.20.0"
263
+ version = "0.21.1"
284
264
  source = "registry+https://github.com/rust-lang/crates.io-index"
285
- checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
265
+ checksum = "f1964b10c76125c36f8afe190065a4bf9a87bf324842c05701330bba9f1cacbb"
266
+ dependencies = [
267
+ "memchr",
268
+ ]
286
269
 
287
270
  [[package]]
288
271
  name = "rustc-hash"
@@ -324,9 +307,9 @@ dependencies = [
324
307
 
325
308
  [[package]]
326
309
  name = "target-lexicon"
327
- version = "0.12.14"
310
+ version = "0.13.5"
328
311
  source = "registry+https://github.com/rust-lang/crates.io-index"
329
- checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
312
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
330
313
 
331
314
  [[package]]
332
315
  name = "unicode-ident"
@@ -334,35 +317,29 @@ version = "1.0.12"
334
317
  source = "registry+https://github.com/rust-lang/crates.io-index"
335
318
  checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
336
319
 
337
- [[package]]
338
- name = "unindent"
339
- version = "0.2.3"
340
- source = "registry+https://github.com/rust-lang/crates.io-index"
341
- checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
342
-
343
320
  [[package]]
344
321
  name = "zstd"
345
- version = "0.13.2"
322
+ version = "0.14.0"
346
323
  source = "registry+https://github.com/rust-lang/crates.io-index"
347
- checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9"
324
+ checksum = "bf06bd8162af0734b344780deb55b42a2429ae430870d13fcc12f238e880fe6e"
348
325
  dependencies = [
349
326
  "zstd-safe",
350
327
  ]
351
328
 
352
329
  [[package]]
353
330
  name = "zstd-safe"
354
- version = "7.1.0"
331
+ version = "8.0.0"
355
332
  source = "registry+https://github.com/rust-lang/crates.io-index"
356
- checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a"
333
+ checksum = "ae42c0555055784c70058d19ba8e275528e8a99a706684868ace5da4e716a4ab"
357
334
  dependencies = [
358
335
  "zstd-sys",
359
336
  ]
360
337
 
361
338
  [[package]]
362
339
  name = "zstd-sys"
363
- version = "2.0.10+zstd.1.5.6"
340
+ version = "2.1.0+zstd.1.5.7"
364
341
  source = "registry+https://github.com/rust-lang/crates.io-index"
365
- checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa"
342
+ checksum = "0ef0a8027ec3ee71300ab3bcbcd0393f434aa72b91ca6d635a39941deae8eea0"
366
343
  dependencies = [
367
344
  "cc",
368
345
  "pkg-config",
aedat-2.3.0/Cargo.toml ADDED
@@ -0,0 +1,22 @@
1
+ [package]
2
+ name = "aedat"
3
+ version = "2.3.0"
4
+ edition = "2021"
5
+ resolver = "2"
6
+ readme = "README.md"
7
+
8
+ [lib]
9
+ name = "aedat"
10
+ crate-type = ["cdylib"]
11
+
12
+ [dependencies]
13
+ flatbuffers = "25.12.19"
14
+ lz4 = "1.28.1"
15
+ numpy = "0.29.0"
16
+ pyo3 = {version = "0.29.2", features = ["extension-module"]}
17
+ roxmltree = "0.21.1"
18
+ zstd = "0.14.0"
19
+
20
+ [profile.release]
21
+ lto = true
22
+ codegen-units = 1
@@ -1,15 +1,15 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: aedat
3
- Version: 2.2.0
4
- Requires-Dist: numpy >=1.26
3
+ Version: 2.3.0
4
+ Requires-Dist: numpy>=1.26
5
5
  License-File: LICENSE
6
6
  Summary: A fast AEDAT4 decoder with an underlying Rust implementation
7
7
  Author: International Centre for Neuromorphic Systems, Alexandre Marcireau
8
8
  Requires-Python: >=3.9
9
9
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
10
+ Project-URL: documentation, https://github.com/neuromorphicsystems/aedat/
10
11
  Project-URL: homepage, https://github.com/neuromorphicsystems/aedat/
11
12
  Project-URL: repository, https://github.com/neuromorphicsystems/aedat/
12
- Project-URL: documentation, https://github.com/neuromorphicsystems/aedat/
13
13
 
14
14
  AEDAT is a fast AEDAT 4 python reader, with a Rust underlying implementation.
15
15
 
@@ -68,6 +68,8 @@ for packet in decoder:
68
68
  index += 1
69
69
  ```
70
70
 
71
+ The four `format` values are Pillow mode strings, so they can be passed to `PIL.Image.fromarray` directly.
72
+
71
73
  ### OpenCV
72
74
 
73
75
  ```py
@@ -86,6 +88,8 @@ for packet in decoder:
86
88
  index += 1
87
89
  ```
88
90
 
91
+ Only the color formats need a channel swap. `cv2.imwrite` writes `"L"` and `"I;16"` arrays as-is.
92
+
89
93
  ## Detailed example
90
94
 
91
95
  This is the same as the first example, with detailed comments:
@@ -129,7 +133,7 @@ for packet in decoder:
129
133
  ("t", "<u8"),
130
134
  ("x", "<u2"),
131
135
  ("y", "<u2"),
132
- ("on", "?"),
136
+ (("p", "on"), "?"),
133
137
  ]
134
138
  """
135
139
  print("{} polarity events".format(len(packet["events"])))
@@ -147,9 +151,16 @@ for packet in decoder:
147
151
  "height": <int>,
148
152
  "offset_x": <int>,
149
153
  "offset_y": <int>,
150
- "pixels": <numpy.array(shape=(height, width), dtype=uint8)>,
154
+ "pixels": <numpy.ndarray>,
151
155
  }
152
- format is one of "L", "RGB", "RGBA"
156
+ format is one of "L", "I;16", "RGB", "RGBA":
157
+ "L" OPENCV_8U_C1, pixels shape (H, W), dtype uint8
158
+ "I;16" OPENCV_16U_C1, pixels shape (H, W), dtype uint16
159
+ "RGB" OPENCV_8U_C3 or OPENCV_16U_C3, shape (H, W, 3), dtype uint8 or uint16
160
+ "RGBA" OPENCV_8U_C4 or OPENCV_16U_C4, shape (H, W, 4), dtype uint8 or uint16
161
+ File pixels are OpenCV BGR(A). The decoder swaps to RGB(A) to match Pillow.
162
+ DAVIS recordings from jAER store APS frames as OPENCV_16U_C1 ("I;16").
163
+ Unknown OpenCV type codes are skipped (a UserWarning is issued once) so events and IMU stay readable.
153
164
  """
154
165
  print("{} x {} frame".format(packet["frame"]["width"], packet["frame"]["height"]))
155
166
  elif "imus" in packet:
@@ -221,16 +232,26 @@ source .venv/bin/activate
221
232
  maturin develop # or maturin develop --release to build with optimizations
222
233
  ```
223
234
 
224
- After changing any of the files in _framebuffers_, one must run:
235
+ After changing any of the files in _flatbuffers_, one must run:
225
236
 
226
237
  ```sh
227
238
  flatc --rust -o src/ flatbuffers/*.fbs
228
239
  ```
229
240
 
230
- To format the code, run:
241
+ To run the tests, run:
242
+
243
+ ```sh
244
+ pip install --group dev
245
+ python -m pytest tests/
246
+ ```
247
+
248
+ To format and check the code, run:
231
249
 
232
250
  ```sh
233
251
  cargo fmt
252
+ ruff format
253
+ ruff check
254
+ ty check
234
255
  ```
235
256
 
236
257
  # Publish
@@ -55,6 +55,8 @@ for packet in decoder:
55
55
  index += 1
56
56
  ```
57
57
 
58
+ The four `format` values are Pillow mode strings, so they can be passed to `PIL.Image.fromarray` directly.
59
+
58
60
  ### OpenCV
59
61
 
60
62
  ```py
@@ -73,6 +75,8 @@ for packet in decoder:
73
75
  index += 1
74
76
  ```
75
77
 
78
+ Only the color formats need a channel swap. `cv2.imwrite` writes `"L"` and `"I;16"` arrays as-is.
79
+
76
80
  ## Detailed example
77
81
 
78
82
  This is the same as the first example, with detailed comments:
@@ -116,7 +120,7 @@ for packet in decoder:
116
120
  ("t", "<u8"),
117
121
  ("x", "<u2"),
118
122
  ("y", "<u2"),
119
- ("on", "?"),
123
+ (("p", "on"), "?"),
120
124
  ]
121
125
  """
122
126
  print("{} polarity events".format(len(packet["events"])))
@@ -134,9 +138,16 @@ for packet in decoder:
134
138
  "height": <int>,
135
139
  "offset_x": <int>,
136
140
  "offset_y": <int>,
137
- "pixels": <numpy.array(shape=(height, width), dtype=uint8)>,
141
+ "pixels": <numpy.ndarray>,
138
142
  }
139
- format is one of "L", "RGB", "RGBA"
143
+ format is one of "L", "I;16", "RGB", "RGBA":
144
+ "L" OPENCV_8U_C1, pixels shape (H, W), dtype uint8
145
+ "I;16" OPENCV_16U_C1, pixels shape (H, W), dtype uint16
146
+ "RGB" OPENCV_8U_C3 or OPENCV_16U_C3, shape (H, W, 3), dtype uint8 or uint16
147
+ "RGBA" OPENCV_8U_C4 or OPENCV_16U_C4, shape (H, W, 4), dtype uint8 or uint16
148
+ File pixels are OpenCV BGR(A). The decoder swaps to RGB(A) to match Pillow.
149
+ DAVIS recordings from jAER store APS frames as OPENCV_16U_C1 ("I;16").
150
+ Unknown OpenCV type codes are skipped (a UserWarning is issued once) so events and IMU stay readable.
140
151
  """
141
152
  print("{} x {} frame".format(packet["frame"]["width"], packet["frame"]["height"]))
142
153
  elif "imus" in packet:
@@ -208,16 +219,26 @@ source .venv/bin/activate
208
219
  maturin develop # or maturin develop --release to build with optimizations
209
220
  ```
210
221
 
211
- After changing any of the files in _framebuffers_, one must run:
222
+ After changing any of the files in _flatbuffers_, one must run:
212
223
 
213
224
  ```sh
214
225
  flatc --rust -o src/ flatbuffers/*.fbs
215
226
  ```
216
227
 
217
- To format the code, run:
228
+ To run the tests, run:
229
+
230
+ ```sh
231
+ pip install --group dev
232
+ python -m pytest tests/
233
+ ```
234
+
235
+ To format and check the code, run:
218
236
 
219
237
  ```sh
220
238
  cargo fmt
239
+ ruff format
240
+ ruff check
241
+ ty check
221
242
  ```
222
243
 
223
244
  # Publish
aedat-2.3.0/aedat.pyi ADDED
@@ -0,0 +1,8 @@
1
+ import pathlib
2
+ import typing
3
+
4
+ class Decoder:
5
+ def __init__(self, path: pathlib.Path | str | bytes) -> None: ...
6
+ def id_to_stream(self) -> dict[int, dict[str, typing.Any]]: ...
7
+ def __iter__(self) -> Decoder: ...
8
+ def __next__(self) -> dict[str, typing.Any]: ...
@@ -0,0 +1,28 @@
1
+ file_identifier "FRME";
2
+
3
+ // Values are OpenCV matrix type codes (CV_8UC1=0, CV_16UC1=2, …).
4
+ // Gray / Bgr / Bgra keep the names used by aedat 2.x; Gray16 is Davis APS.
5
+ enum FrameFormat : int8 {
6
+ Gray = 0, // OPENCV_8U_C1
7
+ Gray16 = 2, // OPENCV_16U_C1 (Davis APS: 10-bit ADC in little-endian uint16)
8
+ Bgr = 16, // OPENCV_8U_C3
9
+ Bgr16 = 18, // OPENCV_16U_C3
10
+ Bgra = 24, // OPENCV_8U_C4
11
+ Bgra16 = 26, // OPENCV_16U_C4
12
+ }
13
+
14
+ table Frame {
15
+ t: int64;
16
+ begin_t: int64;
17
+ end_t: int64;
18
+ exposure_begin_t: int64;
19
+ exposure_end_t: int64;
20
+ format : FrameFormat = Gray;
21
+ width: int16;
22
+ height: int16;
23
+ offset_x: int16;
24
+ offset_y: int16;
25
+ pixels: [uint8];
26
+ }
27
+
28
+ root_type Frame;
@@ -9,7 +9,7 @@ authors = [
9
9
  ]
10
10
  requires-python = ">=3.9"
11
11
  dependencies = ["numpy>=1.26"]
12
- version = "2.2.0"
12
+ version = "2.3.0"
13
13
 
14
14
  [project.urls]
15
15
  homepage = "https://github.com/neuromorphicsystems/aedat/"
@@ -17,5 +17,16 @@ repository = "https://github.com/neuromorphicsystems/aedat/"
17
17
  documentation = "https://github.com/neuromorphicsystems/aedat/"
18
18
 
19
19
  [build-system]
20
- requires = ["maturin==1.7.4", "numpy>=1.26"]
20
+ requires = ["maturin==1.15.0", "numpy>=1.26"]
21
21
  build-backend = "maturin"
22
+
23
+ [dependency-groups]
24
+ test = ["pytest==8.4.2"]
25
+ dev = [{include-group = "test"}, "ruff==0.16.8", "ty==0.0.82"]
26
+
27
+ [tool.ruff]
28
+ extend-exclude = ["*.md"]
29
+
30
+ [tool.ruff.lint]
31
+ extend-select = ["I"]
32
+