tonic 1.4.4.dev40__tar.gz → 1.4.4.dev43__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 (177) hide show
  1. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/.github/workflows/ci-pipeline.yml +8 -8
  2. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/ChangeLog +3 -0
  3. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/PKG-INFO +1 -1
  4. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/to_frame.py +21 -15
  5. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/slicers.py +16 -4
  6. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/transforms.py +32 -8
  7. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic.egg-info/PKG-INFO +1 -1
  8. tonic-1.4.4.dev43/tonic.egg-info/pbr.json +1 -0
  9. tonic-1.4.4.dev40/tonic.egg-info/pbr.json +0 -1
  10. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/.binder/requirements.txt +0 -0
  11. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/.coveragerc +0 -0
  12. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/.pre-commit-config.yaml +0 -0
  13. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/.readthedocs.yml +0 -0
  14. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/AUTHORS +0 -0
  15. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/LICENSE.txt +0 -0
  16. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/MANIFEST.in +0 -0
  17. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/README.md +0 -0
  18. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/Makefile +0 -0
  19. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/event-cameras/eventstream.png +0 -0
  20. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/event-cameras/framestream.png +0 -0
  21. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/event-cameras/receptive-fields.png +0 -0
  22. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/event-cameras/sampling-theorems.png +0 -0
  23. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/snn/neuron-models.png +0 -0
  24. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/snn/surrogates.png +0 -0
  25. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/tonic-logo-black-bg.png +0 -0
  26. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/tonic-logo-black.png +0 -0
  27. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/tonic-logo-white.png +0 -0
  28. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_static/tonic_favicon.png +0 -0
  29. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_templates/class_dataset.rst +0 -0
  30. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/_templates/class_transform.rst +0 -0
  31. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/about/about.rst +0 -0
  32. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/about/info.rst +0 -0
  33. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/about/prototype.rst +0 -0
  34. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/about/release_notes.rst +0 -0
  35. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/conf.py +0 -0
  36. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/datasets.rst +0 -0
  37. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/README.rst +0 -0
  38. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/representations/README.rst +0 -0
  39. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/representations/plot_tobinarep.py +0 -0
  40. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/representations/plot_toframe.py +0 -0
  41. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/representations/plot_toimage.py +0 -0
  42. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/representations/plot_totimesurface.py +0 -0
  43. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/representations/plot_tovoxelgrid.py +0 -0
  44. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/README.rst +0 -0
  45. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_centercrop.py +0 -0
  46. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_crop_time.py +0 -0
  47. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_decimation.py +0 -0
  48. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_denoise.py +0 -0
  49. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_downsample.py +0 -0
  50. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_drop_event.py +0 -0
  51. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_drop_event_by_area.py +0 -0
  52. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_drop_event_by_time.py +0 -0
  53. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_drop_pixel.py +0 -0
  54. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_event_downsampling.py +0 -0
  55. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_merge_polarities.py +0 -0
  56. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_random_crop.py +0 -0
  57. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_random_flip_lr.py +0 -0
  58. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_random_flip_ud.py +0 -0
  59. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_random_time_reversal.py +0 -0
  60. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_refractory_period.py +0 -0
  61. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_spatial_jitter.py +0 -0
  62. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_time_jitter.py +0 -0
  63. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/gallery/transformations/plot_uniform_noise.py +0 -0
  64. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/getting_involved/communication_channels.rst +0 -0
  65. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/getting_involved/contribute.rst +0 -0
  66. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/getting_involved/getting_involved.rst +0 -0
  67. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/getting_started/getting_started.rst +0 -0
  68. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/getting_started/install.rst +0 -0
  69. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/getting_started/nmnist.ipynb +0 -0
  70. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/how-tos/how-tos.rst +0 -0
  71. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/how-tos/loading-raw-events.ipynb +0 -0
  72. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/how-tos/visualizing-data.ipynb +0 -0
  73. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/how-tos/wrapping_own_data.ipynb +0 -0
  74. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/index.md +0 -0
  75. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/make.bat +0 -0
  76. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/reading_material/design_choices.rst +0 -0
  77. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/reading_material/intro-event-cameras.rst +0 -0
  78. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/reading_material/intro-snns.rst +0 -0
  79. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/reading_material/reading_material.rst +0 -0
  80. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/reading_material/training-snns.rst +0 -0
  81. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/requirements.txt +0 -0
  82. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/transformations.rst +0 -0
  83. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/tutorials/Aug_DiskCachDataset.ipynb +0 -0
  84. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/tutorials/audio_transforms_tutorial.ipynb +0 -0
  85. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/tutorials/batching.ipynb +0 -0
  86. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/tutorials/davis_data.ipynb +0 -0
  87. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/tutorials/fast_dataloading.ipynb +0 -0
  88. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/tutorials/large_datasets.ipynb +0 -0
  89. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/tutorials/slicing.ipynb +0 -0
  90. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/docs/tutorials/tutorials.rst +0 -0
  91. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/requirements.txt +0 -0
  92. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/setup.cfg +0 -0
  93. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/setup.py +0 -0
  94. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/dataset_utils.py +0 -0
  95. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/prototype_dataset_utils.py +0 -0
  96. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/requirements.txt +0 -0
  97. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_audio_augmentations.py +0 -0
  98. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_audio_transforms.py +0 -0
  99. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_aug_caching.py +0 -0
  100. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_caching.py +0 -0
  101. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_chained_transforms.py +0 -0
  102. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_data/sample.aedat4 +0 -0
  103. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_data/sample_aedat_header.aedat +0 -0
  104. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_data/sample_ncars.dat +0 -0
  105. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_data/sample_nmnist.bin +0 -0
  106. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_data/sample_stmnist.mat +0 -0
  107. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_datasets.py +0 -0
  108. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_dsec.py +0 -0
  109. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_io.py +0 -0
  110. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_prototype_datasets.py +0 -0
  111. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_representations.py +0 -0
  112. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_sliced_dataset.py +0 -0
  113. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_slicers.py +0 -0
  114. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_tonic_utils.py +0 -0
  115. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/test_transforms.py +0 -0
  116. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/torch_requirements.txt +0 -0
  117. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/test/utils.py +0 -0
  118. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/__init__.py +0 -0
  119. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/audio_augmentations.py +0 -0
  120. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/audio_transforms.py +0 -0
  121. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/cached_dataset.py +0 -0
  122. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/collation.py +0 -0
  123. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/dataset.py +0 -0
  124. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/__init__.py +0 -0
  125. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/asl_dvs.py +0 -0
  126. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/cifar10dvs.py +0 -0
  127. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/davisdataset.py +0 -0
  128. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/dsec.py +0 -0
  129. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/dvs_lips.py +0 -0
  130. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/dvsgesture.py +0 -0
  131. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/ebssa.py +0 -0
  132. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/hsd.py +0 -0
  133. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/mvsec.py +0 -0
  134. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/ncaltech101.py +0 -0
  135. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/nmnist.py +0 -0
  136. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/pokerdvs.py +0 -0
  137. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/s_mnist.py +0 -0
  138. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/threeET_eyetracking.py +0 -0
  139. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/tum_vie.py +0 -0
  140. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/datasets/visual_place_recognition.py +0 -0
  141. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/download_utils.py +0 -0
  142. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/__init__.py +0 -0
  143. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/crop.py +0 -0
  144. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/decimate.py +0 -0
  145. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/denoise.py +0 -0
  146. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/drop_event.py +0 -0
  147. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/drop_pixel.py +0 -0
  148. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/event_downsampling.py +0 -0
  149. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/refractory_period.py +0 -0
  150. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/spatial_jitter.py +0 -0
  151. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/time_jitter.py +0 -0
  152. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/time_skew.py +0 -0
  153. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/to_averaged_timesurface.py +0 -0
  154. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/to_bina_rep.py +0 -0
  155. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/to_timesurface.py +0 -0
  156. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/to_voxel_grid.py +0 -0
  157. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/functional/uniform_noise.py +0 -0
  158. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/io.py +0 -0
  159. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/README.md +0 -0
  160. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/__init__.py +0 -0
  161. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/datasets/__init__.py +0 -0
  162. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/datasets/ncars.py +0 -0
  163. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/datasets/nmnist.py +0 -0
  164. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/datasets/prophesee.py +0 -0
  165. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/datasets/stmnist.py +0 -0
  166. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/datasets/utils/__init__.py +0 -0
  167. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/datasets/utils/_dataset.py +0 -0
  168. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/datasets/utils/_utils.py +0 -0
  169. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/prototype/slicers.py +0 -0
  170. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/sliced_dataset.py +0 -0
  171. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic/utils.py +0 -0
  172. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic-logo-padded.png +0 -0
  173. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic.egg-info/SOURCES.txt +0 -0
  174. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic.egg-info/dependency_links.txt +0 -0
  175. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic.egg-info/not-zip-safe +0 -0
  176. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic.egg-info/requires.txt +0 -0
  177. {tonic-1.4.4.dev40 → tonic-1.4.4.dev43}/tonic.egg-info/top_level.txt +0 -0
