anndata 0.11.4__tar.gz → 0.12.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 (209) hide show
  1. {anndata-0.11.4 → anndata-0.12.0}/.github/ISSUE_TEMPLATE/bug-report.yml +10 -2
  2. anndata-0.12.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. anndata-0.12.0/.github/ISSUE_TEMPLATE/question.yml +14 -0
  4. anndata-0.12.0/.github/workflows/test-cpu.yml +125 -0
  5. {anndata-0.11.4 → anndata-0.12.0}/.github/workflows/test-gpu.yml +2 -1
  6. {anndata-0.11.4 → anndata-0.12.0}/.gitignore +2 -0
  7. {anndata-0.11.4 → anndata-0.12.0}/.pre-commit-config.yaml +6 -2
  8. {anndata-0.11.4 → anndata-0.12.0}/.readthedocs.yml +1 -1
  9. {anndata-0.11.4 → anndata-0.12.0}/LICENSE +1 -1
  10. {anndata-0.11.4 → anndata-0.12.0}/PKG-INFO +48 -41
  11. {anndata-0.11.4 → anndata-0.12.0}/README.md +1 -1
  12. {anndata-0.11.4 → anndata-0.12.0}/benchmarks/asv.conf.json +1 -23
  13. {anndata-0.11.4 → anndata-0.12.0}/benchmarks/benchmarks/anndata.py +8 -2
  14. {anndata-0.11.4 → anndata-0.12.0}/benchmarks/benchmarks/readwrite.py +9 -8
  15. {anndata-0.11.4 → anndata-0.12.0}/benchmarks/benchmarks/sparse_dataset.py +15 -11
  16. {anndata-0.11.4 → anndata-0.12.0}/benchmarks/benchmarks/utils.py +0 -16
  17. {anndata-0.11.4 → anndata-0.12.0}/biome.jsonc +2 -2
  18. {anndata-0.11.4 → anndata-0.12.0}/ci/scripts/min-deps.py +14 -10
  19. {anndata-0.11.4 → anndata-0.12.0}/docs/api.md +39 -1
  20. {anndata-0.11.4 → anndata-0.12.0}/docs/conf.py +39 -5
  21. anndata-0.12.0/docs/extensions/autosummary_skip_inherited.py +55 -0
  22. {anndata-0.11.4 → anndata-0.12.0}/docs/extensions/no_skip_abc_members.py +2 -2
  23. {anndata-0.11.4 → anndata-0.12.0}/docs/fileformat-prose.md +1 -1
  24. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.11.0.md +1 -1
  25. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.11.1.md +2 -2
  26. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.11.2.md +1 -1
  27. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.11.3.md +1 -1
  28. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.11.4.md +2 -2
  29. anndata-0.12.0/docs/release-notes/0.12.0.md +6 -0
  30. anndata-0.12.0/docs/release-notes/0.12.0rc1.md +26 -0
  31. anndata-0.12.0/docs/release-notes/0.12.0rc2.md +14 -0
  32. anndata-0.12.0/docs/release-notes/0.12.0rc3.md +6 -0
  33. anndata-0.12.0/docs/release-notes/0.12.0rc4.md +19 -0
  34. {anndata-0.11.4 → anndata-0.12.0}/docs/tutorials/index.md +2 -0
  35. anndata-0.12.0/docs/tutorials/zarr-v3.md +122 -0
  36. {anndata-0.11.4 → anndata-0.12.0}/hatch.toml +10 -3
  37. {anndata-0.11.4 → anndata-0.12.0}/pyproject.toml +68 -48
  38. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/__init__.py +17 -40
  39. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/access.py +1 -1
  40. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/aligned_df.py +49 -7
  41. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/aligned_mapping.py +11 -4
  42. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/anndata.py +169 -135
  43. anndata-0.12.0/src/anndata/_core/extensions.py +276 -0
  44. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/file_backing.py +13 -6
  45. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/index.py +20 -14
  46. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/merge.py +436 -87
  47. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/raw.py +1 -4
  48. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/sparse_dataset.py +71 -35
  49. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/storage.py +20 -12
  50. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/views.py +19 -7
  51. anndata-0.12.0/src/anndata/_core/xarray.py +404 -0
  52. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_io/__init__.py +3 -3
  53. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_io/h5ad.py +12 -13
  54. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_io/read.py +41 -25
  55. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_io/specs/__init__.py +8 -8
  56. anndata-0.12.0/src/anndata/_io/specs/lazy_methods.py +370 -0
  57. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_io/specs/methods.py +194 -70
  58. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_io/specs/registry.py +69 -35
  59. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_io/utils.py +32 -19
  60. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_io/write.py +24 -16
  61. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_io/zarr.py +37 -18
  62. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_settings.py +39 -35
  63. anndata-0.12.0/src/anndata/_settings.pyi +49 -0
  64. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_types.py +67 -40
  65. anndata-0.12.0/src/anndata/_version.py +62 -0
  66. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_warnings.py +0 -6
  67. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/abc.py +2 -2
  68. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/compat/__init__.py +72 -134
  69. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/experimental/__init__.py +23 -9
  70. anndata-0.12.0/src/anndata/experimental/backed/__init__.py +7 -0
  71. anndata-0.12.0/src/anndata/experimental/backed/_compat.py +18 -0
  72. anndata-0.12.0/src/anndata/experimental/backed/_io.py +156 -0
  73. anndata-0.12.0/src/anndata/experimental/backed/_lazy_arrays.py +197 -0
  74. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/experimental/merge.py +28 -24
  75. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/experimental/multi_files/_anncollection.py +47 -53
  76. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/experimental/pytorch/_annloader.py +38 -15
  77. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/io.py +4 -19
  78. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/logging.py +12 -7
  79. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/tests/helpers.py +236 -155
  80. anndata-0.12.0/src/anndata/types.py +22 -0
  81. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/typing.py +5 -5
  82. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/utils.py +35 -26
  83. anndata-0.12.0/src/testing/anndata/_doctest.py +16 -0
  84. {anndata-0.11.4 → anndata-0.12.0}/src/testing/anndata/_pytest.py +12 -5
  85. {anndata-0.11.4 → anndata-0.12.0}/tests/conftest.py +33 -1
  86. anndata-0.12.0/tests/lazy/conftest.py +260 -0
  87. anndata-0.12.0/tests/lazy/test_concat.py +323 -0
  88. anndata-0.12.0/tests/lazy/test_read.py +184 -0
  89. anndata-0.12.0/tests/lazy/test_write.py +46 -0
  90. {anndata-0.11.4 → anndata-0.12.0}/tests/test_awkward.py +2 -1
  91. {anndata-0.11.4 → anndata-0.12.0}/tests/test_backed_dense.py +2 -6
  92. {anndata-0.11.4 → anndata-0.12.0}/tests/test_backed_hdf5.py +12 -6
  93. {anndata-0.11.4 → anndata-0.12.0}/tests/test_backed_sparse.py +98 -83
  94. {anndata-0.11.4 → anndata-0.12.0}/tests/test_base.py +41 -29
  95. {anndata-0.11.4 → anndata-0.12.0}/tests/test_concatenate.py +230 -83
  96. {anndata-0.11.4 → anndata-0.12.0}/tests/test_concatenate_disk.py +14 -6
  97. {anndata-0.11.4 → anndata-0.12.0}/tests/test_dask.py +2 -5
  98. {anndata-0.11.4 → anndata-0.12.0}/tests/test_dask_view_mem.py +5 -7
  99. {anndata-0.11.4 → anndata-0.12.0}/tests/test_deprecations.py +9 -20
  100. anndata-0.12.0/tests/test_extensions.py +229 -0
  101. {anndata-0.11.4 → anndata-0.12.0}/tests/test_helpers.py +2 -34
  102. {anndata-0.11.4 → anndata-0.12.0}/tests/test_io_backwards_compat.py +7 -7
  103. {anndata-0.11.4 → anndata-0.12.0}/tests/test_io_conversion.py +4 -4
  104. {anndata-0.11.4 → anndata-0.12.0}/tests/test_io_dispatched.py +72 -34
  105. {anndata-0.11.4 → anndata-0.12.0}/tests/test_io_elementwise.py +85 -85
  106. {anndata-0.11.4 → anndata-0.12.0}/tests/test_io_partial.py +25 -20
  107. {anndata-0.11.4 → anndata-0.12.0}/tests/test_io_utils.py +5 -9
  108. {anndata-0.11.4 → anndata-0.12.0}/tests/test_io_warnings.py +14 -20
  109. {anndata-0.11.4 → anndata-0.12.0}/tests/test_obsmvarm.py +27 -1
  110. {anndata-0.11.4 → anndata-0.12.0}/tests/test_readwrite.py +193 -62
  111. {anndata-0.11.4 → anndata-0.12.0}/tests/test_repr.py +1 -1
  112. {anndata-0.11.4 → anndata-0.12.0}/tests/test_settings.py +48 -26
  113. {anndata-0.11.4 → anndata-0.12.0}/tests/test_structured_arrays.py +6 -9
  114. {anndata-0.11.4 → anndata-0.12.0}/tests/test_transpose.py +1 -3
  115. {anndata-0.11.4 → anndata-0.12.0}/tests/test_utils.py +4 -2
  116. {anndata-0.11.4 → anndata-0.12.0}/tests/test_views.py +17 -23
  117. {anndata-0.11.4 → anndata-0.12.0}/tests/test_x.py +8 -13
  118. anndata-0.12.0/tests/test_xarray.py +320 -0
  119. anndata-0.11.4/.github/ISSUE_TEMPLATE/config.yml +0 -8
  120. anndata-0.11.4/.github/workflows/test-cpu.yml +0 -124
  121. anndata-0.11.4/src/anndata/_io/specs/lazy_methods.py +0 -186
  122. anndata-0.11.4/src/anndata/_version.py +0 -37
  123. anndata-0.11.4/src/anndata/compat/exceptiongroups.py +0 -14
  124. {anndata-0.11.4 → anndata-0.12.0}/.cirun.yml +0 -0
  125. {anndata-0.11.4 → anndata-0.12.0}/.codecov.yml +0 -0
  126. {anndata-0.11.4 → anndata-0.12.0}/.editorconfig +0 -0
  127. {anndata-0.11.4 → anndata-0.12.0}/.github/ISSUE_TEMPLATE/enhancement-request.yml +0 -0
  128. {anndata-0.11.4 → anndata-0.12.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  129. {anndata-0.11.4 → anndata-0.12.0}/.github/workflows/benchmark.yml +0 -0
  130. {anndata-0.11.4 → anndata-0.12.0}/.github/workflows/check-pr-milestoned.yml +0 -0
  131. {anndata-0.11.4 → anndata-0.12.0}/.github/workflows/close-stale.yml +0 -0
  132. {anndata-0.11.4 → anndata-0.12.0}/.github/workflows/codespell.yml +0 -0
  133. {anndata-0.11.4 → anndata-0.12.0}/.github/workflows/label-stale.yml +0 -0
  134. {anndata-0.11.4 → anndata-0.12.0}/.github/workflows/publish.yml +0 -0
  135. {anndata-0.11.4 → anndata-0.12.0}/.gitmodules +0 -0
  136. {anndata-0.11.4 → anndata-0.12.0}/.prettierignore +0 -0
  137. {anndata-0.11.4 → anndata-0.12.0}/.prettierrc.yaml +0 -0
  138. {anndata-0.11.4 → anndata-0.12.0}/.taplo.toml +0 -0
  139. {anndata-0.11.4 → anndata-0.12.0}/.vscode/launch.json +0 -0
  140. {anndata-0.11.4 → anndata-0.12.0}/.vscode/settings.json +0 -0
  141. {anndata-0.11.4 → anndata-0.12.0}/benchmarks/README.md +0 -0
  142. {anndata-0.11.4 → anndata-0.12.0}/benchmarks/benchmarks/__init__.py +0 -0
  143. {anndata-0.11.4 → anndata-0.12.0}/ci/constraints.txt +0 -0
  144. {anndata-0.11.4 → anndata-0.12.0}/ci/scripts/towncrier_automation.py +0 -0
  145. {anndata-0.11.4 → anndata-0.12.0}/docs/Makefile +0 -0
  146. {anndata-0.11.4 → anndata-0.12.0}/docs/_key_contributors.rst +0 -0
  147. {anndata-0.11.4 → anndata-0.12.0}/docs/_static/img/anndata_schema.svg +0 -0
  148. {anndata-0.11.4 → anndata-0.12.0}/docs/_templates/autosummary/class.rst +0 -0
  149. {anndata-0.11.4 → anndata-0.12.0}/docs/benchmark-read-write.ipynb +0 -0
  150. {anndata-0.11.4 → anndata-0.12.0}/docs/benchmarks.md +0 -0
  151. {anndata-0.11.4 → anndata-0.12.0}/docs/concatenation.rst +0 -0
  152. {anndata-0.11.4 → anndata-0.12.0}/docs/contributing.md +0 -0
  153. {anndata-0.11.4 → anndata-0.12.0}/docs/extensions/patch_myst_cite.py +0 -0
  154. {anndata-0.11.4 → anndata-0.12.0}/docs/index.md +0 -0
  155. {anndata-0.11.4 → anndata-0.12.0}/docs/interoperability.md +0 -0
  156. {anndata-0.11.4 → anndata-0.12.0}/docs/news.md +0 -0
  157. {anndata-0.11.4 → anndata-0.12.0}/docs/references.rst +0 -0
  158. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.0.md +0 -0
  159. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.1.md +0 -0
  160. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.2.md +0 -0
  161. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.3.md +0 -0
  162. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.4.md +0 -0
  163. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.5.md +0 -0
  164. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.6.md +0 -0
  165. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.7.md +0 -0
  166. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.8.md +0 -0
  167. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.10.9.md +0 -0
  168. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.4.0.md +0 -0
  169. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.5.0.md +0 -0
  170. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.6.0.md +0 -0
  171. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.6.x.md +0 -0
  172. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.7.0.md +0 -0
  173. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.7.2.md +0 -0
  174. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.7.3.md +0 -0
  175. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.7.4.md +0 -0
  176. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.7.5.md +0 -0
  177. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.7.6.md +0 -0
  178. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.7.7.md +0 -0
  179. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.7.8.md +0 -0
  180. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.8.0.md +0 -0
  181. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.9.0.md +0 -0
  182. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.9.1.md +0 -0
  183. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/0.9.2.md +0 -0
  184. {anndata-0.11.4 → anndata-0.12.0}/docs/release-notes/index.md +0 -0
  185. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/_core/__init__.py +0 -0
  186. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/experimental/_dispatch_io.py +0 -0
  187. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/experimental/multi_files/__init__.py +0 -0
  188. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/experimental/pytorch/__init__.py +0 -0
  189. {anndata-0.11.4 → anndata-0.12.0}/src/anndata/tests/__init__.py +0 -0
  190. {anndata-0.11.4 → anndata-0.12.0}/src/testing/anndata/__init__.py +0 -0
  191. {anndata-0.11.4 → anndata-0.12.0}/src/testing/anndata/py.typed +0 -0
  192. {anndata-0.11.4 → anndata-0.12.0}/tests/data/adata-comments.tsv +0 -0
  193. {anndata-0.11.4 → anndata-0.12.0}/tests/data/adata.csv +0 -0
  194. {anndata-0.11.4 → anndata-0.12.0}/tests/data/archives/readme.md +0 -0
  195. {anndata-0.11.4 → anndata-0.12.0}/tests/data/archives/v0.7.0/adata.h5ad +0 -0
  196. {anndata-0.11.4 → anndata-0.12.0}/tests/data/archives/v0.7.0/adata.zarr.zip +0 -0
  197. {anndata-0.11.4 → anndata-0.12.0}/tests/data/archives/v0.7.8/adata.h5ad +0 -0
  198. {anndata-0.11.4 → anndata-0.12.0}/tests/data/archives/v0.7.8/adata.zarr.zip +0 -0
  199. {anndata-0.11.4 → anndata-0.12.0}/tests/data/excel.xlsx +0 -0
  200. {anndata-0.11.4 → anndata-0.12.0}/tests/data/umi_tools.tsv.gz +0 -0
  201. {anndata-0.11.4 → anndata-0.12.0}/tests/test_anncollection.py +0 -0
  202. {anndata-0.11.4 → anndata-0.12.0}/tests/test_annot.py +0 -0
  203. {anndata-0.11.4 → anndata-0.12.0}/tests/test_get_vector.py +0 -0
  204. {anndata-0.11.4 → anndata-0.12.0}/tests/test_gpu.py +0 -0
  205. {anndata-0.11.4 → anndata-0.12.0}/tests/test_inplace_subset.py +0 -0
  206. {anndata-0.11.4 → anndata-0.12.0}/tests/test_layers.py +0 -0
  207. {anndata-0.11.4 → anndata-0.12.0}/tests/test_obspvarp.py +0 -0
  208. {anndata-0.11.4 → anndata-0.12.0}/tests/test_raw.py +0 -0
  209. {anndata-0.11.4 → anndata-0.12.0}/tests/test_uns.py +0 -0
@@ -53,10 +53,18 @@ body:
53
53
  description: |
54
54
  Which version of anndata and other related software you used.
55
55
 
56
- Please install `session-info`, run the following command, then paste the results into the text box below.
56
+ Please install `session-info2`, run the following command in a notebook,
57
+ click the “Copy as Markdown” button,
58
+ then paste the results into the text box below.
57
59
 
58
60
  ```python
59
- >>> import anndata, session_info; session_info.show(html=False, dependencies=True)
61
+ In[1]: import anndata, session_info2; session_info2.session_info(dependencies=True)
62
+ ```
63
+
64
+ Alternatively, run this in a console:
65
+
66
+ ```python
67
+ >>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
60
68
  ```
61
69
  render: python
62
70
  validations:
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Scverse Community Forum
4
+ url: https://discourse.scverse.org/
5
+ about: If you have questions about “How to do X”, please ask them here.
@@ -0,0 +1,14 @@
1
+ name: Technical question
2
+ description: You wonder about a design decision or implementation detail?
3
+ #title: ...
4
+ labels:
5
+ - question
6
+ #assignees: []
7
+ body:
8
+ - type: textarea
9
+ id: description
10
+ attributes:
11
+ label: Question
12
+ description: If you have *usage* question, please visit the [Scverse Community Forum](https://discourse.scverse.org/) instead.
13
+ validations:
14
+ required: true
@@ -0,0 +1,125 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - "[0-9]+.[0-9]+.x"
8
+ pull_request:
9
+
10
+ env:
11
+ FORCE_COLOR: "1"
12
+
13
+ defaults:
14
+ run:
15
+ shell: bash -el {0}
16
+
17
+ # Cancel the job if new commits are pushed
18
+ # https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
19
+ concurrency:
20
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21
+ cancel-in-progress: true
22
+
23
+ jobs:
24
+ get-environments:
25
+ runs-on: ubuntu-latest
26
+ outputs:
27
+ envs: ${{ steps.get-envs.outputs.envs }}
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ filter: blob:none
32
+ fetch-depth: 0
33
+ - uses: astral-sh/setup-uv@v5
34
+ with:
35
+ enable-cache: false
36
+ - id: get-envs
37
+ run: |
38
+ ENVS_JSON=$(NO_COLOR=1 uvx hatch env show --json | jq -c 'to_entries
39
+ | map(
40
+ select(.key | startswith("hatch-test"))
41
+ | { name: .key, python: .value.python }
42
+ )')
43
+ echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
44
+ test:
45
+ needs: get-environments
46
+ runs-on: ubuntu-latest
47
+ strategy:
48
+ matrix:
49
+ env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
50
+ io_mark: ["zarr_io", "not zarr_io"]
51
+ env: # environment variable for use in codecov’s env_vars tagging
52
+ ENV_NAME: ${{ matrix.env.name }}
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ with:
56
+ fetch-depth: 0
57
+ filter: blob:none
58
+
59
+ - name: Set up Python ${{ matrix.env.python }}
60
+ uses: actions/setup-python@v5
61
+ with:
62
+ python-version: ${{ matrix.env.python }}
63
+
64
+ - name: Install UV
65
+ uses: astral-sh/setup-uv@v5
66
+ with:
67
+ enable-cache: true
68
+ cache-dependency-glob: pyproject.toml
69
+
70
+ - name: Install dependencies
71
+ run: uvx hatch -v env create ${{ matrix.env.name }}
72
+
73
+ - name: Run tests
74
+ run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto --cov --cov-report=xml --junitxml=test-data/test-results.xml -m "${{matrix.io_mark}}"
75
+
76
+ - name: Upload coverage data
77
+ uses: codecov/codecov-action@v5
78
+ with:
79
+ token: ${{ secrets.CODECOV_TOKEN }}
80
+ env_vars: ENV_NAME
81
+ fail_ci_if_error: true
82
+ files: test-data/coverage.xml
83
+
84
+ build:
85
+ runs-on: ubuntu-22.04
86
+ steps:
87
+ - uses: actions/checkout@v4
88
+ with:
89
+ fetch-depth: 0
90
+ filter: blob:none
91
+
92
+ - name: Set up Python 3.13
93
+ uses: actions/setup-python@v5
94
+ with:
95
+ python-version: '3.13'
96
+
97
+ - name: Install build tools and requirements
98
+ run: |
99
+ python -m pip install --upgrade pip
100
+ pip install build twine
101
+
102
+ - name: Display installed versions
103
+ run: pip list
104
+
105
+ - name: Build & Twine check
106
+ run: |
107
+ python -m build --sdist --wheel .
108
+ twine check dist/*
109
+
110
+ - name: Check runtime version
111
+ run: |
112
+ pip install dist/*.whl
113
+ python -c 'import anndata; print(anndata.__version__)'
114
+
115
+ check:
116
+ if: always()
117
+ needs:
118
+ - get-environments
119
+ - test
120
+ - build
121
+ runs-on: ubuntu-latest
122
+ steps:
123
+ - uses: re-actors/alls-green@release/v1
124
+ with:
125
+ jobs: ${{ toJSON(needs) }}
@@ -69,7 +69,8 @@ jobs:
69
69
  - name: Install Python
70
70
  uses: actions/setup-python@v5
71
71
  with:
72
- python-version: ${{ env.max_python_version }}
72
+ # https://github.com/cupy/cupy/issues/8651 cupy does not support python3.13 yet
73
+ python-version: "3.12"
73
74
 
74
75
  - name: Install UV
75
76
  uses: astral-sh/setup-uv@v5
@@ -7,10 +7,12 @@ __pycache__/
7
7
  /*cache/
8
8
  /node_modules/
9
9
  /data/
10
+ /venv/
10
11
 
11
12
  # Distribution / packaging
12
13
  /dist/
13
14
  /ci/min-deps.txt
15
+ /ci/pre-deps.txt
14
16
  /requirements*.lock
15
17
  /.python-version
16
18
 
@@ -1,12 +1,16 @@
1
1
  repos:
2
2
  - repo: https://github.com/astral-sh/ruff-pre-commit
3
- rev: v0.11.2
3
+ rev: v0.12.3
4
4
  hooks:
5
5
  - id: ruff
6
6
  args: ["--fix"]
7
7
  - id: ruff-format
8
+ # The following can be removed once PLR0917 is out of preview
9
+ - name: ruff preview rules
10
+ id: ruff
11
+ args: ["--preview", "--select=PLR0917"]
8
12
  - repo: https://github.com/biomejs/pre-commit
9
- rev: v1.9.4
13
+ rev: v2.1.1
10
14
  hooks:
11
15
  - id: biome-format
12
16
  - repo: https://github.com/ComPWA/taplo-pre-commit
@@ -2,7 +2,7 @@ version: 2
2
2
  build:
3
3
  os: ubuntu-20.04
4
4
  tools:
5
- python: "3.12"
5
+ python: "3.13"
6
6
  jobs:
7
7
  post_checkout:
8
8
  # unshallow so version can be derived from tag
@@ -1,6 +1,6 @@
1
1
  BSD 3-Clause License
2
2
 
3
- Copyright (c) 2025, scverse
3
+ Copyright (c) 2025, scverse®
4
4
  Copyright (c) 2017-2018, P. Angerer, F. Alexander Wolf, Theis Lab
5
5
  All rights reserved.
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anndata
3
- Version: 0.11.4
3
+ Version: 0.12.0
4
4
  Summary: Annotated data.
5
5
  Project-URL: Documentation, https://anndata.readthedocs.io/
6
6
  Project-URL: Source, https://github.com/scverse/anndata
@@ -18,94 +18,101 @@ Classifier: Operating System :: MacOS :: MacOS X
18
18
  Classifier: Operating System :: Microsoft :: Windows
19
19
  Classifier: Operating System :: POSIX :: Linux
20
20
  Classifier: Programming Language :: Python :: 3
21
- Classifier: Programming Language :: Python :: 3.10
22
21
  Classifier: Programming Language :: Python :: 3.11
23
22
  Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
24
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
25
25
  Classifier: Topic :: Scientific/Engineering :: Visualization
26
- Requires-Python: >=3.10
27
- Requires-Dist: array-api-compat!=1.5,>1.4
28
- Requires-Dist: exceptiongroup; python_version < '3.11'
29
- Requires-Dist: h5py>=3.7
26
+ Requires-Python: >=3.11
27
+ Requires-Dist: array-api-compat>=1.7.1
28
+ Requires-Dist: h5py>=3.8
29
+ Requires-Dist: legacy-api-wrap
30
30
  Requires-Dist: natsort
31
- Requires-Dist: numpy>=1.23
31
+ Requires-Dist: numpy>=1.26
32
32
  Requires-Dist: packaging>=24.2
33
- Requires-Dist: pandas!=2.1.0rc0,!=2.1.2,>=1.4
34
- Requires-Dist: scipy>1.8
33
+ Requires-Dist: pandas!=2.1.2,>=2.1.0
34
+ Requires-Dist: scipy>=1.12
35
+ Requires-Dist: zarr!=3.0.*,>=2.18.7
35
36
  Provides-Extra: cu11
36
37
  Requires-Dist: cupy-cuda11x; extra == 'cu11'
37
38
  Provides-Extra: cu12
38
39
  Requires-Dist: cupy-cuda12x; extra == 'cu12'
39
40
  Provides-Extra: dask
40
- Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2022.09.2; extra == 'dask'
41
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'dask'
41
42
  Provides-Extra: dev
42
- Requires-Dist: awkward>=2.3; extra == 'dev'
43
- Requires-Dist: boltons; extra == 'dev'
44
- Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2022.09.2; extra == 'dev'
45
- Requires-Dist: dask[distributed]; extra == 'dev'
46
- Requires-Dist: filelock; extra == 'dev'
47
43
  Requires-Dist: hatch-vcs; extra == 'dev'
48
- Requires-Dist: httpx; extra == 'dev'
49
- Requires-Dist: joblib; extra == 'dev'
50
- Requires-Dist: loompy>=3.0.5; extra == 'dev'
51
- Requires-Dist: matplotlib; extra == 'dev'
52
- Requires-Dist: openpyxl; extra == 'dev'
53
- Requires-Dist: pyarrow; extra == 'dev'
54
- Requires-Dist: pytest-cov>=2.10; extra == 'dev'
55
- Requires-Dist: pytest-memray; extra == 'dev'
56
- Requires-Dist: pytest-mock; extra == 'dev'
57
- Requires-Dist: pytest-randomly; extra == 'dev'
58
- Requires-Dist: pytest-xdist[psutil]; extra == 'dev'
59
- Requires-Dist: pytest<8.3.4,>=8.2; extra == 'dev'
60
- Requires-Dist: scanpy>=1.9.8; extra == 'dev'
61
- Requires-Dist: scikit-learn; extra == 'dev'
62
44
  Requires-Dist: towncrier>=24.8.0; extra == 'dev'
63
- Requires-Dist: zarr<3; extra == 'dev'
64
45
  Provides-Extra: dev-doc
65
46
  Requires-Dist: towncrier>=24.8.0; extra == 'dev-doc'
66
47
  Provides-Extra: doc
67
48
  Requires-Dist: awkward>=2.3; extra == 'doc'
49
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'doc'
68
50
  Requires-Dist: ipython; extra == 'doc'
69
51
  Requires-Dist: myst-nb; extra == 'doc'
70
52
  Requires-Dist: myst-parser; extra == 'doc'
71
- Requires-Dist: readthedocs-sphinx-search; extra == 'doc'
72
- Requires-Dist: scanpydoc[theme,typehints]>=0.15.1; extra == 'doc'
53
+ Requires-Dist: scanpydoc[theme,typehints]>=0.15.3; extra == 'doc'
73
54
  Requires-Dist: sphinx-autodoc-typehints>=2.2.0; extra == 'doc'
74
55
  Requires-Dist: sphinx-book-theme>=1.1.0; extra == 'doc'
75
56
  Requires-Dist: sphinx-copybutton; extra == 'doc'
76
57
  Requires-Dist: sphinx-design>=0.5.0; extra == 'doc'
77
- Requires-Dist: sphinx-issues; extra == 'doc'
58
+ Requires-Dist: sphinx-issues>=5.0.1; extra == 'doc'
78
59
  Requires-Dist: sphinx-toolbox>=3.8.0; extra == 'doc'
79
60
  Requires-Dist: sphinx>=8.2.1; extra == 'doc'
80
61
  Requires-Dist: sphinxext-opengraph; extra == 'doc'
81
62
  Requires-Dist: towncrier>=24.8.0; extra == 'doc'
82
- Requires-Dist: zarr<3; extra == 'doc'
83
63
  Provides-Extra: gpu
84
64
  Requires-Dist: cupy; extra == 'gpu'
65
+ Provides-Extra: lazy
66
+ Requires-Dist: aiohttp; extra == 'lazy'
67
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'lazy'
68
+ Requires-Dist: requests; extra == 'lazy'
69
+ Requires-Dist: xarray>=2025.06.1; extra == 'lazy'
85
70
  Provides-Extra: test
86
- Requires-Dist: awkward>=2.3; extra == 'test'
71
+ Requires-Dist: aiohttp; extra == 'test'
72
+ Requires-Dist: awkward>=2.3.2; extra == 'test'
87
73
  Requires-Dist: boltons; extra == 'test'
88
- Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2022.09.2; extra == 'test'
74
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'test'
89
75
  Requires-Dist: dask[distributed]; extra == 'test'
90
76
  Requires-Dist: filelock; extra == 'test'
91
- Requires-Dist: httpx; extra == 'test'
77
+ Requires-Dist: httpx<1.0; extra == 'test'
92
78
  Requires-Dist: joblib; extra == 'test'
93
79
  Requires-Dist: loompy>=3.0.5; extra == 'test'
94
80
  Requires-Dist: matplotlib; extra == 'test'
95
81
  Requires-Dist: openpyxl; extra == 'test'
96
82
  Requires-Dist: pyarrow; extra == 'test'
97
- Requires-Dist: pytest-cov>=2.10; extra == 'test'
83
+ Requires-Dist: pytest-cov; extra == 'test'
98
84
  Requires-Dist: pytest-memray; extra == 'test'
99
85
  Requires-Dist: pytest-mock; extra == 'test'
100
86
  Requires-Dist: pytest-randomly; extra == 'test'
101
87
  Requires-Dist: pytest-xdist[psutil]; extra == 'test'
102
88
  Requires-Dist: pytest<8.3.4,>=8.2; extra == 'test'
103
- Requires-Dist: scanpy>=1.9.8; extra == 'test'
89
+ Requires-Dist: requests; extra == 'test'
90
+ Requires-Dist: scanpy>=1.10; extra == 'test'
104
91
  Requires-Dist: scikit-learn; extra == 'test'
105
- Requires-Dist: zarr<3; extra == 'test'
92
+ Requires-Dist: xarray>=2025.06.1; extra == 'test'
93
+ Provides-Extra: test-min
94
+ Requires-Dist: awkward>=2.3.2; extra == 'test-min'
95
+ Requires-Dist: boltons; extra == 'test-min'
96
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'test-min'
97
+ Requires-Dist: dask[distributed]; extra == 'test-min'
98
+ Requires-Dist: filelock; extra == 'test-min'
99
+ Requires-Dist: httpx<1.0; extra == 'test-min'
100
+ Requires-Dist: joblib; extra == 'test-min'
101
+ Requires-Dist: loompy>=3.0.5; extra == 'test-min'
102
+ Requires-Dist: matplotlib; extra == 'test-min'
103
+ Requires-Dist: openpyxl; extra == 'test-min'
104
+ Requires-Dist: pyarrow; extra == 'test-min'
105
+ Requires-Dist: pytest-cov; extra == 'test-min'
106
+ Requires-Dist: pytest-memray; extra == 'test-min'
107
+ Requires-Dist: pytest-mock; extra == 'test-min'
108
+ Requires-Dist: pytest-randomly; extra == 'test-min'
109
+ Requires-Dist: pytest-xdist[psutil]; extra == 'test-min'
110
+ Requires-Dist: pytest<8.3.4,>=8.2; extra == 'test-min'
111
+ Requires-Dist: scanpy>=1.10; extra == 'test-min'
112
+ Requires-Dist: scikit-learn; extra == 'test-min'
106
113
  Description-Content-Type: text/markdown
107
114
 
108
- [![Build Status](https://dev.azure.com/scverse/anndata/_apis/build/status/scverse.anndata?branchName=main)](https://dev.azure.com/scverse/anndata/_build)
115
+ [![Tests](https://github.com/scverse/anndata/actions/workflows/test-cpu.yml/badge.svg)](https://github.com/scverse/anndata/actions)
109
116
  [![Conda](https://img.shields.io/conda/vn/conda-forge/anndata.svg)](https://anaconda.org/conda-forge/anndata)
110
117
  [![Coverage](https://codecov.io/gh/scverse/anndata/branch/main/graph/badge.svg?token=IN1mJN1Wi8)](https://codecov.io/gh/scverse/anndata)
111
118
  [![Docs](https://readthedocs.com/projects/icb-anndata/badge/?version=latest)](https://anndata.readthedocs.io)
@@ -1,4 +1,4 @@
1
- [![Build Status](https://dev.azure.com/scverse/anndata/_apis/build/status/scverse.anndata?branchName=main)](https://dev.azure.com/scverse/anndata/_build)
1
+ [![Tests](https://github.com/scverse/anndata/actions/workflows/test-cpu.yml/badge.svg)](https://github.com/scverse/anndata/actions)
2
2
  [![Conda](https://img.shields.io/conda/vn/conda-forge/anndata.svg)](https://anaconda.org/conda-forge/anndata)
3
3
  [![Coverage](https://codecov.io/gh/scverse/anndata/branch/main/graph/badge.svg?token=IN1mJN1Wi8)](https://codecov.io/gh/scverse/anndata)
4
4
  [![Docs](https://readthedocs.com/projects/icb-anndata/badge/?version=latest)](https://anndata.readthedocs.io)
@@ -2,22 +2,17 @@
2
2
  // The version of the config file format. Do not change, unless
3
3
  // you know what you are doing.
4
4
  "version": 1,
5
-
6
5
  // The name of the project being benchmarked
7
6
  "project": "anndata",
8
-
9
7
  // The project's homepage
10
8
  "project_url": "https://anndata.readthedocs.io/",
11
-
12
9
  // The URL or local path of the source code repository for the
13
10
  // project being benchmarked
14
11
  "repo": "../../anndata",
15
-
16
12
  // The Python project's subdirectory in your repo. If missing or
17
13
  // the empty string, the project is assumed to be located at the root
18
14
  // of the repository.
19
15
  // "repo_subdir": "",
20
-
21
16
  // Customizable commands for building, installing, and
22
17
  // uninstalling the project. See asv.conf.json documentation.
23
18
  //
@@ -27,40 +22,32 @@
27
22
  "python -m pip install build",
28
23
  "python -m build --wheel -o {build_cache_dir} {build_dir}",
29
24
  ],
30
-
31
25
  // List of branches to benchmark. If not provided, defaults to "master"
32
26
  // (for git) or "default" (for mercurial).
33
27
  "branches": ["main"], // for git
34
28
  // "branches": ["default"], // for mercurial
35
-
36
29
  // The DVCS being used. If not set, it will be automatically
37
30
  // determined from "repo" by looking at the protocol in the URL
38
31
  // (if remote), or by looking for special directories, such as
39
32
  // ".git" (if local).
40
33
  "dvcs": "git",
41
-
42
34
  // The tool to use to create environments. May be "conda",
43
35
  // "virtualenv" or other value depending on the plugins in use.
44
36
  // If missing or the empty string, the tool will be automatically
45
37
  // determined by looking for tools on the PATH environment
46
38
  // variable.
47
39
  "environment_type": "mamba",
48
-
49
40
  // timeout in seconds for installing any dependencies in environment
50
41
  // defaults to 10 min
51
42
  //"install_timeout": 600,
52
-
53
43
  // the base URL to show a commit for the project.
54
44
  "show_commit_url": "https://github.com/theislab/anndata/commit/",
55
-
56
45
  // The Pythons you'd like to test against. If not provided, defaults
57
46
  // to the current version of Python used to run `asv`.
58
47
  // "pythons": ["2.7", "3.6"],
59
-
60
48
  // The list of conda channel names to be searched for benchmark
61
49
  // dependency packages in the specified order
62
50
  "conda_channels": ["conda-forge", "defaults"],
63
-
64
51
  // The matrix of dependencies to test. Each key is the name of a
65
52
  // package (in PyPI) and the values are version numbers. An empty
66
53
  // list or empty string indicates to just test against the default
@@ -79,14 +66,13 @@
79
66
  "natsort": [""],
80
67
  "pandas": [""],
81
68
  "memory_profiler": [""],
82
- "zarr": ["2.18.4"],
69
+ "zarr": [""],
83
70
  "pytoml": [""],
84
71
  "pytest": [""],
85
72
  "pooch": [""],
86
73
  // "scanpy": [""],
87
74
  // "psutil": [""]
88
75
  },
89
-
90
76
  // Combinations of libraries/python versions can be excluded/included
91
77
  // from the set to test. Each entry is a dictionary containing additional
92
78
  // key-value pairs to include/exclude.
@@ -119,31 +105,24 @@
119
105
  // // additional env if run on windows+conda
120
106
  // {"platform": "win32", "environment_type": "mamba", "python": "2.7", "libpython": ""},
121
107
  // ],
122
-
123
108
  // The directory (relative to the current directory) that benchmarks are
124
109
  // stored in. If not provided, defaults to "benchmarks"
125
110
  // "benchmark_dir": "benchmarks",
126
-
127
111
  // The directory (relative to the current directory) to cache the Python
128
112
  // environments in. If not provided, defaults to "env"
129
113
  "env_dir": ".asv/env",
130
-
131
114
  // The directory (relative to the current directory) that raw benchmark
132
115
  // results are stored in. If not provided, defaults to "results".
133
116
  "results_dir": ".asv/results",
134
-
135
117
  // The directory (relative to the current directory) that the html tree
136
118
  // should be written to. If not provided, defaults to "html".
137
119
  "html_dir": ".asv/html",
138
-
139
120
  // The number of characters to retain in the commit hashes.
140
121
  // "hash_length": 8,
141
-
142
122
  // `asv` will cache results of the recent builds in each
143
123
  // environment, making them faster to install next time. This is
144
124
  // the number of builds to keep, per environment.
145
125
  // "build_cache_size": 2,
146
-
147
126
  // The commits after which the regression search in `asv publish`
148
127
  // should start looking for regressions. Dictionary whose keys are
149
128
  // regexps matching to benchmark names, and values corresponding to
@@ -156,7 +135,6 @@
156
135
  // "some_benchmark": "352cdf", // Consider regressions only after this commit
157
136
  // "another_benchmark": null, // Skip regression detection altogether
158
137
  // },
159
-
160
138
  // The thresholds for relative change in results, after which `asv
161
139
  // publish` starts reporting regressions. Dictionary of the same
162
140
  // form as in ``regressions_first_commits``, with values
@@ -15,8 +15,14 @@ class GarbargeCollectionSuite:
15
15
  def display_top(snapshot, key_type="lineno"):
16
16
  snapshot = snapshot.filter_traces(
17
17
  (
18
- tracemalloc.Filter(False, "<frozen importlib._bootstrap>"),
19
- tracemalloc.Filter(False, "<unknown>"),
18
+ tracemalloc.Filter(
19
+ inclusive=False,
20
+ filename_pattern="<frozen importlib._bootstrap>",
21
+ ),
22
+ tracemalloc.Filter(
23
+ inclusive=False,
24
+ filename_pattern="<unknown>",
25
+ ),
20
26
  )
21
27
  )
22
28
  top_stats = snapshot.statistics(key_type)
@@ -25,6 +25,7 @@ from __future__ import annotations
25
25
  import sys
26
26
  import tempfile
27
27
  from pathlib import Path
28
+ from types import MappingProxyType
28
29
 
29
30
  import numpy as np
30
31
  import pooch
@@ -77,9 +78,9 @@ PBMC_3K_URL = "https://falexwolf.de/data/pbmc3k_raw.h5ad"
77
78
 
78
79
 
79
80
  class H5ADInMemorySizeSuite:
80
- _urls = dict(pbmc3k=PBMC_3K_URL)
81
+ _urls = MappingProxyType(dict(pbmc3k=PBMC_3K_URL))
81
82
  params = _urls.keys()
82
- param_names = ["input_data"]
83
+ param_names = ("input_data",)
83
84
 
84
85
  def setup(self, input_data: str):
85
86
  self.filepath = pooch.retrieve(url=self._urls[input_data], known_hash=None)
@@ -98,9 +99,9 @@ class H5ADInMemorySizeSuite:
98
99
 
99
100
 
100
101
  class H5ADReadSuite:
101
- _urls = dict(pbmc3k=PBMC_3K_URL)
102
+ _urls = MappingProxyType(dict(pbmc3k=PBMC_3K_URL))
102
103
  params = _urls.keys()
103
- param_names = ["input_data"]
104
+ param_names = ("input_data",)
104
105
 
105
106
  def setup(self, input_data: str):
106
107
  self.filepath = pooch.retrieve(url=self._urls[input_data], known_hash=None)
@@ -133,9 +134,9 @@ class H5ADReadSuite:
133
134
 
134
135
 
135
136
  class H5ADWriteSuite:
136
- _urls = dict(pbmc3k=PBMC_3K_URL)
137
+ _urls = MappingProxyType(dict(pbmc3k=PBMC_3K_URL))
137
138
  params = _urls.keys()
138
- param_names = ["input_data"]
139
+ param_names = ("input_data",)
139
140
 
140
141
  def setup(self, input_data: str):
141
142
  mem_recording, adata = memory_usage(
@@ -176,9 +177,9 @@ class H5ADWriteSuite:
176
177
 
177
178
 
178
179
  class H5ADBackedWriteSuite(H5ADWriteSuite):
179
- _urls = dict(pbmc3k=PBMC_3K_URL)
180
+ _urls = MappingProxyType(dict(pbmc3k=PBMC_3K_URL))
180
181
  params = _urls.keys()
181
- param_names = ["input_data"]
182
+ param_names = ("input_data",)
182
183
 
183
184
  def setup(self, input_data):
184
185
  mem_recording, adata = memory_usage(
@@ -1,5 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
+ from types import MappingProxyType
4
+
3
5
  import numpy as np
4
6
  import zarr
5
7
  from scipy import sparse
@@ -17,16 +19,18 @@ def make_alternating_mask(n):
17
19
 
18
20
 
19
21
  class SparseCSRContiguousSlice:
20
- _slices = {
21
- "0:1000": slice(0, 1000),
22
- "0:9000": slice(0, 9000),
23
- ":9000:-1": slice(None, 9000, -1),
24
- "::-2": slice(None, None, 2),
25
- "array": np.array([0, 5000, 9999]),
26
- "arange": np.arange(0, 1000),
27
- "first": 0,
28
- "alternating": make_alternating_mask(10),
29
- }
22
+ _slices = MappingProxyType(
23
+ {
24
+ "0:1000": slice(0, 1000),
25
+ "0:9000": slice(0, 9000),
26
+ ":9000:-1": slice(None, 9000, -1),
27
+ "::-2": slice(None, None, 2),
28
+ "array": np.array([0, 5000, 9999]),
29
+ "arange": np.arange(0, 1000),
30
+ "first": 0,
31
+ "alternating": make_alternating_mask(10),
32
+ }
33
+ )
30
34
  params = (
31
35
  [
32
36
  (10_000, 10_000),
@@ -34,7 +38,7 @@ class SparseCSRContiguousSlice:
34
38
  ],
35
39
  _slices.keys(),
36
40
  )
37
- param_names = ["shape", "slice"]
41
+ param_names = ("shape", "slice")
38
42
 
39
43
  def setup(self, shape: tuple[int, int], slice: str):
40
44
  X = sparse.random(
@@ -93,22 +93,6 @@ def gen_indexer(adata, dim, index_kind, ratio):
93
93
  return tuple(subset)
94
94
 
95
95
 
96
- def take_view(adata, *, dim, index_kind, ratio=0.5, nviews=100):
97
- subset = gen_indexer(adata, dim, index_kind, ratio)
98
- views = []
99
- for i in range(nviews):
100
- views.append(adata[subset])
101
-
102
-
103
- def take_repeated_view(adata, *, dim, index_kind, ratio=0.9, nviews=10):
104
- v = adata
105
- views = []
106
- for i in range(nviews):
107
- subset = gen_indexer(v, dim, index_kind, ratio)
108
- v = v[subset]
109
- views.append(v)
110
-
111
-
112
96
  def gen_adata(n_obs, n_var, attr_set):
113
97
  if "X-csr" in attr_set:
114
98
  X = sparse.random(n_obs, n_var, density=0.1, format="csr")
@@ -1,9 +1,9 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
3
3
  "formatter": { "useEditorconfig": true },
4
4
  "overrides": [
5
5
  {
6
- "include": ["./.vscode/*.json", "**/*.jsonc", "**/asv.conf.json"],
6
+ "includes": ["./.vscode/*.json", "**/*.jsonc", "**/asv.conf.json"],
7
7
  "json": {
8
8
  "formatter": {
9
9
  "trailingCommas": "all",