ngio 0.3.2__tar.gz → 0.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. {ngio-0.3.2 → ngio-0.3.3}/.github/workflows/build_docs.yml +18 -13
  2. {ngio-0.3.2 → ngio-0.3.3}/.github/workflows/ci.yml +9 -32
  3. {ngio-0.3.2 → ngio-0.3.3}/CHANGELOG.md +6 -0
  4. {ngio-0.3.2 → ngio-0.3.3}/PKG-INFO +1 -1
  5. {ngio-0.3.2 → ngio-0.3.3}/docs/getting_started/0_quickstart.md +1 -1
  6. {ngio-0.3.2 → ngio-0.3.3}/docs/getting_started/1_ome_zarr_containers.md +1 -1
  7. {ngio-0.3.2 → ngio-0.3.3}/docs/getting_started/4_masked_images.md +1 -1
  8. {ngio-0.3.2 → ngio-0.3.3}/docs/getting_started/5_hcs.md +4 -2
  9. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/hcs/_plate.py +5 -5
  10. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/_tables_container.py +1 -1
  11. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/v1/_condition_table.py +1 -1
  12. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/utils/__init__.py +7 -3
  13. ngio-0.3.3/src/ngio/utils/_datasets.py +154 -0
  14. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/utils/test_download_datasets.py +6 -1
  15. ngio-0.3.2/.github/scripts/download_data.sh +0 -97
  16. ngio-0.3.2/src/ngio/utils/_datasets.py +0 -53
  17. {ngio-0.3.2 → ngio-0.3.3}/.copier-answers.yml +0 -0
  18. {ngio-0.3.2 → ngio-0.3.3}/.gitattributes +0 -0
  19. {ngio-0.3.2 → ngio-0.3.3}/.github/ISSUE_TEMPLATE.md +0 -0
  20. {ngio-0.3.2 → ngio-0.3.3}/.github/TEST_FAIL_TEMPLATE.md +0 -0
  21. {ngio-0.3.2 → ngio-0.3.3}/.github/dependabot.yml +0 -0
  22. {ngio-0.3.2 → ngio-0.3.3}/.github/pull_request_template.md +0 -0
  23. {ngio-0.3.2 → ngio-0.3.3}/.gitignore +0 -0
  24. {ngio-0.3.2 → ngio-0.3.3}/.pre-commit-config.yaml +0 -0
  25. {ngio-0.3.2 → ngio-0.3.3}/LICENSE +0 -0
  26. {ngio-0.3.2 → ngio-0.3.3}/README.md +0 -0
  27. {ngio-0.3.2 → ngio-0.3.3}/_typos.toml +0 -0
  28. {ngio-0.3.2 → ngio-0.3.3}/docs/api/common.md +0 -0
  29. {ngio-0.3.2 → ngio-0.3.3}/docs/api/hcs.md +0 -0
  30. {ngio-0.3.2 → ngio-0.3.3}/docs/api/images.md +0 -0
  31. {ngio-0.3.2 → ngio-0.3.3}/docs/api/ngio.md +0 -0
  32. {ngio-0.3.2 → ngio-0.3.3}/docs/api/tables.md +0 -0
  33. {ngio-0.3.2 → ngio-0.3.3}/docs/api/utils.md +0 -0
  34. {ngio-0.3.2 → ngio-0.3.3}/docs/changelog.md +0 -0
  35. {ngio-0.3.2 → ngio-0.3.3}/docs/code_of_conduct.md +0 -0
  36. {ngio-0.3.2 → ngio-0.3.3}/docs/contributing.md +0 -0
  37. {ngio-0.3.2 → ngio-0.3.3}/docs/getting_started/2_images.md +0 -0
  38. {ngio-0.3.2 → ngio-0.3.3}/docs/getting_started/3_tables.md +0 -0
  39. {ngio-0.3.2 → ngio-0.3.3}/docs/index.md +0 -0
  40. {ngio-0.3.2 → ngio-0.3.3}/docs/table_specs/backend.md +0 -0
  41. {ngio-0.3.2 → ngio-0.3.3}/docs/table_specs/overview.md +0 -0
  42. {ngio-0.3.2 → ngio-0.3.3}/docs/table_specs/table_types/condition_table.md +0 -0
  43. {ngio-0.3.2 → ngio-0.3.3}/docs/table_specs/table_types/custom_table.md +0 -0
  44. {ngio-0.3.2 → ngio-0.3.3}/docs/table_specs/table_types/feature_table.md +0 -0
  45. {ngio-0.3.2 → ngio-0.3.3}/docs/table_specs/table_types/generic_table.md +0 -0
  46. {ngio-0.3.2 → ngio-0.3.3}/docs/table_specs/table_types/masking_roi_table.md +0 -0
  47. {ngio-0.3.2 → ngio-0.3.3}/docs/table_specs/table_types/roi_table.md +0 -0
  48. {ngio-0.3.2 → ngio-0.3.3}/docs/tutorials/feature_extraction.ipynb +0 -0
  49. {ngio-0.3.2 → ngio-0.3.3}/docs/tutorials/hcs_processing.ipynb +0 -0
  50. {ngio-0.3.2 → ngio-0.3.3}/docs/tutorials/image_processing.ipynb +0 -0
  51. {ngio-0.3.2 → ngio-0.3.3}/docs/tutorials/image_segmentation.ipynb +0 -0
  52. {ngio-0.3.2 → ngio-0.3.3}/mkdocs.yml +0 -0
  53. {ngio-0.3.2 → ngio-0.3.3}/pyproject.toml +0 -0
  54. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/__init__.py +0 -0
  55. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/__init__.py +0 -0
  56. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_array_pipe.py +0 -0
  57. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_axes_transforms.py +0 -0
  58. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_common_types.py +0 -0
  59. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_dimensions.py +0 -0
  60. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_masking_roi.py +0 -0
  61. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_pyramid.py +0 -0
  62. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_roi.py +0 -0
  63. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_slicer.py +0 -0
  64. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_table_ops.py +0 -0
  65. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/common/_zoom.py +0 -0
  66. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/hcs/__init__.py +0 -0
  67. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/images/__init__.py +0 -0
  68. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/images/_abstract_image.py +0 -0
  69. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/images/_create.py +0 -0
  70. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/images/_image.py +0 -0
  71. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/images/_label.py +0 -0
  72. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/images/_masked_image.py +0 -0
  73. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/images/_ome_zarr_container.py +0 -0
  74. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/__init__.py +0 -0
  75. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/_meta_handlers.py +0 -0
  76. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/ngio_specs/__init__.py +0 -0
  77. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/ngio_specs/_axes.py +0 -0
  78. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/ngio_specs/_channels.py +0 -0
  79. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/ngio_specs/_dataset.py +0 -0
  80. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py +0 -0
  81. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/ngio_specs/_ngio_image.py +0 -0
  82. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/ngio_specs/_pixel_size.py +0 -0
  83. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/v04/__init__.py +0 -0
  84. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/v04/_custom_models.py +0 -0
  85. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/ome_zarr_meta/v04/_v04_spec_utils.py +0 -0
  86. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/__init__.py +0 -0
  87. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/_abstract_table.py +0 -0
  88. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/__init__.py +0 -0
  89. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/_abstract_backend.py +0 -0
  90. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/_anndata.py +0 -0
  91. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/_anndata_utils.py +0 -0
  92. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/_csv.py +0 -0
  93. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/_json.py +0 -0
  94. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/_non_zarr_backends.py +0 -0
  95. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/_parquet.py +0 -0
  96. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/_table_backends.py +0 -0
  97. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/backends/_utils.py +0 -0
  98. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/v1/__init__.py +0 -0
  99. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/v1/_feature_table.py +0 -0
  100. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/v1/_generic_table.py +0 -0
  101. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/tables/v1/_roi_table.py +0 -0
  102. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/utils/_errors.py +0 -0
  103. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/utils/_fractal_fsspec_store.py +0 -0
  104. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/utils/_logger.py +0 -0
  105. {ngio-0.3.2 → ngio-0.3.3}/src/ngio/utils/_zarr_utils.py +0 -0
  106. {ngio-0.3.2 → ngio-0.3.3}/tests/conftest.py +0 -0
  107. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/.zattrs +0 -0
  108. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/.zgroup +0 -0
  109. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/0/.zarray +0 -0
  110. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/1/.zarray +0 -0
  111. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/labels/.zattrs +0 -0
  112. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/labels/.zgroup +0 -0
  113. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/.zattrs +0 -0
  114. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/.zgroup +0 -0
  115. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/0/.zarray +0 -0
  116. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/1/.zarray +0 -0
  117. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/.zattrs +0 -0
  118. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/.zgroup +0 -0
  119. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/0/.zarray +0 -0
  120. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/1/.zarray +0 -0
  121. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/labels/.zattrs +0 -0
  122. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/labels/.zgroup +0 -0
  123. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/labels/label/.zattrs +0 -0
  124. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/labels/label/.zgroup +0 -0
  125. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/labels/label/0/.zarray +0 -0
  126. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_cyx.zarr/labels/label/1/.zarray +0 -0
  127. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/.zattrs +0 -0
  128. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/.zgroup +0 -0
  129. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/0/.zarray +0 -0
  130. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/1/.zarray +0 -0
  131. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/labels/.zattrs +0 -0
  132. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/labels/.zgroup +0 -0
  133. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/labels/label/.zattrs +0 -0
  134. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/labels/label/.zgroup +0 -0
  135. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/labels/label/0/.zarray +0 -0
  136. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_czyx.zarr/labels/label/1/.zarray +0 -0
  137. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/.zattrs +0 -0
  138. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/.zgroup +0 -0
  139. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/0/.zarray +0 -0
  140. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/1/.zarray +0 -0
  141. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/labels/.zattrs +0 -0
  142. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/labels/.zgroup +0 -0
  143. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/.zattrs +0 -0
  144. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/.zgroup +0 -0
  145. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/0/.zarray +0 -0
  146. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/1/.zarray +0 -0
  147. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/.zattrs +0 -0
  148. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/.zgroup +0 -0
  149. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/0/.zarray +0 -0
  150. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/1/.zarray +0 -0
  151. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/labels/.zattrs +0 -0
  152. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/labels/.zgroup +0 -0
  153. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/.zattrs +0 -0
  154. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/.zgroup +0 -0
  155. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/0/.zarray +0 -0
  156. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/1/.zarray +0 -0
  157. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/.zattrs +0 -0
  158. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/.zgroup +0 -0
  159. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/0/.zarray +0 -0
  160. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/1/.zarray +0 -0
  161. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/labels/.zattrs +0 -0
  162. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/labels/.zgroup +0 -0
  163. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/labels/label/.zattrs +0 -0
  164. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/labels/label/.zgroup +0 -0
  165. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/labels/label/0/.zarray +0 -0
  166. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tyx.zarr/labels/label/1/.zarray +0 -0
  167. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/.zattrs +0 -0
  168. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/.zgroup +0 -0
  169. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/0/.zarray +0 -0
  170. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/1/.zarray +0 -0
  171. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/labels/.zattrs +0 -0
  172. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/labels/.zgroup +0 -0
  173. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/.zattrs +0 -0
  174. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/.zgroup +0 -0
  175. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/0/.zarray +0 -0
  176. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/1/.zarray +0 -0
  177. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/.zattrs +0 -0
  178. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/.zgroup +0 -0
  179. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/0/.zarray +0 -0
  180. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/1/.zarray +0 -0
  181. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/labels/.zattrs +0 -0
  182. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/labels/.zgroup +0 -0
  183. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/labels/label/.zattrs +0 -0
  184. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/labels/label/.zgroup +0 -0
  185. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/labels/label/0/.zarray +0 -0
  186. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_yx.zarr/labels/label/1/.zarray +0 -0
  187. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/.zattrs +0 -0
  188. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/.zgroup +0 -0
  189. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/0/.zarray +0 -0
  190. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/1/.zarray +0 -0
  191. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/labels/.zattrs +0 -0
  192. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/labels/.zgroup +0 -0
  193. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/labels/label/.zattrs +0 -0
  194. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/labels/label/.zgroup +0 -0
  195. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/labels/label/0/.zarray +0 -0
  196. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/images/test_image_zyx.zarr/labels/label/1/.zarray +0 -0
  197. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/meta/base_ome_zarr_image_meta.json +0 -0
  198. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/meta/base_ome_zarr_image_meta_wrong_axis_order.json +0 -0
  199. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/meta/base_ome_zarr_label_meta.json +0 -0
  200. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/meta/base_ome_zarr_well_meta.json +0 -0
  201. {ngio-0.3.2 → ngio-0.3.3}/tests/data/v04/meta/ome_zarr_well_path_normalization_meta.json +0 -0
  202. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/common/test_dimensions.py +0 -0
  203. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/common/test_pyramid.py +0 -0
  204. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/common/test_roi.py +0 -0
  205. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/common/test_table_ops.py +0 -0
  206. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/hcs/test_plate.py +0 -0
  207. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/hcs/test_well.py +0 -0
  208. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/images/test_create.py +0 -0
  209. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/images/test_images.py +0 -0
  210. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/images/test_masked_images.py +0 -0
  211. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/images/test_omezarr_container.py +0 -0
  212. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/ome_zarr_meta/test_image_handler.py +0 -0
  213. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/ome_zarr_meta/test_unit_ngio_specs.py +0 -0
  214. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/ome_zarr_meta/test_unit_v04_utils.py +0 -0
  215. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/tables/test_backends.py +0 -0
  216. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/tables/test_backends_utils.py +0 -0
  217. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/tables/test_feature_table.py +0 -0
  218. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/tables/test_generic_table.py +0 -0
  219. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/tables/test_masking_roi_table_v1.py +0 -0
  220. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/tables/test_roi_table_v1.py +0 -0
  221. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/tables/test_table_group.py +0 -0
  222. {ngio-0.3.2 → ngio-0.3.3}/tests/unit/utils/test_zarr_utils.py +0 -0