@@ -11,12 +11,12 @@ jobs:
11
11
  os: [ubuntu-latest, windows-2022]
12
12
  python-version: ["3.8", "3.10", "3.11"]
13
13
  steps:
14
- - uses: actions/checkout@v3
14
+ - uses: actions/checkout@v4
15
15
  - if: matrix.os == 'ubuntu-latest'
16
16
  name: install audio library libsndfile
17
17
  run: sudo apt-get -y update && sudo apt-get install -y libsndfile1
18
18
  - name: Set up Python ${{ matrix.python-version }}
19
- uses: actions/setup-python@v3
19
+ uses: actions/setup-python@v5
20
20
  with:
21
21
  python-version: ${{ matrix.python-version }}
22
22
  - name: Install requirements
@@ -33,11 +33,11 @@ jobs:
33
33
  needs: multitest
34
34
  runs-on: ubuntu-latest
35
35
  steps:
36
- - uses: actions/checkout@v3
36
+ - uses: actions/checkout@v4
37
37
  - name: install audio library libsndfile
38
38
  run: sudo apt-get -y update && sudo apt-get install -y libsndfile1
39
39
  - name: Setup Python 3.9
40
- uses: actions/setup-python@v3
40
+ uses: actions/setup-python@v5
41
41
  with:
42
42
  python-version: 3.9
