anndata 0.11.4__tar.gz → 0.12.0rc2__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 (203) hide show
  1. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/ISSUE_TEMPLATE/bug-report.yml +10 -2
  2. anndata-0.12.0rc2/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. anndata-0.12.0rc2/.github/ISSUE_TEMPLATE/question.yml +14 -0
  4. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/workflows/test-cpu.yml +10 -11
  5. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/workflows/test-gpu.yml +2 -1
  6. {anndata-0.11.4 → anndata-0.12.0rc2}/.gitignore +1 -0
  7. {anndata-0.11.4 → anndata-0.12.0rc2}/.pre-commit-config.yaml +5 -1
  8. {anndata-0.11.4 → anndata-0.12.0rc2}/.readthedocs.yml +1 -1
  9. {anndata-0.11.4 → anndata-0.12.0rc2}/LICENSE +1 -1
  10. {anndata-0.11.4 → anndata-0.12.0rc2}/PKG-INFO +56 -25
  11. {anndata-0.11.4 → anndata-0.12.0rc2}/README.md +1 -1
  12. {anndata-0.11.4 → anndata-0.12.0rc2}/benchmarks/asv.conf.json +1 -23
  13. {anndata-0.11.4 → anndata-0.12.0rc2}/benchmarks/benchmarks/anndata.py +8 -2
  14. {anndata-0.11.4 → anndata-0.12.0rc2}/benchmarks/benchmarks/readwrite.py +9 -8
  15. {anndata-0.11.4 → anndata-0.12.0rc2}/benchmarks/benchmarks/sparse_dataset.py +15 -11
  16. {anndata-0.11.4 → anndata-0.12.0rc2}/benchmarks/benchmarks/utils.py +0 -16
  17. {anndata-0.11.4 → anndata-0.12.0rc2}/ci/scripts/min-deps.py +14 -10
  18. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/api.md +38 -1
  19. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/conf.py +16 -5
  20. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/extensions/no_skip_abc_members.py +2 -2
  21. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/fileformat-prose.md +1 -1
  22. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.11.0.md +1 -1
  23. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.11.1.md +2 -2
  24. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.11.2.md +1 -1
  25. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.11.3.md +1 -1
  26. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.11.4.md +2 -2
  27. anndata-0.12.0rc2/docs/release-notes/0.12.0rc1.md +26 -0
  28. anndata-0.12.0rc2/docs/release-notes/0.12.0rc2.md +14 -0
  29. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/tutorials/index.md +2 -0
  30. anndata-0.12.0rc2/docs/tutorials/zarr-v3.md +105 -0
  31. {anndata-0.11.4 → anndata-0.12.0rc2}/hatch.toml +6 -3
  32. {anndata-0.11.4 → anndata-0.12.0rc2}/pyproject.toml +66 -44
  33. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/__init__.py +17 -40
  34. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/access.py +1 -1
  35. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/aligned_df.py +48 -6
  36. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/aligned_mapping.py +11 -4
  37. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/anndata.py +168 -134
  38. anndata-0.12.0rc2/src/anndata/_core/extensions.py +276 -0
  39. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/file_backing.py +13 -6
  40. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/index.py +27 -13
  41. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/merge.py +450 -81
  42. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/raw.py +1 -4
  43. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/sparse_dataset.py +52 -29
  44. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/storage.py +20 -12
  45. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/views.py +19 -7
  46. anndata-0.12.0rc2/src/anndata/_core/xarray.py +145 -0
  47. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_io/__init__.py +3 -3
  48. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_io/h5ad.py +11 -12
  49. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_io/read.py +36 -24
  50. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_io/specs/__init__.py +8 -8
  51. anndata-0.12.0rc2/src/anndata/_io/specs/lazy_methods.py +347 -0
  52. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_io/specs/methods.py +191 -69
  53. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_io/specs/registry.py +56 -33
  54. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_io/utils.py +32 -19
  55. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_io/write.py +24 -16
  56. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_io/zarr.py +50 -17
  57. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_settings.py +35 -34
  58. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_types.py +60 -40
  59. anndata-0.12.0rc2/src/anndata/_version.py +62 -0
  60. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_warnings.py +0 -6
  61. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/abc.py +2 -2
  62. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/compat/__init__.py +60 -134
  63. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/experimental/__init__.py +14 -8
  64. anndata-0.12.0rc2/src/anndata/experimental/backed/__init__.py +5 -0
  65. anndata-0.12.0rc2/src/anndata/experimental/backed/_compat.py +18 -0
  66. anndata-0.12.0rc2/src/anndata/experimental/backed/_io.py +161 -0
  67. anndata-0.12.0rc2/src/anndata/experimental/backed/_lazy_arrays.py +188 -0
  68. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/experimental/merge.py +28 -24
  69. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/experimental/multi_files/_anncollection.py +47 -53
  70. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/experimental/pytorch/_annloader.py +38 -15
  71. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/io.py +4 -19
  72. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/logging.py +12 -7
  73. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/tests/helpers.py +236 -149
  74. anndata-0.12.0rc2/src/anndata/types.py +22 -0
  75. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/typing.py +5 -5
  76. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/utils.py +35 -25
  77. anndata-0.12.0rc2/src/testing/anndata/_doctest.py +16 -0
  78. {anndata-0.11.4 → anndata-0.12.0rc2}/src/testing/anndata/_pytest.py +8 -5
  79. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/conftest.py +21 -1
  80. anndata-0.12.0rc2/tests/lazy/conftest.py +251 -0
  81. anndata-0.12.0rc2/tests/lazy/test_concat.py +320 -0
  82. anndata-0.12.0rc2/tests/lazy/test_read.py +179 -0
  83. anndata-0.12.0rc2/tests/lazy/test_write.py +46 -0
  84. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_backed_dense.py +2 -6
  85. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_backed_hdf5.py +5 -2
  86. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_backed_sparse.py +85 -78
  87. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_base.py +38 -28
  88. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_concatenate.py +244 -75
  89. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_concatenate_disk.py +2 -1
  90. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_dask.py +2 -5
  91. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_dask_view_mem.py +5 -7
  92. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_deprecations.py +7 -18
  93. anndata-0.12.0rc2/tests/test_extensions.py +229 -0
  94. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_helpers.py +2 -34
  95. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_io_backwards_compat.py +6 -6
  96. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_io_conversion.py +4 -4
  97. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_io_dispatched.py +63 -30
  98. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_io_elementwise.py +70 -71
  99. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_io_partial.py +25 -20
  100. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_io_utils.py +5 -9
  101. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_io_warnings.py +13 -19
  102. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_obsmvarm.py +27 -1
  103. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_readwrite.py +165 -62
  104. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_repr.py +1 -1
  105. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_settings.py +31 -28
  106. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_structured_arrays.py +28 -22
  107. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_transpose.py +1 -3
  108. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_views.py +17 -23
  109. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_x.py +8 -13
  110. anndata-0.12.0rc2/tests/test_xarray.py +91 -0
  111. anndata-0.11.4/.github/ISSUE_TEMPLATE/config.yml +0 -8
  112. anndata-0.11.4/src/anndata/_io/specs/lazy_methods.py +0 -186
  113. anndata-0.11.4/src/anndata/_version.py +0 -37
  114. anndata-0.11.4/src/anndata/compat/exceptiongroups.py +0 -14
  115. {anndata-0.11.4 → anndata-0.12.0rc2}/.cirun.yml +0 -0
  116. {anndata-0.11.4 → anndata-0.12.0rc2}/.codecov.yml +0 -0
  117. {anndata-0.11.4 → anndata-0.12.0rc2}/.editorconfig +0 -0
  118. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/ISSUE_TEMPLATE/enhancement-request.yml +0 -0
  119. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  120. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/workflows/benchmark.yml +0 -0
  121. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/workflows/check-pr-milestoned.yml +0 -0
  122. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/workflows/close-stale.yml +0 -0
  123. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/workflows/codespell.yml +0 -0
  124. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/workflows/label-stale.yml +0 -0
  125. {anndata-0.11.4 → anndata-0.12.0rc2}/.github/workflows/publish.yml +0 -0
  126. {anndata-0.11.4 → anndata-0.12.0rc2}/.gitmodules +0 -0
  127. {anndata-0.11.4 → anndata-0.12.0rc2}/.prettierignore +0 -0
  128. {anndata-0.11.4 → anndata-0.12.0rc2}/.prettierrc.yaml +0 -0
  129. {anndata-0.11.4 → anndata-0.12.0rc2}/.taplo.toml +0 -0
  130. {anndata-0.11.4 → anndata-0.12.0rc2}/.vscode/launch.json +0 -0
  131. {anndata-0.11.4 → anndata-0.12.0rc2}/.vscode/settings.json +0 -0
  132. {anndata-0.11.4 → anndata-0.12.0rc2}/benchmarks/README.md +0 -0
  133. {anndata-0.11.4 → anndata-0.12.0rc2}/benchmarks/benchmarks/__init__.py +0 -0
  134. {anndata-0.11.4 → anndata-0.12.0rc2}/biome.jsonc +0 -0
  135. {anndata-0.11.4 → anndata-0.12.0rc2}/ci/constraints.txt +0 -0
  136. {anndata-0.11.4 → anndata-0.12.0rc2}/ci/scripts/towncrier_automation.py +0 -0
  137. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/Makefile +0 -0
  138. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/_key_contributors.rst +0 -0
  139. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/_static/img/anndata_schema.svg +0 -0
  140. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/_templates/autosummary/class.rst +0 -0
  141. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/benchmark-read-write.ipynb +0 -0
  142. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/benchmarks.md +0 -0
  143. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/concatenation.rst +0 -0
  144. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/contributing.md +0 -0
  145. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/extensions/patch_myst_cite.py +0 -0
  146. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/index.md +0 -0
  147. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/interoperability.md +0 -0
  148. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/news.md +0 -0
  149. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/references.rst +0 -0
  150. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.0.md +0 -0
  151. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.1.md +0 -0
  152. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.2.md +0 -0
  153. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.3.md +0 -0
  154. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.4.md +0 -0
  155. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.5.md +0 -0
  156. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.6.md +0 -0
  157. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.7.md +0 -0
  158. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.8.md +0 -0
  159. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.10.9.md +0 -0
  160. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.4.0.md +0 -0
  161. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.5.0.md +0 -0
  162. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.6.0.md +0 -0
  163. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.6.x.md +0 -0
  164. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.7.0.md +0 -0
  165. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.7.2.md +0 -0
  166. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.7.3.md +0 -0
  167. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.7.4.md +0 -0
  168. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.7.5.md +0 -0
  169. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.7.6.md +0 -0
  170. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.7.7.md +0 -0
  171. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.7.8.md +0 -0
  172. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.8.0.md +0 -0
  173. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.9.0.md +0 -0
  174. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.9.1.md +0 -0
  175. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/0.9.2.md +0 -0
  176. {anndata-0.11.4 → anndata-0.12.0rc2}/docs/release-notes/index.md +0 -0
  177. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/_core/__init__.py +0 -0
  178. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/experimental/_dispatch_io.py +0 -0
  179. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/experimental/multi_files/__init__.py +0 -0
  180. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/experimental/pytorch/__init__.py +0 -0
  181. {anndata-0.11.4 → anndata-0.12.0rc2}/src/anndata/tests/__init__.py +0 -0
  182. {anndata-0.11.4 → anndata-0.12.0rc2}/src/testing/anndata/__init__.py +0 -0
  183. {anndata-0.11.4 → anndata-0.12.0rc2}/src/testing/anndata/py.typed +0 -0
  184. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/data/adata-comments.tsv +0 -0
  185. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/data/adata.csv +0 -0
  186. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/data/archives/readme.md +0 -0
  187. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/data/archives/v0.7.0/adata.h5ad +0 -0
  188. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/data/archives/v0.7.0/adata.zarr.zip +0 -0
  189. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/data/archives/v0.7.8/adata.h5ad +0 -0
  190. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/data/archives/v0.7.8/adata.zarr.zip +0 -0
  191. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/data/excel.xlsx +0 -0
  192. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/data/umi_tools.tsv.gz +0 -0
  193. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_anncollection.py +0 -0
  194. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_annot.py +0 -0
  195. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_awkward.py +0 -0
  196. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_get_vector.py +0 -0
  197. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_gpu.py +0 -0
  198. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_inplace_subset.py +0 -0
  199. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_layers.py +0 -0
  200. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_obspvarp.py +0 -0
  201. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_raw.py +0 -0
  202. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_uns.py +0 -0
  203. {anndata-0.11.4 → anndata-0.12.0rc2}/tests/test_utils.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