@@ -4,28 +4,23 @@ on:
4
4
  push:
5
5
  branches:
6
6
  - dev
7
+ - main
7
8
  tags:
8
9
  - "v*"
9
10
 
10
- jobs:
11
- download-test-ome-zarr:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v4
15
- - name: Check and Download Artifacts
16
- run: |
17
- bash .github/scripts/download_data.sh
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
18
14
 
15
+ jobs:
19
16
  deploy:
20
17
  name: Deploy Docs
21
- needs: download-test-ome-zarr
22
18
  runs-on: ubuntu-latest
23
19
 
24
20
  steps:
25
21
  - uses: actions/checkout@v4
26
22
  with:
27
23
  fetch-depth: 0
28
-
29
24
  - name: 🐍 Set up Python
30
25
  uses: actions/setup-python@v5
31
26
  with:
@@ -44,6 +39,15 @@ jobs:
44
39
  git config --local user.email "github-actions[bot]@users.noreply.github.com"
45
40
  git config --local user.name "github-actions[bot]"
46
41
 
42
+ - name: Restore shared data cache
43
+ id: cache-data
44
+ uses: actions/cache@v4
45
+ with:
46
+ path: data/
47
+ key: "${{ runner.os }}-data-${{ hashFiles('tests/conftest.py') }}"
48
+ restore-keys: |
49
+ "${{ runner.os }}-data-"
50
+
47
51
  - name: Deploy docs
48
52
  run: |
49
53
  VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///' | sed 's/refs\/heads\///')
@@ -53,9 +57,10 @@ jobs:
53
57
  if [[ $GITHUB_REF == refs/tags/* ]] && [[ $VERSION =~ ^v[0-9.]+$ ]]; then
54
58
  mike deploy --push --update-aliases $VERSION stable
55
59
  mike set-default --push stable
56
- echo "Deployed stable version"
57
- else
60
+ echo "Deployed stable version $VERSION (stable)"
61
+
62
+ elif [[ $GITHUB_REF == refs/heads/dev ]]; then
58
63
  mike deploy --push dev
59
64
  mike set-default --push dev
60
- echo "Deployed development version"
65
+ echo "Deployed development version (dev)"
61
66
  fi
@@ -27,49 +27,18 @@ jobs:
27
27
  - uses: actions/checkout@v4
28
28
  - run: pipx run check-manifest
29
29
 
30
-
31
- download-test-ome-zarr:
32
- runs-on: ubuntu-latest
33
- steps:
34
- - uses: actions/checkout@v4
35
- - name: Check and Download Artifacts
36
- run: |
37
- bash .github/scripts/download_data.sh
38
- - name: Upload Artifacts
39
- uses: actions/upload-artifact@v4
40
- with:
41
- name: data
42
- path: data
43
-
44
-
45
30
  test:
46
31
  name: ${{ matrix.platform }} (${{ matrix.python-version }})
47
- needs: download-test-ome-zarr
48
32
  runs-on: ${{ matrix.platform }}
49
33
  strategy:
50
34
  fail-fast: false
51
35
  matrix:
52
36
  python-version: ["3.11", "3.12", "3.13"]
53
37
  platform: [ubuntu-latest, macos-latest, windows-latest]
54
- # platform: [ubuntu-latest, macos-latest]
55
- exclude:
56
- - python-version: "3.11"
57
- platform: windows-latest
58
- - python-version: "3.12"
59
- platform: windows-latest
60
38
 
61
39
  steps:
62
40
  - uses: actions/checkout@v4
63
41
 
64
- - uses: actions/download-artifact@v4
65
- with:
66
- name: data
67
- path: data
68
-
69
- - name: Check Artifacts
70
- run: |
71
- ls -l data
72
-
73
42
  - name: 🐍 Set up Python ${{ matrix.python-version }}
74
43
  uses: actions/setup-python@v5
75
44
  with:
@@ -82,6 +51,15 @@ jobs:
82
51
  python -m pip install -U pip
83
52
  # if running a cron job, we add the --pre flag to test against pre-releases
84
53
  python -m pip install .[test] ${{ github.event_name == 'schedule' && '--pre' || '' }}
54
+
55
+ - name: Restore shared data cache
56
+ id: cache-data
57
+ uses: actions/cache@v4
58
+ with:
59
+ path: data/
60
+ key: "${{ runner.os }}-data-${{ hashFiles('tests/conftest.py') }}"
61
+ restore-keys: |
62
+ "${{ runner.os }}-data-"
85
63
 
86
64
  - name: 🧪 Run Tests
87
65
  run: pytest
@@ -101,7 +79,6 @@ jobs:
101
79
  update_existing: true
102
80
 
103
81
  - name: Coverage
104
- if: ${{ matrix.python-version == '3.10' }} && ${{ matrix.platform == 'ubuntu-latest' }}
105
82
  uses: codecov/codecov-action@v5
106
83
  with:
107
84
  token: ${{ secrets.CODECOV_TOKEN }}
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.3.3]
4
+
5
+ ### Chores
6
+
7
+ - improve dataset download process and streamline the CI workflows
8
+
3
9
  ## [v0.3.2]
4
10
 
5
11
  ### API Changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngio
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Next Generation file format IO
5
5
  Project-URL: homepage, https://github.com/fractal-analytics-platform/ngio
6
6
  Project-URL: repository, https://github.com/fractal-analytics-platform/ngio
@@ -57,7 +57,7 @@ from ngio.utils import download_ome_zarr_dataset
57
57
 
58
58
  # Download a sample dataset
59
59
  download_dir = Path("./data")
60
- download_dir = Path(".").absolute().parent.parent / "data" # markdown-exec: hide
60
+ download_dir = Path(".").absolute() / "data" # markdown-exec: hide
61
61
  hcs_path = download_ome_zarr_dataset("CardiomyocyteSmallMip", download_dir=download_dir)
62
62
  image_path = hcs_path / "B" / "03" / "0"
63
63
  ```
@@ -9,7 +9,7 @@ from ngio.utils import download_ome_zarr_dataset
9
9
 
10
10
  # Download a sample dataset
11
11
  download_dir = Path("./data")
12
- download_dir = Path(".").absolute().parent.parent / "data" # markdown-exec: hide
12
+ download_dir = Path(".").absolute() / "data" # markdown-exec: hide
13
13
  hcs_path = download_ome_zarr_dataset("CardiomyocyteSmallMip", download_dir=download_dir)
14
14
  image_path = hcs_path / "B" / "03" / "0"
15
15
 
@@ -10,7 +10,7 @@ from ngio import open_ome_zarr_container
10
10
  from ngio.utils import download_ome_zarr_dataset
11
11
 
12
12
  # Download a sample dataset
13
- download_dir = Path(".").absolute().parent.parent / "data"
13
+ download_dir = Path(".").absolute() / "data"
14
14
  hcs_path = download_ome_zarr_dataset("CardiomyocyteSmallMip", download_dir=download_dir)
15
15
  image_path = hcs_path / "B" / "03" / "0"
16
16
 
@@ -10,7 +10,7 @@ Let's open an `OmeZarrPlate` object.
10
10
  >>> from pathlib import Path # markdown-exec: hide
11
11
  >>> from ngio.utils import download_ome_zarr_dataset
12
12
  >>> from ngio import open_ome_zarr_plate
13
- >>> download_dir = Path(".").absolute().parent.parent / "data" # markdown-exec: hide
13
+ >>> download_dir = Path(".").absolute() / "data" # markdown-exec: hide
14
14
  >>> hcs_path = download_ome_zarr_dataset("CardiomyocyteSmallMip", download_dir=download_dir)
15
15
  >>> ome_zarr_plate = open_ome_zarr_plate(hcs_path)
16
16
  >>> ome_zarr_plate
@@ -111,6 +111,7 @@ The `OmeZarrPlate` object provides a method to get the image objects in a well.
111
111
  Ngio provides a utility function to create a plate.
112
112
 
113
113
  The first step is to create a list of `ImageInWellPath` objects. Each `ImageInWellPath` object contains the path to the image and the corresponding well.
114
+
114
115
  ```python exec="true" source="console" session="hcs_plate"
115
116
  from ngio import ImageInWellPath
116
117
  list_of_images = [ImageInWellPath(path="0", row="A", column=0),
@@ -124,6 +125,7 @@ list_of_images = [ImageInWellPath(path="0", row="A", column=0),
124
125
  The order in which the images are added is not important. The `rows` and `columns` attributes of the plate will be sorted in alphabetical/numerical order.
125
126
 
126
127
  Then, you can create the plate using the `create_empty_plate` function.
128
+
127
129
  ```pycon exec="true" source="console" session="hcs_plate"
128
130
  >>> from ngio import create_empty_plate
129
131
  >>> plate = create_empty_plate(store="new_plate.zarr", name="test_plate", images=list_of_images, overwrite=True)
@@ -131,7 +133,7 @@ Then, you can create the plate using the `create_empty_plate` function.
131
133
  >>> print(plate) # markdown-exec: hide
132
134
  ```
133
135
 
134
- This has created a new empty plate with the metadata correctly set. But no images have been added yet.
136
+ This has created a new empty plate with the metadata correctly set. But no images have been added yet.
135
137
 
136
138
  ### Modifying the plate
137
139
 
@@ -200,7 +200,7 @@ class OmeZarrWell:
200
200
  )
201
201
 
202
202
 
203
- def _buil_extras(paths: Collection[str]) -> list[dict[str, str]]:
203
+ def _build_extras(paths: Collection[str]) -> list[dict[str, str]]:
204
204
  """Build the extras for the images.
205
205
 
206
206
  Args:
@@ -1021,7 +1021,7 @@ class OmeZarrPlate:
1021
1021
  if 'lazy', the table will be loaded as a lazy frame.
1022
1022
  """
1023
1023
  images = self.get_images(acquisition=acquisition)
1024
- extras = _buil_extras(images.keys())
1024
+ extras = _build_extras(images.keys())
1025
1025
  return concatenate_image_tables(
1026
1026
  images=images.values(),
1027
1027
  extras=extras,
@@ -1055,7 +1055,7 @@ class OmeZarrPlate:
1055
1055
  if 'lazy', the table will be loaded as a lazy frame.
1056
1056
  """
1057
1057
  images = self.get_images(acquisition=acquisition)
1058
- extras = _buil_extras(images.keys())
1058
+ extras = _build_extras(images.keys())
1059
1059
  return concatenate_image_tables_as(
1060
1060
  images=images.values(),
1061
1061
  extras=extras,
@@ -1088,7 +1088,7 @@ class OmeZarrPlate:
1088
1088
  if 'lazy', the table will be loaded as a lazy frame.
1089
1089
  """
1090
1090
  images = await self.get_images_async(acquisition=acquisition)
1091
- extras = _buil_extras(images.keys())
1091
+ extras = _build_extras(images.keys())
1092
1092
  return await concatenate_image_tables_async(
1093
1093
  images=images.values(),
1094
1094
  extras=extras,
@@ -1122,7 +1122,7 @@ class OmeZarrPlate:
1122
1122
  if 'lazy', the table will be loaded as a lazy frame.
1123
1123
  """
1124
1124
  images = await self.get_images_async(acquisition=acquisition)
1125
- extras = _buil_extras(images.keys())
1125
+ extras = _build_extras(images.keys())
1126
1126
  return await concatenate_image_tables_as_async(
1127
1127
  images=images.values(),
1128
1128
  extras=extras,
@@ -97,7 +97,7 @@ class Table(Protocol):
97
97
 
98
98
  Either a handler or a backend must be provided.
99
99
 
100
- If the hanlder in none it will be inferred from the backend.
100
+ If the handler in none it will be inferred from the backend.
101
101
  If the backend is none, it will be inferred from the group attrs
102
102
  """
103
103
  ...
@@ -23,7 +23,7 @@ class ConditionTableV1(AbstractBaseTable):
23
23
  The condition table is a generic table that does not
24
24
  have a specific definition.
25
25
 
26
- It is used to store informations about the particular conditions
26
+ It is used to store information about the particular conditions
27
27
  used to generate the data.
28
28
  - How much drug was used in the experiment
29
29
  - What treatment was used
@@ -3,7 +3,11 @@
3
3
  import os
4
4
 
5
5
  from ngio.common._common_types import ArrayLike
6
- from ngio.utils._datasets import download_ome_zarr_dataset, list_ome_zarr_datasets
6
+ from ngio.utils._datasets import (
7
+ download_ome_zarr_dataset,
8
+ list_ome_zarr_datasets,
9
+ print_datasets_infos,
10
+ )
7
11
  from ngio.utils._errors import (
8
12
  NgioFileExistsError,
9
13
  NgioFileNotFoundError,
@@ -34,13 +38,13 @@ __all__ = [
34
38
  "NgioValueError",
35
39
  "StoreOrGroup",
36
40
  "ZarrGroupHandler",
37
- # Datasets
41
+ # Other
38
42
  "download_ome_zarr_dataset",
39
- # Fractal
40
43
  "fractal_fsspec_store",
41
44
  "list_ome_zarr_datasets",
42
45
  # Logger
43
46
  "ngio_logger",
44
47
  "open_group_wrapper",
48
+ "print_datasets_infos",
45
49
  "set_logger_level",
46
50
  ]
@@ -0,0 +1,154 @@
1
+ """Download testing OME-Zarr datasets."""
2
+
3
+ import shutil
4
+ from pathlib import Path
5
+ from typing import Literal
6
+
7
+ import pooch
8
+
9
+ from ngio.utils._errors import NgioValueError
10
+
11
+
12
+ class UnzipAndRename(pooch.Unzip):
13
+ """Unzip and rename the extracted directory."""
14
+
15
+ def __init__(
16
+ self,
17
+ extract_dir: str = "",
18
+ out_name: str = "ome-zarr.zarr",
19
+ re_unzip: bool = True,
20
+ **kwargs,
21
+ ):
22
+ super().__init__(extract_dir=extract_dir, **kwargs)
23
+ self.out_name = out_name
24
+ self.re_unzip = re_unzip
25
+
26
+ def output_file(self) -> Path:
27
+ """Return the output file path."""
28
+ if self.extract_dir is None:
29
+ raise NgioValueError("extract_dir must be set for UnzipAndRename.")
30
+
31
+ return Path(self.extract_dir) / self.out_name
32
+
33
+ def _extract_file(self, fname, extract_dir):
34
+ """Extract the file and rename it."""
35
+ output_path = self.output_file()
36
+ if output_path.exists() and not self.re_unzip:
37
+ # Nothing to do, the file already exists and we are not re-unzipping
38
+ return None
39
+
40
+ tmp_dir = Path(extract_dir) / "tmp"
41
+ super()._extract_file(fname, tmp_dir)
42
+
43
+ list_extracted_dirs = tmp_dir.iterdir()
44
+ # Keep only if ends with .zarr
45
+ list_extracted_dirs = filter(
46
+ lambda x: x.name.endswith(".zarr"),
47
+ list_extracted_dirs,
48
+ )
49
+ list_extracted_dirs = list(list_extracted_dirs)
50
+ if len(list_extracted_dirs) != 1:
51
+ raise NgioValueError(
52
+ "Expected one directory to be extracted, "
53
+ f"got {len(list_extracted_dirs)}."
54
+ )
55
+
56
+ extracted_dir = list_extracted_dirs[0]
57
+ if output_path.exists():
58
+ shutil.rmtree(output_path, ignore_errors=True)
59
+
60
+ extracted_dir.rename(output_path)
61
+ # Clean up the temporary directory
62
+ shutil.rmtree(tmp_dir, ignore_errors=True)
63
+
64
+
65
+ _ome_zarr_zoo = {
66
+ "CardiomyocyteTiny": {
67
+ "url": "https://zenodo.org/records/13305156/files/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr.zip",
68
+ "known_hash": "md5:efc21fe8d4ea3abab76226d8c166452c",
69
+ "fname": "20200812-CardiomyocyteDifferentiation14-Cycle1-tiny.zarr.zip",
70
+ "description": "Tiny cardiomyocyte dataset 3D (32MB).",
71
+ },
72
+ "CardiomyocyteTinyMip": {
73
+ "url": "https://zenodo.org/records/13305156/files/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip",
74
+ "known_hash": "md5:51809479777cafbe9ac0f9fa5636aa95",
75
+ "fname": "20200812-CardiomyocyteDifferentiation14-Cycle1-tiny-mip.zarr.zip",
76
+ "description": "Tiny cardiomyocyte dataset 2D MIP (16.4MB).",
77
+ },
78
+ "CardiomyocyteSmall": {
79
+ "url": "https://zenodo.org/records/13305316/files/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr.zip",
80
+ "known_hash": "md5:d5752ed4b72a9092a0290b3c04c0b9c2",
81
+ "fname": "20200812-CardiomyocyteDifferentiation14-Cycle1-small.zarr.zip",
82
+ "description": "Small cardiomyocyte dataset 3D (750MB).",
83
+ },
84
+ "CardiomyocyteSmallMip": {
85
+ "url": "https://zenodo.org/records/13305316/files/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip",
86
+ "known_hash": "md5:3ed3ea898e0ed42d397da2e1dbe40750",
87
+ "fname": "20200812-CardiomyocyteDifferentiation14-Cycle1-small-mip.zarr.zip",
88
+ "description": "Small cardiomyocyte dataset 2D MIP (106MB).",
89
+ },
90
+ "CardiomyocyteMediumMip": {
91
+ "url": "https://zenodo.org/records/14826000/files/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip",
92
+ "known_hash": "md5:3f932bbf7fc0577f58b97471707816a1",
93
+ "fname": "20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip",
94
+ "description": "Medium cardiomyocyte dataset 2D MIP (30GB).",
95
+ },
96
+ }
97
+
98
+ AVAILABLE_DATASETS = Literal[
99
+ "CardiomyocyteTiny",
100
+ "CardiomyocyteTinyMip",
101
+ "CardiomyocyteSmall",
102
+ "CardiomyocyteSmallMip",
103
+ "CardiomyocyteMediumMip",
104
+ ]
105
+
106
+
107
+ def list_ome_zarr_datasets() -> list[str]:
108
+ """List available OME-Zarr datasets."""
109
+ return list(_ome_zarr_zoo.keys())
110
+
111
+
112
+ def print_datasets_infos() -> None:
113
+ for dataset_name, dataset_info in _ome_zarr_zoo.items():
114
+ print(f"{dataset_name} - Description: {dataset_info['description']}")
115
+
116
+
117
+ def download_ome_zarr_dataset(
118
+ dataset_name: AVAILABLE_DATASETS | str,
119
+ download_dir: str | Path = "data",
120
+ re_unzip: bool = True,
121
+ progressbar: bool = False,
122
+ ) -> Path:
123
+ """Download an OME-Zarr dataset.
124
+
125
+ To list available datasets, use `list_ome_zarr_datasets`.
126
+
127
+ Args:
128
+ dataset_name (str): The dataset name.
129
+ download_dir (str): The download directory. Defaults to "data".
130
+ re_unzip (bool): If True, it will unzip the dataset even if it already exists.
131
+ progressbar (bool): If True, show a progress bar during download.
132
+ """
133
+ if dataset_name not in _ome_zarr_zoo:
134
+ raise NgioValueError(f"Dataset {dataset_name} not found in the OME-Zarr zoo.")
135
+ zenodo_infos = _ome_zarr_zoo[dataset_name]
136
+
137
+ fname = zenodo_infos["fname"]
138
+ zarrname = fname.replace(".zip", "")
139
+
140
+ processor = UnzipAndRename(
141
+ extract_dir="",
142
+ out_name=zarrname,
143
+ re_unzip=re_unzip,
144
+ )
145
+
146
+ pooch.retrieve(
147
+ url=zenodo_infos["url"],
148
+ known_hash=zenodo_infos["known_hash"],
149
+ fname=fname,
150
+ path=download_dir,
151
+ processor=processor,
152
+ progressbar=progressbar,
153
+ )
154
+ return processor.output_file()
@@ -2,11 +2,16 @@ from pathlib import Path
2
2
 
3
3
  import pytest
4
4
 
5
- from ngio.utils import download_ome_zarr_dataset, list_ome_zarr_datasets
5
+ from ngio.utils import (
6
+ download_ome_zarr_dataset,
7
+ list_ome_zarr_datasets,
8
+ print_datasets_infos,
9
+ )
6
10
 
7
11
 
8
12
  def test_list_datasets():
9
13
  assert len(list_ome_zarr_datasets()) > 0
14
+ print_datasets_infos()
10
15
 
11
16
 
12
17
  def test_fail_download_ome_zarr_dataset(tmp_path: Path):
@@ -1,97 +0,0 @@
1
- #!/bin/bash
2
- # filepath: download_zarr_datasets.sh
3
-
4
- # Default download directory
5
- DOWNLOAD_DIR="data"
6
-
7
- # Create download directory if it doesn't exist
8
- mkdir -p "$DOWNLOAD_DIR"
9
-
10
- # Function to check MD5 hash
11
- check_md5() {
12
- local file="$1"
13
- local expected="$2"
14
-
15
- if [[ "$(uname)" == "Darwin" ]]; then
16
- # macOS
17
- actual=$(md5 -q "$file")
18
- else
19
- # Linux/Ubuntu
20
- actual=$(md5sum "$file" | awk '{print $1}')
21
- fi
22
-
23
- echo "Expected: $expected"
24
- echo "Actual: $actual"
25
-
26
- if [[ "$actual" == "$expected" ]]; then
27
- return 0 # Success
28
- else
29
- return 1 # Failure
30
- fi
31
- }
32
-
33
- # Function to download a file
34
- download_file() {
35
- local url="$1"
36
- local output="$2"
37
-
38
- echo "Downloading $url to $output..."
39
-
40
- if command -v curl &> /dev/null; then
41
- curl -L -o "$output" "$url"
42
- elif command -v wget &> /dev/null; then
43
- wget -O "$output" "$url"
44
- else
45
- echo "Error: Neither curl nor wget is available. Please install one of them."
46
- exit 1
47
- fi
48
- }
49
-
50
- # Function to process a dataset
51
- process_dataset() {
52
- local filename="$1"
53
- local url="$2"
54
- local expected_hash="$3"
55
-
56
- local file_path="$DOWNLOAD_DIR/$filename"
57
-
58
- echo "Processing $filename..."
59
-
60
- # Check if file exists and has the correct hash
61
- if [[ -f "$file_path" ]] && check_md5 "$file_path" "$expected_hash"; then
62
- echo "File exists and has the correct hash."
63
- else
64
- # File doesn't exist or has incorrect hash
65
- if [[ -f "$file_path" ]]; then
66
- echo "File exists but has incorrect hash. Redownloading..."
67
- else
68
- echo "File doesn't exist. Downloading..."
69
- fi
70
-
71
- download_file "$url" "$file_path"
72
-
73
- # Verify the downloaded file
74
- if check_md5 "$file_path" "$expected_hash"; then
75
- echo "Download successful and hash verified."
76
- else
77
- echo "Error: Downloaded file has incorrect hash."
78
- return 1
79
- fi
80
- fi
81
-
82
- echo "File is ready at $file_path"
83
- return 0
84
- }
85
-
86
- # Process the CardioMyocyte dataset
87
- process_dataset "20200812-CardiomyocyteDifferentiation14-Cycle1.zarr.zip" \
88
- "https://zenodo.org/records/13305156/files/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr.zip" \
89
- "efc21fe8d4ea3abab76226d8c166452c"
90
-
91
- process_dataset "20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip" \
92
- "https://zenodo.org/records/13305316/files/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip" \
93
- "3ed3ea898e0ed42d397da2e1dbe40750"
94
- # To add more datasets, add more calls to process_dataset like this:
95
- # process_dataset "filename.zip" "download_url" "expected_md5_hash"
96
-
97
- echo "All datasets processed."
@@ -1,53 +0,0 @@
1
- """Download testing OME-Zarr datasets."""
2
-
3
- from pathlib import Path
4
-
5
- import pooch
6
-
7
- from ngio.utils._errors import NgioValueError
8
-
9
- _ome_zarr_zoo = {
10
- "CardiomyocyteTiny": {
11
- "url": "https://zenodo.org/records/13305156/files/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr.zip",
12
- "known_hash": "md5:efc21fe8d4ea3abab76226d8c166452c",
13
- "fname": "20200812-CardiomyocyteDifferentiation14-Cycle1.zarr.zip",
14
- "processor": pooch.Unzip(extract_dir=""),
15
- },
16
- "CardiomyocyteSmallMip": {
17
- "url": "https://zenodo.org/records/13305316/files/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip",
18
- "known_hash": "md5:3ed3ea898e0ed42d397da2e1dbe40750",
19
- "fname": "20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip",
20
- "processor": pooch.Unzip(extract_dir=""),
21
- },
22
- }
23
-
24
-
25
- def list_ome_zarr_datasets() -> list[str]:
26
- """List available OME-Zarr datasets."""
27
- return list(_ome_zarr_zoo.keys())
28
-
29
-
30
- def download_ome_zarr_dataset(
31
- dataset_name: str,
32
- download_dir: str | Path = "data",
33
- ) -> Path:
34
- """Download an OME-Zarr dataset.
35
-
36
- To list available datasets, use `list_ome_zarr_datasets`.
37
-
38
- Args:
39
- dataset_name (str): The dataset name.
40
- download_dir (str): The download directory. Defaults to "data".
41
- """
42
- if dataset_name not in _ome_zarr_zoo:
43
- raise NgioValueError(f"Dataset {dataset_name} not found in the OME-Zarr zoo.")
44
- ome_zarr_url = _ome_zarr_zoo[dataset_name]
45
- pooch.retrieve(
46
- path=download_dir,
47
- **ome_zarr_url,
48
- )
49
- path = Path(download_dir) / ome_zarr_url["fname"]
50
-
51
- if isinstance(ome_zarr_url["processor"], pooch.Unzip):
52
- path = path.with_suffix("")
53
- return path
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