43
43
  - name: Generate coverage report
@@ -54,11 +54,11 @@ jobs:
54
54
  needs: multitest
55
55
  runs-on: ubuntu-latest
56
56
  steps:
57
- - uses: actions/checkout@v3
57
+ - uses: actions/checkout@v4
58
58
  - name: install audio library libsndfile
59
59
  run: sudo apt-get -y update && sudo apt-get install -y libsndfile1
60
60
  - name: Setup Python 3.9
61
- uses: actions/setup-python@v3
61
+ uses: actions/setup-python@v5
62
62
  with:
63
63
  python-version: 3.9
64
64
  - name: Install dependencies
@@ -74,13 +74,13 @@ jobs:
74
74
  if: github.event_name == 'push'
75
75
  runs-on: ubuntu-latest
76
76
  steps:
77
- - uses: actions/checkout@v3
77
+ - uses: actions/checkout@v4
78
78
  with:
79
79
  fetch-depth: 0
80
80
  - name: install audio library libsndfile
81
81
  run: sudo apt-get -y update && sudo apt-get install -y libsndfile1
82
82
  - name: Set up Python 3.9
83
- uses: actions/setup-python@v3
83
+ uses: actions/setup-python@v5
84
84
  with:
85
85
  python-version: 3.9
86
86
  - name: Install wheel
@@ -1,6 +1,9 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
+ * add start\_time and end\_time to ToFrame
5
+ * Update ci-pipeline.yml
6
+ * Update ci-pipeline.yml
4
7
  * pin numpy version <2
5
8
  * adding numpy to test requirements
6
9
  * change np.product to np.prod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tonic
3
- Version: 1.4.4.dev40
3
+ Version: 1.4.4.dev43
4
4
  Summary: Neuromorphic datasets and transformations.
5
5
  Home-page: UNKNOWN
6
6
  Author: The Neuromorphs of Telluride