@@ -27,14 +27,14 @@ jobs:
27
27
  strategy:
28
28
  matrix:
29
29
  include:
30
- - python-version: '3.12'
30
+ - python-version: '3.13'
31
31
  test-type: coverage
32
- - python-version: '3.10'
32
+ - python-version: '3.11'
33
33
  test-type: standard
34
- - python-version: '3.12'
34
+ - python-version: '3.13'
35
35
  dependencies-version: pre-release
36
36
  test-type: strict-warning
37
- - python-version: '3.10'
37
+ - python-version: '3.11'
38
38
  dependencies-version: minimum
39
39
  test-type: coverage
40
40
  steps:
@@ -56,19 +56,18 @@ jobs:
56
56
 
57
57
  - name: Install dependencies
58
58
  if: matrix.dependencies-version == null
59
- run: uv pip install --system --compile "anndata[dev,test] @ ." -c ci/constraints.txt
59
+ run: uv pip install --system --compile -r pyproject.toml --extra=dev --extra=test -e 'anndata @ .' -c ci/constraints.txt
60
60
 
61
61
  - name: Install minimum dependencies
62
62
  if: matrix.dependencies-version == 'minimum'
63
63
  run: |
64
64
  uv pip install --system --compile tomli packaging
65
-
66
- deps=$(python3 ci/scripts/min-deps.py pyproject.toml --extra dev test)
67
- uv pip install --system --compile $deps "anndata @ ."
65
+ deps=$(python3 ci/scripts/min-deps.py pyproject.toml --extras dev test-min)
66
+ uv pip install --system --compile $deps -e 'anndata @ .'
68
67
 
69
68
  - name: Install dependencies release candidates
70
69
  if: matrix.dependencies-version == 'pre-release'
71
- run: uv pip install -v --system --compile --pre "anndata[dev,test] @ ." -c ci/constraints.txt
70
+ run: uv pip install -v --system --compile --pre -r pyproject.toml --extra=dev --extra=test -e 'anndata @ .' -c ci/constraints.txt
72
71
 
73
72
  - name: Display installed versions
74
73
  run: uv pip list
@@ -100,10 +99,10 @@ jobs:
100
99
  fetch-depth: 0
101
100
  filter: blob:none
102
101
 
103
- - name: Set up Python 3.12
102
+ - name: Set up Python 3.13
104
103
  uses: actions/setup-python@v5
105
104
  with:
106
- python-version: '3.12'
105
+ python-version: '3.13'
107
106
 
108
107
  - name: Install build tools and requirements
109
108
  run: |
@@ -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,6 +7,7 @@ __pycache__/
7
7
  /*cache/
8
8
  /node_modules/
9
9
  /data/
10
+ /venv/
10
11
 
11
12
  # Distribution / packaging
12
13
  /dist/
@@ -1,10 +1,14 @@
1
1
  repos:
2
2
  - repo: https://github.com/astral-sh/ruff-pre-commit
3
- rev: v0.11.2
3
+ rev: v0.11.4
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
13
  rev: v1.9.4
10
14
  hooks:
@@ -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.0rc2
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,30 +18,32 @@ 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.25
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.0rc0,!=2.1.2,>=2.0.0
34
+ Requires-Dist: scipy>=1.11
35
+ Requires-Dist: zarr!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3,<3.0.7,>=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: aiohttp; extra == 'dev'
44
+ Requires-Dist: awkward>=2.3.2; extra == 'dev'
43
45
  Requires-Dist: boltons; extra == 'dev'
44
- Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2022.09.2; extra == 'dev'
46
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'dev'
45
47
  Requires-Dist: dask[distributed]; extra == 'dev'
46
48
  Requires-Dist: filelock; extra == 'dev'
47
49
  Requires-Dist: hatch-vcs; extra == 'dev'
@@ -50,42 +52,49 @@ Requires-Dist: joblib; extra == 'dev'
50
52
  Requires-Dist: loompy>=3.0.5; extra == 'dev'
51
53
  Requires-Dist: matplotlib; extra == 'dev'
52
54
  Requires-Dist: openpyxl; extra == 'dev'
55
+ Requires-Dist: pandas>=2.1.0; extra == 'dev'
53
56
  Requires-Dist: pyarrow; extra == 'dev'
54
- Requires-Dist: pytest-cov>=2.10; extra == 'dev'
57
+ Requires-Dist: pytest-cov; extra == 'dev'
55
58
  Requires-Dist: pytest-memray; extra == 'dev'
56
59
  Requires-Dist: pytest-mock; extra == 'dev'
57
60
  Requires-Dist: pytest-randomly; extra == 'dev'
58
61
  Requires-Dist: pytest-xdist[psutil]; extra == 'dev'
59
62
  Requires-Dist: pytest<8.3.4,>=8.2; extra == 'dev'
60
- Requires-Dist: scanpy>=1.9.8; extra == 'dev'
63
+ Requires-Dist: requests; extra == 'dev'
64
+ Requires-Dist: scanpy>=1.10; extra == 'dev'
61
65
  Requires-Dist: scikit-learn; extra == 'dev'
62
66
  Requires-Dist: towncrier>=24.8.0; extra == 'dev'
63
- Requires-Dist: zarr<3; extra == 'dev'
67
+ Requires-Dist: xarray>=2025.04.0; extra == 'dev'
64
68
  Provides-Extra: dev-doc
65
69
  Requires-Dist: towncrier>=24.8.0; extra == 'dev-doc'
66
70
  Provides-Extra: doc
67
71
  Requires-Dist: awkward>=2.3; extra == 'doc'
72
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'doc'
68
73
  Requires-Dist: ipython; extra == 'doc'
69
74
  Requires-Dist: myst-nb; extra == 'doc'
70
75
  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'
76
+ Requires-Dist: scanpydoc[theme,typehints]>=0.15.3; extra == 'doc'
73
77
  Requires-Dist: sphinx-autodoc-typehints>=2.2.0; extra == 'doc'
74
78
  Requires-Dist: sphinx-book-theme>=1.1.0; extra == 'doc'
75
79
  Requires-Dist: sphinx-copybutton; extra == 'doc'
76
80
  Requires-Dist: sphinx-design>=0.5.0; extra == 'doc'
77
- Requires-Dist: sphinx-issues; extra == 'doc'
81
+ Requires-Dist: sphinx-issues>=5.0.1; extra == 'doc'
78
82
  Requires-Dist: sphinx-toolbox>=3.8.0; extra == 'doc'
79
83
  Requires-Dist: sphinx>=8.2.1; extra == 'doc'
80
84
  Requires-Dist: sphinxext-opengraph; extra == 'doc'
81
85
  Requires-Dist: towncrier>=24.8.0; extra == 'doc'
82
- Requires-Dist: zarr<3; extra == 'doc'
83
86
  Provides-Extra: gpu
84
87
  Requires-Dist: cupy; extra == 'gpu'
88
+ Provides-Extra: lazy
89
+ Requires-Dist: aiohttp; extra == 'lazy'
90
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'lazy'
91
+ Requires-Dist: requests; extra == 'lazy'
92
+ Requires-Dist: xarray>=2025.04.0; extra == 'lazy'
85
93
  Provides-Extra: test
86
- Requires-Dist: awkward>=2.3; extra == 'test'
94
+ Requires-Dist: aiohttp; extra == 'test'
95
+ Requires-Dist: awkward>=2.3.2; extra == 'test'
87
96
  Requires-Dist: boltons; extra == 'test'
88
- Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2022.09.2; extra == 'test'
97
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'test'
89
98
  Requires-Dist: dask[distributed]; extra == 'test'
90
99
  Requires-Dist: filelock; extra == 'test'
91
100
  Requires-Dist: httpx; extra == 'test'
@@ -93,19 +102,41 @@ Requires-Dist: joblib; extra == 'test'
93
102
  Requires-Dist: loompy>=3.0.5; extra == 'test'
94
103
  Requires-Dist: matplotlib; extra == 'test'
95
104
  Requires-Dist: openpyxl; extra == 'test'
105
+ Requires-Dist: pandas>=2.1.0; extra == 'test'
96
106
  Requires-Dist: pyarrow; extra == 'test'
97
- Requires-Dist: pytest-cov>=2.10; extra == 'test'
107
+ Requires-Dist: pytest-cov; extra == 'test'
98
108
  Requires-Dist: pytest-memray; extra == 'test'
99
109
  Requires-Dist: pytest-mock; extra == 'test'
100
110
  Requires-Dist: pytest-randomly; extra == 'test'
101
111
  Requires-Dist: pytest-xdist[psutil]; extra == 'test'
102
112
  Requires-Dist: pytest<8.3.4,>=8.2; extra == 'test'
103
- Requires-Dist: scanpy>=1.9.8; extra == 'test'
113
+ Requires-Dist: requests; extra == 'test'
114
+ Requires-Dist: scanpy>=1.10; extra == 'test'
104
115
  Requires-Dist: scikit-learn; extra == 'test'
105
- Requires-Dist: zarr<3; extra == 'test'
116
+ Requires-Dist: xarray>=2025.04.0; extra == 'test'
117
+ Provides-Extra: test-min
118
+ Requires-Dist: awkward>=2.3.2; extra == 'test-min'
119
+ Requires-Dist: boltons; extra == 'test-min'
120
+ Requires-Dist: dask[array]!=2024.8.*,!=2024.9.*,<2025.2.0,>=2023.5.1; extra == 'test-min'
121
+ Requires-Dist: dask[distributed]; extra == 'test-min'
122
+ Requires-Dist: filelock; extra == 'test-min'
123
+ Requires-Dist: httpx; extra == 'test-min'
124
+ Requires-Dist: joblib; extra == 'test-min'
125
+ Requires-Dist: loompy>=3.0.5; extra == 'test-min'
126
+ Requires-Dist: matplotlib; extra == 'test-min'
127
+ Requires-Dist: openpyxl; extra == 'test-min'
128
+ Requires-Dist: pyarrow; extra == 'test-min'
129
+ Requires-Dist: pytest-cov; extra == 'test-min'
130
+ Requires-Dist: pytest-memray; extra == 'test-min'
131
+ Requires-Dist: pytest-mock; extra == 'test-min'
132
+ Requires-Dist: pytest-randomly; extra == 'test-min'
133
+ Requires-Dist: pytest-xdist[psutil]; extra == 'test-min'
134
+ Requires-Dist: pytest<8.3.4,>=8.2; extra == 'test-min'
135
+ Requires-Dist: scanpy>=1.10; extra == 'test-min'
136
+ Requires-Dist: scikit-learn; extra == 'test-min'
106
137
  Description-Content-Type: text/markdown
107
138
 
108
- [![Build Status](https://dev.azure.com/scverse/anndata/_apis/build/status/scverse.anndata?branchName=main)](https://dev.azure.com/scverse/anndata/_build)
139
+ [![Tests](https://github.com/scverse/anndata/actions/workflows/test-cpu.yml/badge.svg)](https://github.com/scverse/anndata/actions)
109
140
  [![Conda](https://img.shields.io/conda/vn/conda-forge/anndata.svg)](https://anaconda.org/conda-forge/anndata)
110
141
  [![Coverage](https://codecov.io/gh/scverse/anndata/branch/main/graph/badge.svg?token=IN1mJN1Wi8)](https://codecov.io/gh/scverse/anndata)
111
142
  [![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")
@@ -10,17 +10,13 @@ from __future__ import annotations
10
10
 
11
11
  import argparse
12
12
  import sys
13
+ import tomllib
13
14
  from collections import deque
14
15
  from contextlib import ExitStack
15
16
  from functools import cached_property
16
17
  from pathlib import Path
17
18
  from typing import TYPE_CHECKING
18
19
 
19
- if sys.version_info >= (3, 11):
20
- import tomllib
21
- else:
22
- import tomli as tomllib
23
-
24
20
  from packaging.requirements import Requirement
25
21
  from packaging.version import Version
26
22
 
@@ -38,7 +34,9 @@ def min_dep(req: Requirement) -> Requirement:
38
34
  -------
39
35
 
40
36
  >>> min_dep(Requirement("numpy>=1.0"))
41
- <Requirement('numpy==1.0.*')>
37
+ <Requirement('numpy==1.0')>
38
+ >>> min_dep(Requirement("numpy<3.0"))
39
+ <Requirement('numpy<3.0')>
42
40
  """
43
41
  req_name = req.name
44
42
  if req.extras:
@@ -48,8 +46,8 @@ def min_dep(req: Requirement) -> Requirement:
48
46
  spec for spec in req.specifier if spec.operator in {"==", "~=", ">=", ">"}
49
47
  ]
50
48
  if not filter_specs:
51
- return Requirement(req_name)
52
-
49
+ # TODO: handle markers
50
+ return Requirement(f"{req_name}{req.specifier}")
53
51
  min_version = Version("0.0.0.a1")
54
52
  for spec in filter_specs:
55
53
  if spec.operator in {">", ">=", "~="}:
@@ -57,7 +55,7 @@ def min_dep(req: Requirement) -> Requirement:
57
55
  elif spec.operator == "==":
58
56
  min_version = Version(spec.version)
59
57
 
60
- return Requirement(f"{req_name}=={min_version}.*")
58
+ return Requirement(f"{req_name}=={min_version}")
61
59
 
62
60
 
63
61
  def extract_min_deps(
@@ -66,6 +64,7 @@ def extract_min_deps(
66
64
  dependencies = deque(dependencies) # We'll be mutating this
67
65
  project_name = pyproject["project"]["name"]
68
66
 
67
+ deps = {}
69
68
  while len(dependencies) > 0:
70
69
  req = dependencies.pop()
71
70
 
@@ -78,7 +77,11 @@ def extract_min_deps(
78
77
  extra_deps = pyproject["project"]["optional-dependencies"][extra]
79
78
  dependencies += map(Requirement, extra_deps)
80
79
  else:
81
- yield min_dep(req)
80
+ if req.name in deps:
81
+ req.specifier &= deps[req.name].specifier
82
+ req.extras |= deps[req.name].extras
83
+ deps[req.name] = min_dep(req)
84
+ yield from deps.values()
82
85
 
83
86
 
84
87
  class Args(argparse.Namespace):
@@ -102,6 +105,7 @@ class Args(argparse.Namespace):
102
105
  prog="min-deps",
103
106
  description=cls.__doc__,
104
107
  usage="pip install `python min-deps.py pyproject.toml`",
108
+ allow_abbrev=False,
105
109
  )
106
110
  parser.add_argument(
107
111
  "_path",