lamindb 1.9.1__tar.gz → 1.10.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 (289) hide show
  1. {lamindb-1.9.1 → lamindb-1.10.0}/.gitignore +1 -0
  2. {lamindb-1.9.1 → lamindb-1.10.0}/PKG-INFO +3 -3
  3. {lamindb-1.9.1 → lamindb-1.10.0}/docs/arrays.ipynb +106 -0
  4. {lamindb-1.9.1 → lamindb-1.10.0}/docs/registries.ipynb +2 -2
  5. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/vitessce.ipynb +3 -2
  6. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/__init__.py +1 -1
  7. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/__init__.py +2 -2
  8. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/__init__.py +2 -1
  9. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/_anndata_accessor.py +10 -1
  10. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/_backed_access.py +4 -0
  11. lamindb-1.10.0/lamindb/core/storage/_spatialdata_accessor.py +52 -0
  12. lamindb-1.10.0/lamindb/examples/__init__.py +14 -0
  13. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/examples/cellxgene/_cellxgene.py +11 -3
  14. lamindb-1.10.0/lamindb/examples/croissant/__init__.py +44 -0
  15. lamindb-1.10.0/lamindb/examples/croissant/mini_immuno.anndata.zarr_metadata.json +73 -0
  16. {lamindb-1.9.1/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/__init__.py +1 -1
  17. {lamindb-1.9.1/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/mini_immuno.py +19 -8
  18. lamindb-1.10.0/lamindb/examples/schemas/_anndata.py +35 -0
  19. lamindb-1.10.0/lamindb/examples/schemas/_simple.py +33 -0
  20. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/integrations/__init__.py +2 -0
  21. lamindb-1.10.0/lamindb/integrations/_croissant.py +122 -0
  22. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/integrations/_vitessce.py +14 -12
  23. lamindb-1.10.0/lamindb/migrations/0116_remove_artifact_unique_artifact_storage_key_hash_and_more.py +51 -0
  24. lamindb-1.10.0/lamindb/migrations/0117_fix_artifact_storage_hash_unique_constraints.py +32 -0
  25. lamindb-1.9.1/lamindb/migrations/0115_squashed.py → lamindb-1.10.0/lamindb/migrations/0117_squashed.py +29 -6
  26. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/_describe.py +107 -1
  27. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/_django.py +63 -6
  28. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/_feature_manager.py +0 -1
  29. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/artifact.py +41 -11
  30. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/collection.py +4 -9
  31. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/project.py +2 -2
  32. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/record.py +1 -1
  33. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/run.py +1 -1
  34. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/sqlrecord.py +3 -0
  35. {lamindb-1.9.1 → lamindb-1.10.0}/noxfile.py +1 -1
  36. {lamindb-1.9.1 → lamindb-1.10.0}/pyproject.toml +2 -2
  37. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/_dataset_fixtures.py +14 -1
  38. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_artifact.py +14 -6
  39. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_collection.py +16 -0
  40. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_describe_and_df_calls.py +4 -4
  41. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_feature.py +11 -2
  42. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_feature_label_manager.py +8 -4
  43. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_save.py +11 -9
  44. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_tracked.py +8 -1
  45. {lamindb-1.9.1 → lamindb-1.10.0}/tests/curators/conftest.py +4 -0
  46. lamindb-1.10.0/tests/curators/test_curate_from_croissant.py +43 -0
  47. {lamindb-1.9.1 → lamindb-1.10.0}/tests/curators/test_curators_general.py +27 -0
  48. {lamindb-1.9.1 → lamindb-1.10.0}/tests/permissions/scripts/setup_access.py +1 -1
  49. {lamindb-1.9.1 → lamindb-1.10.0}/tests/storage/test_streaming.py +3 -2
  50. lamindb-1.9.1/lamindb/examples/__init__.py +0 -29
  51. lamindb-1.9.1/lamindb/examples/schemas/_anndata.py +0 -25
  52. lamindb-1.9.1/lamindb/examples/schemas/_simple.py +0 -19
  53. {lamindb-1.9.1 → lamindb-1.10.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  54. {lamindb-1.9.1 → lamindb-1.10.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  55. {lamindb-1.9.1 → lamindb-1.10.0}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
  56. {lamindb-1.9.1 → lamindb-1.10.0}/.github/ISSUE_TEMPLATE/usage_question.yml +0 -0
  57. {lamindb-1.9.1 → lamindb-1.10.0}/.github/workflows/build.yml +0 -0
  58. {lamindb-1.9.1 → lamindb-1.10.0}/.github/workflows/doc-changes.yml +0 -0
  59. {lamindb-1.9.1 → lamindb-1.10.0}/.gitmodules +0 -0
  60. {lamindb-1.9.1 → lamindb-1.10.0}/.pre-commit-config.yaml +0 -0
  61. {lamindb-1.9.1 → lamindb-1.10.0}/CONTRIBUTING.md +0 -0
  62. {lamindb-1.9.1 → lamindb-1.10.0}/LICENSE +0 -0
  63. {lamindb-1.9.1 → lamindb-1.10.0}/README.md +0 -0
  64. {lamindb-1.9.1 → lamindb-1.10.0}/docs/api.md +0 -0
  65. {lamindb-1.9.1 → lamindb-1.10.0}/docs/bio-registries.ipynb +0 -0
  66. {lamindb-1.9.1 → lamindb-1.10.0}/docs/bionty.md +0 -0
  67. {lamindb-1.9.1 → lamindb-1.10.0}/docs/changelog.md +0 -0
  68. {lamindb-1.9.1 → lamindb-1.10.0}/docs/clinicore.md +0 -0
  69. {lamindb-1.9.1 → lamindb-1.10.0}/docs/curate.ipynb +0 -0
  70. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/acid.ipynb +0 -0
  71. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/curate-any.ipynb +0 -0
  72. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/delete.ipynb +0 -0
  73. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/idempotency.ipynb +0 -0
  74. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/import-modules.ipynb +0 -0
  75. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/keep-artifacts-local.ipynb +0 -0
  76. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/pydantic-pandera.ipynb +0 -0
  77. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/reference-field.ipynb +0 -0
  78. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/search.ipynb +0 -0
  79. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/setup.ipynb +0 -0
  80. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/symbol-mapping.ipynb +0 -0
  81. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/test_notebooks.py +0 -0
  82. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/track-run-inputs.ipynb +0 -0
  83. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/validate-fields.ipynb +0 -0
  84. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq/visibility.ipynb +0 -0
  85. {lamindb-1.9.1 → lamindb-1.10.0}/docs/faq.md +0 -0
  86. {lamindb-1.9.1 → lamindb-1.10.0}/docs/guide.md +0 -0
  87. {lamindb-1.9.1 → lamindb-1.10.0}/docs/includes/installation.md +0 -0
  88. {lamindb-1.9.1 → lamindb-1.10.0}/docs/index.md +0 -0
  89. {lamindb-1.9.1 → lamindb-1.10.0}/docs/lamindb.md +0 -0
  90. {lamindb-1.9.1 → lamindb-1.10.0}/docs/query-search.md +0 -0
  91. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/curate_anndata_flexible.py +0 -0
  92. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/curate_dataframe_flexible.py +0 -0
  93. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/curate_dataframe_minimal_errors.py +0 -0
  94. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/curate_mudata.py +0 -0
  95. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/curate_soma_experiment.py +0 -0
  96. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/curate_spatialdata.py +0 -0
  97. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/define_mini_immuno_features_labels.py +0 -0
  98. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/define_mini_immuno_schema_flexible.py +0 -0
  99. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/define_schema_anndata_ensembl_gene_ids_and_valid_features_in_obs.py +0 -0
  100. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/define_schema_spatialdata.py +0 -0
  101. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/define_valid_features.py +0 -0
  102. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/run_track_and_finish.py +0 -0
  103. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/run_track_with_params.py +0 -0
  104. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/run_workflow.py +0 -0
  105. /lamindb-1.9.1/docs/scripts/ingest_mini_immuno_datasets.py → /lamindb-1.10.0/docs/scripts/save_mini_immuno_datasets.py +0 -0
  106. {lamindb-1.9.1 → lamindb-1.10.0}/docs/scripts/synced_with_git.py +0 -0
  107. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/add-replace-cache.ipynb +0 -0
  108. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/anndata-accessor.ipynb +0 -0
  109. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/prepare-transfer-local-to-cloud.ipynb +0 -0
  110. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/test-files/iris.csv +0 -0
  111. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/test-files/iris.data +0 -0
  112. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/test-files/new_iris.csv +0 -0
  113. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/test_notebooks.py +0 -0
  114. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/transfer-local-to-cloud.ipynb +0 -0
  115. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage/upload.ipynb +0 -0
  116. {lamindb-1.9.1 → lamindb-1.10.0}/docs/storage.md +0 -0
  117. {lamindb-1.9.1 → lamindb-1.10.0}/docs/test_notebooks.py +0 -0
  118. {lamindb-1.9.1 → lamindb-1.10.0}/docs/track.ipynb +0 -0
  119. {lamindb-1.9.1 → lamindb-1.10.0}/docs/transfer.ipynb +0 -0
  120. {lamindb-1.9.1 → lamindb-1.10.0}/docs/wetlab.md +0 -0
  121. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/_finish.py +0 -0
  122. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/_tracked.py +0 -0
  123. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/_view.py +0 -0
  124. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/base/__init__.py +0 -0
  125. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/base/fields.py +0 -0
  126. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/base/ids.py +0 -0
  127. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/base/types.py +0 -0
  128. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/base/uids.py +0 -0
  129. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/base/users.py +0 -0
  130. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/_compat.py +0 -0
  131. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/_context.py +0 -0
  132. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/_mapped_collection.py +0 -0
  133. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/_settings.py +0 -0
  134. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/_sync_git.py +0 -0
  135. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/_track_environment.py +0 -0
  136. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/exceptions.py +0 -0
  137. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/loaders.py +0 -0
  138. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/_polars_lazy_df.py +0 -0
  139. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/_pyarrow_dataset.py +0 -0
  140. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/_tiledbsoma.py +0 -0
  141. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/_valid_suffixes.py +0 -0
  142. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/_zarr.py +0 -0
  143. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/objects.py +0 -0
  144. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/storage/paths.py +0 -0
  145. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/subsettings/__init__.py +0 -0
  146. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/subsettings/_annotation_settings.py +0 -0
  147. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/subsettings/_creation_settings.py +0 -0
  148. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/core/types.py +0 -0
  149. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/curators/__init__.py +0 -0
  150. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/curators/_legacy.py +0 -0
  151. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/curators/core.py +0 -0
  152. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/errors.py +0 -0
  153. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/examples/cellxgene/__init__.py +0 -0
  154. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/examples/cellxgene/cxg_schema_versions.csv +0 -0
  155. {lamindb-1.9.1/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/_core.py +0 -0
  156. {lamindb-1.9.1/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/_fake.py +0 -0
  157. {lamindb-1.9.1/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/_small.py +0 -0
  158. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/examples/fixtures/__init__.py +0 -0
  159. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/examples/fixtures/sheets.py +0 -0
  160. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/examples/schemas/__init__.py +0 -0
  161. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0069_squashed.py +0 -0
  162. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0070_lamindbv1_migrate_data.py +0 -0
  163. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0071_lamindbv1_migrate_schema.py +0 -0
  164. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0072_remove_user__branch_code_remove_user_aux_and_more.py +0 -0
  165. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0073_merge_ourprojects.py +0 -0
  166. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0074_lamindbv1_part4.py +0 -0
  167. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0075_lamindbv1_part5.py +0 -0
  168. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0076_lamindbv1_part6.py +0 -0
  169. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0077_lamindbv1_part6b.py +0 -0
  170. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0078_lamindbv1_part6c.py +0 -0
  171. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0079_alter_rundata_value_json_and_more.py +0 -0
  172. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0080_polish_lamindbv1.py +0 -0
  173. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0081_revert_textfield_collection.py +0 -0
  174. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0082_alter_feature_dtype.py +0 -0
  175. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0083_alter_feature_is_type_alter_flextable_is_type_and_more.py +0 -0
  176. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0084_alter_schemafeature_feature_and_more.py +0 -0
  177. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0085_alter_feature_is_type_alter_flextable_is_type_and_more.py +0 -0
  178. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0086_various.py +0 -0
  179. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0087_rename__schemas_m2m_artifact_feature_sets_and_more.py +0 -0
  180. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0088_schema_components.py +0 -0
  181. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0089_subsequent_runs.py +0 -0
  182. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0090_runproject_project_runs.py +0 -0
  183. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0091_alter_featurevalue_options_alter_space_options_and_more.py +0 -0
  184. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0092_alter_artifactfeaturevalue_artifact_and_more.py +0 -0
  185. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0093_alter_schemacomponent_unique_together.py +0 -0
  186. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0094_writeloglock_writelogmigrationstate_and_more.py +0 -0
  187. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0095_remove_rundata_flextable.py +0 -0
  188. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0096_remove_artifact__param_values_and_more.py +0 -0
  189. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0097_remove_schemaparam_param_remove_paramvalue_param_and_more.py +0 -0
  190. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0098_alter_feature_type_alter_project_type_and_more.py +0 -0
  191. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0099_alter_writelog_seqno.py +0 -0
  192. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0100_branch_alter_artifact__branch_code_and_more.py +0 -0
  193. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0101_alter_artifact_hash_alter_feature_name_and_more.py +0 -0
  194. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0102_remove_writelog_branch_code_and_more.py +0 -0
  195. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0103_remove_writelog_migration_state_and_more.py +0 -0
  196. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0104_alter_branch_uid.py +0 -0
  197. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0105_record_unique_name.py +0 -0
  198. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0106_transfer_data_migration.py +0 -0
  199. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0107_add_schema_to_record.py +0 -0
  200. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0108_remove_record_sheet_remove_sheetproject_sheet_and_more.py +0 -0
  201. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0109_record_input_of_runs_alter_record_run_and_more.py +0 -0
  202. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0110_rename_values_artifacts_record_linked_artifacts.py +0 -0
  203. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0111_remove_record__sort_order.py +0 -0
  204. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0112_alter_recordartifact_feature_and_more.py +0 -0
  205. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0113_lower_case_branch_and_space_names.py +0 -0
  206. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0114_alter_run__status_code.py +0 -0
  207. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/0115_alter_space_uid.py +0 -0
  208. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/migrations/__init__.py +0 -0
  209. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/__init__.py +0 -0
  210. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/_from_values.py +0 -0
  211. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/_is_versioned.py +0 -0
  212. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/_label_manager.py +0 -0
  213. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/_relations.py +0 -0
  214. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/artifact_set.py +0 -0
  215. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/can_curate.py +0 -0
  216. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/feature.py +0 -0
  217. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/has_parents.py +0 -0
  218. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/query_manager.py +0 -0
  219. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/query_set.py +0 -0
  220. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/save.py +0 -0
  221. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/schema.py +0 -0
  222. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/storage.py +0 -0
  223. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/transform.py +0 -0
  224. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/models/ulabel.py +0 -0
  225. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/py.typed +0 -0
  226. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/setup/__init__.py +0 -0
  227. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/setup/_switch.py +0 -0
  228. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/setup/core/__init__.py +0 -0
  229. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/setup/errors/__init__.py +0 -0
  230. {lamindb-1.9.1 → lamindb-1.10.0}/lamindb/setup/types/__init__.py +0 -0
  231. {lamindb-1.9.1 → lamindb-1.10.0}/tests/conftest.py +0 -0
  232. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/conftest.py +0 -0
  233. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/notebooks/basic-r-notebook.Rmd.cleaned.html +0 -0
  234. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/notebooks/basic-r-notebook.Rmd.html +0 -0
  235. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/notebooks/duplicate/with-title-initialized-consecutive-finish.ipynb +0 -0
  236. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/notebooks/no-title.ipynb +0 -0
  237. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/notebooks/with-title-initialized-consecutive-finish-not-last-cell.ipynb +0 -0
  238. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/notebooks/with-title-initialized-consecutive-finish.ipynb +0 -0
  239. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/scripts/duplicate1/script-to-test-versioning.py +0 -0
  240. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/scripts/duplicate2/script-to-test-versioning.py +0 -0
  241. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/scripts/duplicate3/script-to-test-versioning.py +0 -0
  242. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/scripts/duplicate4/script-to-test-versioning.py +0 -0
  243. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/scripts/duplicate5/script-to-test-versioning.py +0 -0
  244. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/scripts/script-to-test-filename-change.py +0 -0
  245. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/scripts/script-to-test-versioning.py +0 -0
  246. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_artifact_folders.py +0 -0
  247. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_can_curate.py +0 -0
  248. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_data.py +0 -0
  249. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_db.py +0 -0
  250. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_delete.py +0 -0
  251. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_dtype.py +0 -0
  252. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_from_values.py +0 -0
  253. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_has_parents.py +0 -0
  254. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_integrity.py +0 -0
  255. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_load.py +0 -0
  256. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_manager.py +0 -0
  257. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_models.py +0 -0
  258. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_notebooks.py +0 -0
  259. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_queryset.py +0 -0
  260. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_record.py +0 -0
  261. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_run.py +0 -0
  262. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_schema.py +0 -0
  263. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_search.py +0 -0
  264. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_settings.py +0 -0
  265. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_storage.py +0 -0
  266. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_track.py +0 -0
  267. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_transform.py +0 -0
  268. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_ulabel.py +0 -0
  269. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_versioning.py +0 -0
  270. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_view.py +0 -0
  271. {lamindb-1.9.1 → lamindb-1.10.0}/tests/core/test_visibility.py +0 -0
  272. {lamindb-1.9.1 → lamindb-1.10.0}/tests/curators/test_cat_managers.py +0 -0
  273. {lamindb-1.9.1 → lamindb-1.10.0}/tests/curators/test_curators_examples.py +0 -0
  274. {lamindb-1.9.1 → lamindb-1.10.0}/tests/curators/test_curators_multivalue.py +0 -0
  275. {lamindb-1.9.1 → lamindb-1.10.0}/tests/curators/test_cxg_curator.py +0 -0
  276. {lamindb-1.9.1 → lamindb-1.10.0}/tests/curators/test_dataframe_curators_accounting_example.py +0 -0
  277. {lamindb-1.9.1 → lamindb-1.10.0}/tests/curators/test_records.py +0 -0
  278. {lamindb-1.9.1 → lamindb-1.10.0}/tests/permissions/conftest.py +0 -0
  279. {lamindb-1.9.1 → lamindb-1.10.0}/tests/permissions/jwt_utils.py +0 -0
  280. {lamindb-1.9.1 → lamindb-1.10.0}/tests/permissions/scripts/check_lamin_dev.py +0 -0
  281. {lamindb-1.9.1 → lamindb-1.10.0}/tests/permissions/scripts/clean_lamin_dev.py +0 -0
  282. {lamindb-1.9.1 → lamindb-1.10.0}/tests/permissions/scripts/setup_instance.py +0 -0
  283. {lamindb-1.9.1 → lamindb-1.10.0}/tests/permissions/test_permissions.py +0 -0
  284. {lamindb-1.9.1 → lamindb-1.10.0}/tests/storage/conftest.py +0 -0
  285. {lamindb-1.9.1 → lamindb-1.10.0}/tests/storage/test_artifact_storage.py +0 -0
  286. {lamindb-1.9.1 → lamindb-1.10.0}/tests/storage/test_artifact_zarr.py +0 -0
  287. {lamindb-1.9.1 → lamindb-1.10.0}/tests/storage/test_cache.py +0 -0
  288. {lamindb-1.9.1 → lamindb-1.10.0}/tests/storage/test_storage_lifecycle.py +0 -0
  289. {lamindb-1.9.1 → lamindb-1.10.0}/tests/storage/test_transfer.py +0 -0
@@ -66,6 +66,7 @@ run-tests
66
66
  test-django-validation/
67
67
  curate.tiledbsoma
68
68
  small_dataset.tiledbsoma
69
+ registered_storage
69
70
 
70
71
  # General
71
72
  .DS_Store
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lamindb
3
- Version: 1.9.1
3
+ Version: 1.10.0
4
4
  Summary: A data framework for biology.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Requires-Python: >=3.10,<3.14
@@ -10,8 +10,8 @@ Classifier: Programming Language :: Python :: 3.11
10
10
  Classifier: Programming Language :: Python :: 3.12
11
11
  Classifier: Programming Language :: Python :: 3.13
12
12
  Requires-Dist: lamin_utils==0.15.0
13
- Requires-Dist: lamin_cli==1.6.0
14
- Requires-Dist: lamindb_setup[aws]==1.8.3
13
+ Requires-Dist: lamin_cli==1.6.1
14
+ Requires-Dist: lamindb_setup[aws]==1.9.0
15
15
  Requires-Dist: pyyaml
16
16
  Requires-Dist: pyarrow
17
17
  Requires-Dist: pandera>=0.24.0
@@ -307,6 +307,112 @@
307
307
  "adata_subset.to_memory()"
308
308
  ]
309
309
  },
310
+ {
311
+ "cell_type": "markdown",
312
+ "metadata": {},
313
+ "source": [
314
+ "## SpatialData"
315
+ ]
316
+ },
317
+ {
318
+ "cell_type": "markdown",
319
+ "metadata": {},
320
+ "source": [
321
+ "It is also possible to access `AnnData` objects inside `SpatialData` `tables`:"
322
+ ]
323
+ },
324
+ {
325
+ "cell_type": "code",
326
+ "execution_count": null,
327
+ "metadata": {},
328
+ "outputs": [],
329
+ "source": [
330
+ "artifact = ln.Artifact.using(\"laminlabs/lamindata\").get(\n",
331
+ " key=\"visium_aligned_guide_min.zarr\"\n",
332
+ ")\n",
333
+ "\n",
334
+ "access = artifact.open()"
335
+ ]
336
+ },
337
+ {
338
+ "cell_type": "code",
339
+ "execution_count": null,
340
+ "metadata": {
341
+ "tags": [
342
+ "hide-output"
343
+ ]
344
+ },
345
+ "outputs": [],
346
+ "source": [
347
+ "access"
348
+ ]
349
+ },
350
+ {
351
+ "cell_type": "code",
352
+ "execution_count": null,
353
+ "metadata": {
354
+ "tags": [
355
+ "hide-output"
356
+ ]
357
+ },
358
+ "outputs": [],
359
+ "source": [
360
+ "access.tables"
361
+ ]
362
+ },
363
+ {
364
+ "cell_type": "markdown",
365
+ "metadata": {},
366
+ "source": [
367
+ "This gives you the same `AnnDataAccessor` object as for a normal `AnnData`."
368
+ ]
369
+ },
370
+ {
371
+ "cell_type": "code",
372
+ "execution_count": null,
373
+ "metadata": {
374
+ "tags": [
375
+ "hide-output"
376
+ ]
377
+ },
378
+ "outputs": [],
379
+ "source": [
380
+ "table = access.tables[\"table\"]\n",
381
+ "\n",
382
+ "table"
383
+ ]
384
+ },
385
+ {
386
+ "cell_type": "markdown",
387
+ "metadata": {},
388
+ "source": [
389
+ "You can subset it and read into memory as an actual `AnnData`:"
390
+ ]
391
+ },
392
+ {
393
+ "cell_type": "code",
394
+ "execution_count": null,
395
+ "metadata": {
396
+ "tags": [
397
+ "hide-output"
398
+ ]
399
+ },
400
+ "outputs": [],
401
+ "source": [
402
+ "table_subset = table[table.obs[\"clone\"] == \"diploid\"]\n",
403
+ "\n",
404
+ "table_subset"
405
+ ]
406
+ },
407
+ {
408
+ "cell_type": "markdown",
409
+ "metadata": {},
410
+ "source": [
411
+ "```python\n",
412
+ "adata = table_subset.to_memory()\n",
413
+ "```"
414
+ ]
415
+ },
310
416
  {
311
417
  "cell_type": "markdown",
312
418
  "metadata": {},
@@ -45,7 +45,7 @@
45
45
  "id": "4",
46
46
  "metadata": {},
47
47
  "source": [
48
- "Let's start by creating a few exemplary datasets and saving them into a LaminDB instance using, e.g., {func}`~lamindb.examples.ingest_mini_immuno_datasets`."
48
+ "Let's start by creating a few exemplary datasets and saving them into a LaminDB instance using, e.g., {func}`~lamindb.examples.datasets.mini_immuno.save_mini_immuno_datasets`."
49
49
  ]
50
50
  },
51
51
  {
@@ -66,7 +66,7 @@
66
66
  "ln.Artifact(ln.core.datasets.file_jpg_paradisi05(), key=\"images/my_image.jpg\").save()\n",
67
67
  "ln.Artifact(ln.core.datasets.file_fastq(), key=\"raw/my_fastq.fastq.gz\").save()\n",
68
68
  "ln.Artifact.from_df(ln.core.datasets.df_iris(), key=\"iris.parquet\").save()\n",
69
- "ln.examples.ingest_mini_immuno_datasets()"
69
+ "ln.examples.datasets.mini_immuno.save_mini_immuno_datasets()"
70
70
  ]
71
71
  },
72
72
  {
@@ -109,6 +109,7 @@
109
109
  "assert dataset_artifact._actions.get() == vitessce_config_artifact\n",
110
110
  "assert vitessce_config_artifact._action_targets.get() == dataset_artifact\n",
111
111
  "assert vitessce_config_artifact._actions.first() is None\n",
112
+ "assert vitessce_config_artifact.kind == \"__lamindb_config__\"\n",
112
113
  "assert ln.Artifact.get(_actions=vitessce_config_artifact) == dataset_artifact"
113
114
  ]
114
115
  },
@@ -163,7 +164,7 @@
163
164
  ],
164
165
  "metadata": {
165
166
  "kernelspec": {
166
- "display_name": "py310",
167
+ "display_name": "py312",
167
168
  "language": "python",
168
169
  "name": "python3"
169
170
  },
@@ -177,7 +178,7 @@
177
178
  "name": "python",
178
179
  "nbconvert_exporter": "python",
179
180
  "pygments_lexer": "ipython3",
180
- "version": "3.10.13"
181
+ "version": "3.12.8"
181
182
  }
182
183
  },
183
184
  "nbformat": 4,
@@ -108,7 +108,7 @@ Backwards compatibility.
108
108
 
109
109
  # ruff: noqa: I001
110
110
  # denote a release candidate for 0.1.0 with 0.1rc1, 0.1a1, 0.1b1, etc.
111
- __version__ = "1.9.1"
111
+ __version__ = "1.10.0"
112
112
 
113
113
  import warnings
114
114
 
@@ -28,7 +28,6 @@ Modules:
28
28
  .. autosummary::
29
29
  :toctree: .
30
30
 
31
- datasets
32
31
  storage
33
32
  logger
34
33
 
@@ -38,7 +37,8 @@ from lamin_utils import logger
38
37
  from lamin_utils._inspect import InspectResult
39
38
 
40
39
  from .. import errors as exceptions
41
- from . import datasets, loaders, subsettings, types
40
+ from ..examples import datasets # backward compat
41
+ from . import loaders, subsettings, types
42
42
  from ._context import Context
43
43
  from ._mapped_collection import MappedCollection
44
44
  from ._settings import Settings
@@ -13,12 +13,13 @@ Array accessors.
13
13
  :toctree: .
14
14
 
15
15
  AnnDataAccessor
16
+ SpatialDataAccessor
16
17
  BackedAccessor
17
18
  """
18
19
 
19
20
  from lamindb_setup.core.upath import LocalPathClasses, UPath, infer_filesystem
20
21
 
21
- from ._backed_access import AnnDataAccessor, BackedAccessor
22
+ from ._backed_access import AnnDataAccessor, BackedAccessor, SpatialDataAccessor
22
23
  from ._tiledbsoma import save_tiledbsoma_experiment
23
24
  from ._valid_suffixes import VALID_SUFFIXES
24
25
  from .objects import infer_suffix, write_to_disk
@@ -353,7 +353,16 @@ if ZARR_INSTALLED:
353
353
  attrs_keys: dict[str, list] = {}
354
354
  obs_var_arrays = []
355
355
 
356
- for path in paths:
356
+ prefix = storage.path
357
+ if prefix == "":
358
+ paths_iter = (path for path in paths)
359
+ else:
360
+ prefix += "/"
361
+ paths_iter = (
362
+ path.removeprefix(prefix) for path in paths if path.startswith(prefix)
363
+ )
364
+
365
+ for path in paths_iter:
357
366
  if path in (".zattrs", ".zgroup"):
358
367
  continue
359
368
  parts = path.split("/")
@@ -9,6 +9,7 @@ from anndata._io.specs.registry import get_spec
9
9
  from ._anndata_accessor import AnnDataAccessor, StorageType, registry
10
10
  from ._polars_lazy_df import POLARS_SUFFIXES, _open_polars_lazy_df
11
11
  from ._pyarrow_dataset import PYARROW_SUFFIXES, _open_pyarrow_dataset
12
+ from ._spatialdata_accessor import SpatialDataAccessor
12
13
  from ._tiledbsoma import _open_tiledbsoma
13
14
  from .paths import filepath_from_artifact
14
15
 
@@ -80,6 +81,7 @@ def backed_access(
80
81
  **kwargs,
81
82
  ) -> (
82
83
  AnnDataAccessor
84
+ | SpatialDataAccessor
83
85
  | BackedAccessor
84
86
  | SOMACollection
85
87
  | SOMAExperiment
@@ -110,6 +112,8 @@ def backed_access(
110
112
  conn, storage = registry.open("h5py", objectpath, mode=mode, **kwargs)
111
113
  elif suffix == ".zarr":
112
114
  conn, storage = registry.open("zarr", objectpath, mode=mode, **kwargs)
115
+ if "spatialdata_attrs" in storage.attrs:
116
+ return SpatialDataAccessor(storage, name)
113
117
  elif len(df_suffixes := _flat_suffixes(objectpath)) == 1 and (
114
118
  df_suffix := df_suffixes.pop()
115
119
  ) in set(PYARROW_SUFFIXES).union(POLARS_SUFFIXES):
@@ -0,0 +1,52 @@
1
+ from __future__ import annotations
2
+
3
+ from functools import cached_property
4
+ from typing import TYPE_CHECKING
5
+
6
+ from ._anndata_accessor import AnnDataAccessor
7
+
8
+ if TYPE_CHECKING:
9
+ from zarr import Group
10
+
11
+
12
+ class _TablesAccessor:
13
+ def __init__(self, tables: Group):
14
+ self._tables = tables
15
+
16
+ def __getitem__(self, key: str) -> AnnDataAccessor:
17
+ return AnnDataAccessor(connection=None, storage=self._tables[key], filename=key)
18
+
19
+ def keys(self) -> list[str]:
20
+ return list(self._tables.keys())
21
+
22
+ def __repr__(self) -> str:
23
+ """Description of the _TablesAccessor object."""
24
+ descr = (
25
+ f"Accessor for the SpatialData attribute tables\n with keys: {self.keys()}"
26
+ )
27
+ return descr
28
+
29
+
30
+ class SpatialDataAccessor:
31
+ """Cloud-backed SpatialData.
32
+
33
+ For now only allows to access `tables`.
34
+ """
35
+
36
+ def __init__(self, storage: Group, name: str):
37
+ self.storage = storage
38
+ self._name = name
39
+
40
+ @cached_property
41
+ def tables(self) -> _TablesAccessor:
42
+ """tables of the underlying SpatialData object."""
43
+ return _TablesAccessor(self.storage["tables"])
44
+
45
+ def __repr__(self):
46
+ """Description of the SpatialDataAccessor object."""
47
+ descr = (
48
+ "SpatialDataAccessor object"
49
+ f"\n constructed for the SpatialData object {self._name}"
50
+ f"\n with tables: {self.tables.keys()}"
51
+ )
52
+ return descr
@@ -0,0 +1,14 @@
1
+ """Examples.
2
+
3
+ .. autosummary::
4
+ :toctree: .
5
+
6
+ schemas
7
+ datasets
8
+ cellxgene
9
+ croissant
10
+
11
+ """
12
+
13
+ from . import croissant, datasets, schemas
14
+ from .cellxgene import _cellxgene
@@ -1,12 +1,16 @@
1
- from typing import Collection, Literal, NamedTuple
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Collection, Literal, NamedTuple
2
4
 
3
5
  import pandas as pd
4
6
  from lamindb_setup.core.upath import UPath
5
7
 
6
- from lamindb.base.types import FieldAttr
7
- from lamindb.models import Feature, Schema, SQLRecord, ULabel
8
8
  from lamindb.models._from_values import _format_values
9
9
 
10
+ if TYPE_CHECKING:
11
+ from lamindb.base.types import FieldAttr
12
+ from lamindb.models import Schema, SQLRecord
13
+
10
14
  CELLxGENESchemaVersions = Literal["4.0.0", "5.0.0", "5.1.0", "5.2.0", "5.3.0"]
11
15
  FieldType = Literal["ontology_id", "name"]
12
16
 
@@ -25,6 +29,8 @@ def save_cxg_defaults() -> None:
25
29
  """
26
30
  import bionty as bt
27
31
 
32
+ from lamindb.models import ULabel
33
+
28
34
  # "normal" in Disease
29
35
  normal = bt.Phenotype.from_source(
30
36
  ontology_id="PATO:0000461",
@@ -135,6 +141,8 @@ def get_cxg_schema(
135
141
  """
136
142
  import bionty as bt
137
143
 
144
+ from lamindb.models import Feature, Schema, ULabel
145
+
138
146
  class CategorySpec(NamedTuple):
139
147
  field: str | FieldAttr
140
148
  default: str | None
@@ -0,0 +1,44 @@
1
+ """Example Croissant files.
2
+
3
+ Examples for MLCommons Croissant files, which are used to store metadata about datasets.
4
+ """
5
+
6
+ import json
7
+ from pathlib import Path
8
+
9
+
10
+ def mini_immuno(n_files: int = 1) -> list[Path]:
11
+ """Return paths to the mini immuno dataset and its metadata as a Croissant file.
12
+
13
+ Args:
14
+ n_files: Number of files inside the croissant file. Default is 1.
15
+ """
16
+ from ..datasets import file_mini_csv
17
+ from ..datasets.mini_immuno import get_dataset1
18
+
19
+ adata = get_dataset1(otype="AnnData")
20
+ dataset1_path = Path("mini_immuno.anndata.zarr")
21
+ adata.write_zarr(dataset1_path)
22
+ orig_croissant_path = (
23
+ Path(__file__).parent / "mini_immuno.anndata.zarr_metadata.json"
24
+ )
25
+ with open(orig_croissant_path, encoding="utf-8") as f:
26
+ data = json.load(f)
27
+ if n_files == 2:
28
+ dataset2_path = file_mini_csv()
29
+ data["distribution"].append(
30
+ {
31
+ "@type": "sc:FileObject",
32
+ "@id": "mini.csv",
33
+ "name": "mini.csv",
34
+ "encodingFormat": "text/csv",
35
+ }
36
+ )
37
+ croissant_path = Path("mini_immuno.anndata.zarr_metadata.json")
38
+ with open(croissant_path, "w", encoding="utf-8") as f:
39
+ json.dump(data, f, indent=2)
40
+ result: list[Path] = [croissant_path, dataset1_path]
41
+ if n_files == 1:
42
+ return result
43
+ result.append(dataset2_path)
44
+ return result
@@ -0,0 +1,73 @@
1
+ {
2
+ "@context": {
3
+ "@vocab": "https://schema.org/",
4
+ "cr": "https://mlcommons.org/croissant/",
5
+ "ml": "http://ml-schema.org/",
6
+ "sc": "https://schema.org/",
7
+ "dct": "http://purl.org/dc/terms/",
8
+ "data": "https://mlcommons.org/croissant/data/",
9
+ "rai": "https://mlcommons.org/croissant/rai/",
10
+ "format": "https://mlcommons.org/croissant/format/",
11
+ "citeAs": "https://mlcommons.org/croissant/citeAs/",
12
+ "conformsTo": "https://mlcommons.org/croissant/conformsTo/",
13
+ "@language": "en",
14
+ "repeated": "https://mlcommons.org/croissant/repeated/",
15
+ "field": "https://mlcommons.org/croissant/field/",
16
+ "examples": "https://mlcommons.org/croissant/examples/",
17
+ "recordSet": "https://mlcommons.org/croissant/recordSet/",
18
+ "fileObject": "https://mlcommons.org/croissant/fileObject/",
19
+ "fileSet": "https://mlcommons.org/croissant/fileSet/",
20
+ "source": "https://mlcommons.org/croissant/source/",
21
+ "references": "https://mlcommons.org/croissant/references/",
22
+ "key": "https://mlcommons.org/croissant/key/",
23
+ "parentField": "https://mlcommons.org/croissant/parentField/",
24
+ "isLiveDataset": "https://mlcommons.org/croissant/isLiveDataset/",
25
+ "separator": "https://mlcommons.org/croissant/separator/",
26
+ "extract": "https://mlcommons.org/croissant/extract/",
27
+ "subField": "https://mlcommons.org/croissant/subField/",
28
+ "regex": "https://mlcommons.org/croissant/regex/",
29
+ "column": "https://mlcommons.org/croissant/column/",
30
+ "path": "https://mlcommons.org/croissant/path/",
31
+ "fileProperty": "https://mlcommons.org/croissant/fileProperty/",
32
+ "md5": "https://mlcommons.org/croissant/md5/",
33
+ "jsonPath": "https://mlcommons.org/croissant/jsonPath/",
34
+ "transform": "https://mlcommons.org/croissant/transform/",
35
+ "replace": "https://mlcommons.org/croissant/replace/",
36
+ "dataType": "https://mlcommons.org/croissant/dataType/",
37
+ "includes": "https://mlcommons.org/croissant/includes/",
38
+ "excludes": "https://mlcommons.org/croissant/excludes/"
39
+ },
40
+ "@type": "Dataset",
41
+ "name": "Mini immuno dataset",
42
+ "description": "A few samples from the immunology dataset",
43
+ "url": "https://lamin.ai/laminlabs/lamindata/artifact/tCUkRcaEjTjhtozp0000",
44
+ "creator": {
45
+ "@type": "Person",
46
+ "name": "falexwolf"
47
+ },
48
+ "dateCreated": "2025-07-16",
49
+ "cr:projectName": "Mini Immuno Project",
50
+ "datePublished": "2025-07-16",
51
+ "version": "1.0",
52
+ "license": "https://creativecommons.org/licenses/by/4.0/",
53
+ "citation": "Please cite this dataset as: mini immuno (2025)",
54
+ "encodingFormat": "zarr",
55
+ "distribution": [
56
+ {
57
+ "@type": "cr:FileSet",
58
+ "@id": "mini_immuno.anndata.zarr",
59
+ "containedIn": {
60
+ "@id": "directory"
61
+ },
62
+ "encodingFormat": "zarr"
63
+ }
64
+ ],
65
+ "cr:recordSet": [
66
+ {
67
+ "@type": "cr:RecordSet",
68
+ "@id": "#samples",
69
+ "name": "samples",
70
+ "description": "my sample"
71
+ }
72
+ ]
73
+ }
@@ -1,4 +1,4 @@
1
- """Test datasets.
1
+ """Example datasets.
2
2
 
3
3
  The mini immuno dataset.
4
4
 
@@ -1,16 +1,20 @@
1
- """The mini immuno dataset.
1
+ """The two "mini immuno" datasets.
2
2
 
3
3
  .. autosummary::
4
4
  :toctree: .
5
5
 
6
- define_features_labels
7
6
  get_dataset1
8
7
  get_dataset2
8
+ define_features_labels
9
+ define_mini_immuno_schema_flexible
10
+ save_mini_immuno_datasets
9
11
 
10
12
  """
11
13
 
12
14
  from __future__ import annotations
13
15
 
16
+ import sys
17
+ from pathlib import Path
14
18
  from typing import TYPE_CHECKING, Literal
15
19
 
16
20
  import anndata as ad
@@ -26,9 +30,6 @@ def define_features_labels() -> None:
26
30
  .. literalinclude:: scripts/define_mini_immuno_features_labels.py
27
31
  :language: python
28
32
  """
29
- import sys
30
- from pathlib import Path
31
-
32
33
  docs_path = Path(__file__).parent.parent.parent.parent / "docs" / "scripts"
33
34
  if str(docs_path) not in sys.path:
34
35
  sys.path.append(str(docs_path))
@@ -42,9 +43,6 @@ def define_mini_immuno_schema_flexible() -> Schema:
42
43
  .. literalinclude:: scripts/define_mini_immuno_schema_flexible.py
43
44
  :language: python
44
45
  """
45
- import sys
46
- from pathlib import Path
47
-
48
46
  from lamindb.models import Schema
49
47
 
50
48
  docs_path = Path(__file__).parent.parent.parent.parent / "docs" / "scripts"
@@ -57,6 +55,19 @@ def define_mini_immuno_schema_flexible() -> Schema:
57
55
  return Schema.get(name="Mini immuno schema")
58
56
 
59
57
 
58
+ def save_mini_immuno_datasets():
59
+ """Save the two "mini immuno" datasets.
60
+
61
+ .. literalinclude:: scripts/save_mini_immuno_datasets.py
62
+ :language: python
63
+ """
64
+ docs_path = Path(__file__).parent.parent.parent.parent / "docs" / "scripts"
65
+ if str(docs_path) not in sys.path:
66
+ sys.path.append(str(docs_path))
67
+
68
+ import save_mini_immuno_datasets # noqa
69
+
70
+
60
71
  def get_dataset1(
61
72
  otype: Literal["DataFrame", "AnnData"] = "DataFrame",
62
73
  gene_symbols_in_index: bool = False,
@@ -0,0 +1,35 @@
1
+ from __future__ import annotations
2
+
3
+ import importlib
4
+ import sys
5
+ from pathlib import Path
6
+ from typing import TYPE_CHECKING
7
+
8
+ if TYPE_CHECKING:
9
+ from ... import Schema
10
+
11
+
12
+ def anndata_ensembl_gene_ids_and_valid_features_in_obs() -> Schema:
13
+ """Return a schema for an AnnData with Ensembl gene IDs and valid features in obs.
14
+
15
+ .. literalinclude:: scripts/define_schema_anndata_ensembl_gene_ids_and_valid_features_in_obs.py
16
+ :language: python
17
+ """
18
+ from ... import Schema
19
+
20
+ docs_path = Path(__file__).parent.parent.parent.parent / "docs" / "scripts"
21
+ if str(docs_path) not in sys.path:
22
+ sys.path.append(str(docs_path))
23
+
24
+ try:
25
+ return Schema.get(name="anndata_ensembl_gene_ids_and_valid_features_in_obs")
26
+ except Schema.DoesNotExist:
27
+ import define_schema_anndata_ensembl_gene_ids_and_valid_features_in_obs # noqa
28
+
29
+ try:
30
+ return Schema.get(name="anndata_ensembl_gene_ids_and_valid_features_in_obs")
31
+ except Schema.DoesNotExist:
32
+ importlib.reload(
33
+ define_schema_anndata_ensembl_gene_ids_and_valid_features_in_obs
34
+ )
35
+ return Schema.get(name="anndata_ensembl_gene_ids_and_valid_features_in_obs")
@@ -0,0 +1,33 @@
1
+ from __future__ import annotations
2
+
3
+ import importlib
4
+ import sys
5
+ from pathlib import Path
6
+ from typing import TYPE_CHECKING
7
+
8
+ if TYPE_CHECKING:
9
+ from ... import Schema
10
+
11
+
12
+ def valid_features() -> Schema:
13
+ """Return a schema for an AnnData with Ensembl gene IDs and valid features in obs.
14
+
15
+ .. literalinclude:: scripts/define_valid_features.py
16
+ :language: python
17
+ """
18
+ from ... import Schema
19
+
20
+ docs_path = Path(__file__).parent.parent.parent.parent / "docs" / "scripts"
21
+ if str(docs_path) not in sys.path:
22
+ sys.path.append(str(docs_path))
23
+
24
+ try:
25
+ return Schema.get(name="valid_features")
26
+ except Schema.DoesNotExist:
27
+ try:
28
+ import define_valid_features # noqa
29
+
30
+ return Schema.get(name="valid_features")
31
+ except Schema.DoesNotExist:
32
+ importlib.reload(define_valid_features)
33
+ return Schema.get(name="valid_features")
@@ -5,8 +5,10 @@
5
5
 
6
6
  save_vitessce_config
7
7
  save_tiledbsoma_experiment
8
+ curate_from_croissant
8
9
  """
9
10
 
10
11
  from lamindb.core.storage import save_tiledbsoma_experiment
11
12
 
13
+ from ._croissant import curate_from_croissant
12
14
  from ._vitessce import save_vitessce_config