@@ -9,14 +9,16 @@ from tonic.slicers import (
9
9
 
10
10
 
11
11
  def to_frame_numpy(
12
- events,
13
- sensor_size,
14
- time_window=None,
15
- event_count=None,
16
- n_time_bins=None,
17
- n_event_bins=None,
18
- overlap=0.0,
19
- include_incomplete=False,
12
+ events,
13
+ sensor_size,
14
+ time_window=None,
15
+ event_count=None,
16
+ n_time_bins=None,
17
+ n_event_bins=None,
18
+ overlap=0.0,
19
+ include_incomplete=False,
20
+ start_time=None,
21
+ end_time=None,
20
22
  ):
21
23
  """Accumulate events to frames by slicing along constant time (time_window), constant number of
22
24
  events (event_count) or constant number of frames (n_time_bins / n_event_bins).
@@ -37,11 +39,11 @@ def to_frame_numpy(
37
39
  assert "x" and "t" and "p" in events.dtype.names
38
40
 
39
41
  if (
40
- not sum(
41
- param is not None
42
- for param in [time_window, event_count, n_time_bins, n_event_bins]
43
- )
44
- == 1
42
+ not sum(
43
+ param is not None
44
+ for param in [time_window, event_count, n_time_bins, n_event_bins]
45
+ )
46
+ == 1
45
47
  ):
46
48
  raise ValueError(
47
49
  "Please assign a value to exactly one of the parameters time_window,"
@@ -67,7 +69,12 @@ def to_frame_numpy(
67
69
 
68
70
  if time_window:
69
71
  event_slices = slice_events_by_time(
70
- events, time_window, overlap=overlap, include_incomplete=include_incomplete
72
+ events,
73
+ time_window,
74
+ overlap=overlap,
75
+ include_incomplete=include_incomplete,
76
+ start_time=start_time,
77
+ end_time=end_time,
71
78
  )
72
79
  elif event_count:
73
80
  event_slices = slice_events_by_count(
@@ -93,4 +100,3 @@ def to_frame_numpy(
93
100
  for i, event_slice in enumerate(event_slices):
94
101
  np.add.at(frames, (i, event_slice["p"].astype(int), event_slice["x"]), 1)
95
102
  return frames
96
-
@@ -71,6 +71,8 @@ class SliceByTime:
71
71
  time_window: float
72
72
  overlap: float = 0.0
73
73
  include_incomplete: bool = False
74
+ start_time: float = None
75
+ end_time: float = None
74
76
 
75
77
  def slice(self, data: np.ndarray, targets: int) -> List[np.ndarray]:
76
78
  metadata = self.get_slice_metadata(data, targets)
@@ -83,13 +85,17 @@ class SliceByTime:
83
85
  stride = self.time_window - self.overlap
84
86
  assert stride > 0
85
87
 
88
+ start_time = t[0] if self.start_time is None else self.start_time
89
+ end_time = t[-1] if self.end_time is None else self.end_time
90
+ duration = end_time - start_time
91
+
86
92
  if self.include_incomplete:
87
- n_slices = int(np.ceil(((t[-1] - t[0]) - self.time_window) / stride) + 1)
93
+ n_slices = int(np.ceil((duration - self.time_window) / stride) + 1)
88
94
  else:
89
- n_slices = int(np.floor(((t[-1] - t[0]) - self.time_window) / stride) + 1)
95
+ n_slices = int(np.floor((duration - self.time_window) / stride) + 1)
90
96
  n_slices = max(n_slices, 1) # for strides larger than recording time
91
97
 
92
- window_start_times = np.arange(n_slices) * stride + t[0]
98
+ window_start_times = np.arange(n_slices) * stride + start_time
93
99
  window_end_times = window_start_times + self.time_window
94
100
  indices_start = np.searchsorted(t, window_start_times)[:n_slices]
95
101
  indices_end = np.searchsorted(t, window_end_times)[:n_slices]
@@ -293,9 +299,15 @@ def slice_events_by_time(
293
299
  time_window: int,
294
300
  overlap: int = 0,
295
301
  include_incomplete: bool = False,
302
+ start_time=None,
303
+ end_time=None,
296
304
  ):
297
305
  return SliceByTime(
298
- time_window=time_window, overlap=overlap, include_incomplete=include_incomplete
306
+ time_window=time_window,
307
+ overlap=overlap,
308
+ include_incomplete=include_incomplete,
309
+ start_time=start_time,
310
+ end_time=end_time,
299
311
  ).slice(events, None)[0]
300
312
 
301
313
 
@@ -61,7 +61,7 @@ class CenterCrop:
61
61
  if type(self.size) == int:
62
62
  self.size = [self.size, self.size]
63
63
  offsets = (self.sensor_size[0] - self.size[0]) // 2, (
64
- self.sensor_size[1] - self.size[1]
64
+ self.sensor_size[1] - self.size[1]
65
65
  ) // 2
66
66
  offset_idx = [max(offset, 0) for offset in offsets]
67
67
  cropped_events = events[
@@ -69,7 +69,7 @@ class CenterCrop:
69
69
  & (events["x"] < (offset_idx[0] + self.size[0]))
70
70
  & (offset_idx[1] <= events["y"])
71
71
  & (events["y"] < (offset_idx[1] + self.size[1]))
72
- ]
72
+ ]
73
73
  cropped_events["x"] -= offsets[0]
74
74
  cropped_events["y"] -= offsets[1]
75
75
  return cropped_events
@@ -229,7 +229,7 @@ class DropPixel:
229
229
 
230
230
  def __call__(self, events):
231
231
  if len(events) == 0:
232
- return events # return empty array
232
+ return events # return empty array
233
233
 
234
234
  if events.dtype.names is not None:
235
235
  # assert "x", "y", "p" in events.dtype.names
@@ -788,10 +788,10 @@ class NumpyAsType:
788
788
 
789
789
  def __call__(self, events):
790
790
  source_is_structured_array = (
791
- hasattr(events.dtype, "names") and events.dtype.names != None
791
+ hasattr(events.dtype, "names") and events.dtype.names != None
792
792
  )
793
793
  target_is_structured_array = (
794
- hasattr(self.dtype, "names") and self.dtype.names != None
794
+ hasattr(self.dtype, "names") and self.dtype.names != None
795
795
  )
796
796
  if source_is_structured_array and not target_is_structured_array:
797
797
  return np.lib.recfunctions.structured_to_unstructured(events, self.dtype)
@@ -880,6 +880,10 @@ class ToFrame:
880
880
  overlap is defined by the fraction of a bin between 0 and 1.
881
881
  include_incomplete (bool): If True, includes overhang slice when time_window or event_count is specified.
882
882
  Not valid for bin_count methods.
883
+ start_time (float): Optional start time if some empty frames are expected in the beginning. If omitted, the
884
+ start time is the timestamp of the first event for that sample.
885
+ end_time (float): Optional end time if some empty frames are expected in the end. If omitted, the end time
886
+ is the timestamp of the last event for that sample.
883
887
 
884
888
  Example:
885
889
  >>> from tonic.transforms import ToFrame
@@ -895,17 +899,35 @@ class ToFrame:
895
899
  n_event_bins: Optional[int] = None
896
900
  overlap: float = 0
897
901
  include_incomplete: bool = False
902
+ start_time: Optional[float] = None
903
+ end_time: Optional[float] = None
898
904
 
899
905
  def __call__(self, events):
900
906
 
901
907
  # if events are empty, return a frame in the expected format
902
908
  if len(events) == 0:
903
909
  if self.time_window is not None or self.event_count is not None:
904
- return np.zeros((1, self.sensor_size[2], self.sensor_size[0], self.sensor_size[1]))
910
+ return np.zeros(
911
+ (1, self.sensor_size[2], self.sensor_size[0], self.sensor_size[1])
912
+ )
905
913
  elif self.n_event_bins is not None:
906
- return np.zeros((self.n_event_bins, self.sensor_size[2], self.sensor_size[0], self.sensor_size[1]))
914
+ return np.zeros(
915
+ (
916
+ self.n_event_bins,
917
+ self.sensor_size[2],
918
+ self.sensor_size[0],
919
+ self.sensor_size[1],
920
+ )
921
+ )
907
922
  elif self.n_time_bins is not None:
908
- return np.zeros((self.n_time_bins, self.sensor_size[2], self.sensor_size[0], self.sensor_size[1]))
923
+ return np.zeros(
924
+ (
925
+ self.n_time_bins,
926
+ self.sensor_size[2],
927
+ self.sensor_size[0],
928
+ self.sensor_size[1],
929
+ )
930
+ )
909
931
  else:
910
932
  raise ValueError("No slicing method specified.")
911
933
 
@@ -919,6 +941,8 @@ class ToFrame:
919
941
  n_event_bins=self.n_event_bins,
920
942
  overlap=self.overlap,
921
943
  include_incomplete=self.include_incomplete,
944
+ start_time=self.start_time,
945
+ end_time=self.end_time,
922
946
  )
923
947
 
924
948
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tonic
3
- Version: 1.4.4.dev40
3
+ Version: 1.4.4.dev43
4
4
  Summary: Neuromorphic datasets and transformations.
5
5
  Home-page: UNKNOWN
6
6
  Author: The Neuromorphs of Telluride
@@ -0,0 +1 @@
1
+ {"git_version": "7bb2384", "is_release": false}
@@ -1 +0,0 @@
1
- {"git_version": "3326802", "is_release": false}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes