lamindb 1.9.0__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.
- {lamindb-1.9.0 → lamindb-1.10.0}/.gitignore +1 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/PKG-INFO +3 -3
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/arrays.ipynb +106 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/keep-artifacts-local.ipynb +53 -8
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/registries.ipynb +2 -2
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/vitessce.ipynb +3 -2
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/__init__.py +1 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/__init__.py +2 -2
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/__init__.py +2 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/_anndata_accessor.py +10 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/_backed_access.py +4 -0
- lamindb-1.10.0/lamindb/core/storage/_spatialdata_accessor.py +52 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/curators/core.py +6 -0
- lamindb-1.10.0/lamindb/examples/__init__.py +14 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/examples/cellxgene/_cellxgene.py +11 -3
- lamindb-1.10.0/lamindb/examples/croissant/__init__.py +44 -0
- lamindb-1.10.0/lamindb/examples/croissant/mini_immuno.anndata.zarr_metadata.json +73 -0
- {lamindb-1.9.0/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/__init__.py +1 -1
- {lamindb-1.9.0/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/mini_immuno.py +19 -8
- lamindb-1.10.0/lamindb/examples/schemas/_anndata.py +35 -0
- lamindb-1.10.0/lamindb/examples/schemas/_simple.py +33 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/integrations/__init__.py +2 -0
- lamindb-1.10.0/lamindb/integrations/_croissant.py +122 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/integrations/_vitessce.py +14 -12
- lamindb-1.10.0/lamindb/migrations/0116_remove_artifact_unique_artifact_storage_key_hash_and_more.py +51 -0
- lamindb-1.10.0/lamindb/migrations/0117_fix_artifact_storage_hash_unique_constraints.py +32 -0
- lamindb-1.9.0/lamindb/migrations/0115_squashed.py → lamindb-1.10.0/lamindb/migrations/0117_squashed.py +29 -6
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/_describe.py +107 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/_django.py +63 -6
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/_feature_manager.py +0 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/artifact.py +45 -12
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/collection.py +4 -9
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/project.py +2 -2
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/record.py +1 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/run.py +1 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/sqlrecord.py +3 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/transform.py +7 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/noxfile.py +1 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/pyproject.toml +2 -2
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/_dataset_fixtures.py +14 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_artifact.py +14 -6
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_collection.py +16 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_describe_and_df_calls.py +4 -4
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_feature.py +11 -2
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_feature_label_manager.py +8 -4
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_save.py +11 -9
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_tracked.py +8 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/curators/conftest.py +4 -0
- lamindb-1.10.0/tests/curators/test_curate_from_croissant.py +43 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/curators/test_curators_general.py +59 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/permissions/scripts/setup_access.py +1 -1
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/storage/test_streaming.py +3 -2
- lamindb-1.9.0/lamindb/examples/__init__.py +0 -29
- lamindb-1.9.0/lamindb/examples/schemas/_anndata.py +0 -25
- lamindb-1.9.0/lamindb/examples/schemas/_simple.py +0 -19
- {lamindb-1.9.0 → lamindb-1.10.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/.github/ISSUE_TEMPLATE/usage_question.yml +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/.github/workflows/build.yml +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/.github/workflows/doc-changes.yml +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/.gitmodules +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/.pre-commit-config.yaml +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/CONTRIBUTING.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/LICENSE +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/README.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/api.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/bio-registries.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/bionty.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/changelog.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/clinicore.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/curate.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/acid.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/curate-any.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/delete.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/idempotency.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/import-modules.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/pydantic-pandera.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/reference-field.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/search.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/setup.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/symbol-mapping.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/test_notebooks.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/track-run-inputs.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/validate-fields.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq/visibility.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/faq.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/guide.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/includes/installation.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/index.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/lamindb.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/query-search.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/curate_anndata_flexible.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/curate_dataframe_flexible.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/curate_dataframe_minimal_errors.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/curate_mudata.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/curate_soma_experiment.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/curate_spatialdata.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/define_mini_immuno_features_labels.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/define_mini_immuno_schema_flexible.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/define_schema_anndata_ensembl_gene_ids_and_valid_features_in_obs.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/define_schema_spatialdata.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/define_valid_features.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/run_track_and_finish.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/run_track_with_params.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/run_workflow.py +0 -0
- /lamindb-1.9.0/docs/scripts/ingest_mini_immuno_datasets.py → /lamindb-1.10.0/docs/scripts/save_mini_immuno_datasets.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/scripts/synced_with_git.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/add-replace-cache.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/anndata-accessor.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/prepare-transfer-local-to-cloud.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/test-files/iris.csv +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/test-files/iris.data +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/test-files/new_iris.csv +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/test_notebooks.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/transfer-local-to-cloud.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage/upload.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/storage.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/test_notebooks.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/track.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/transfer.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/docs/wetlab.md +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/_finish.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/_tracked.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/_view.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/base/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/base/fields.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/base/ids.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/base/types.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/base/uids.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/base/users.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/_compat.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/_context.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/_mapped_collection.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/_settings.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/_sync_git.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/_track_environment.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/exceptions.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/loaders.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/_polars_lazy_df.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/_pyarrow_dataset.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/_tiledbsoma.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/_valid_suffixes.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/_zarr.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/objects.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/storage/paths.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/subsettings/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/subsettings/_annotation_settings.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/subsettings/_creation_settings.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/core/types.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/curators/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/curators/_legacy.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/errors.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/examples/cellxgene/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/examples/cellxgene/cxg_schema_versions.csv +0 -0
- {lamindb-1.9.0/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/_core.py +0 -0
- {lamindb-1.9.0/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/_fake.py +0 -0
- {lamindb-1.9.0/lamindb/core → lamindb-1.10.0/lamindb/examples}/datasets/_small.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/examples/fixtures/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/examples/fixtures/sheets.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/examples/schemas/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0069_squashed.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0070_lamindbv1_migrate_data.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0071_lamindbv1_migrate_schema.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0072_remove_user__branch_code_remove_user_aux_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0073_merge_ourprojects.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0074_lamindbv1_part4.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0075_lamindbv1_part5.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0076_lamindbv1_part6.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0077_lamindbv1_part6b.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0078_lamindbv1_part6c.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0079_alter_rundata_value_json_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0080_polish_lamindbv1.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0081_revert_textfield_collection.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0082_alter_feature_dtype.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0083_alter_feature_is_type_alter_flextable_is_type_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0084_alter_schemafeature_feature_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0085_alter_feature_is_type_alter_flextable_is_type_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0086_various.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0087_rename__schemas_m2m_artifact_feature_sets_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0088_schema_components.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0089_subsequent_runs.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0090_runproject_project_runs.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0091_alter_featurevalue_options_alter_space_options_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0092_alter_artifactfeaturevalue_artifact_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0093_alter_schemacomponent_unique_together.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0094_writeloglock_writelogmigrationstate_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0095_remove_rundata_flextable.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0096_remove_artifact__param_values_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0097_remove_schemaparam_param_remove_paramvalue_param_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0098_alter_feature_type_alter_project_type_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0099_alter_writelog_seqno.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0100_branch_alter_artifact__branch_code_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0101_alter_artifact_hash_alter_feature_name_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0102_remove_writelog_branch_code_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0103_remove_writelog_migration_state_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0104_alter_branch_uid.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0105_record_unique_name.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0106_transfer_data_migration.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0107_add_schema_to_record.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0108_remove_record_sheet_remove_sheetproject_sheet_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0109_record_input_of_runs_alter_record_run_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0110_rename_values_artifacts_record_linked_artifacts.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0111_remove_record__sort_order.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0112_alter_recordartifact_feature_and_more.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0113_lower_case_branch_and_space_names.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0114_alter_run__status_code.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/0115_alter_space_uid.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/migrations/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/_from_values.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/_is_versioned.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/_label_manager.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/_relations.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/artifact_set.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/can_curate.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/feature.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/has_parents.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/query_manager.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/query_set.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/save.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/schema.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/storage.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/models/ulabel.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/py.typed +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/setup/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/setup/_switch.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/setup/core/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/setup/errors/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/lamindb/setup/types/__init__.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/conftest.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/conftest.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/notebooks/basic-r-notebook.Rmd.cleaned.html +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/notebooks/basic-r-notebook.Rmd.html +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/notebooks/duplicate/with-title-initialized-consecutive-finish.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/notebooks/no-title.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/notebooks/with-title-initialized-consecutive-finish-not-last-cell.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/notebooks/with-title-initialized-consecutive-finish.ipynb +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/scripts/duplicate1/script-to-test-versioning.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/scripts/duplicate2/script-to-test-versioning.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/scripts/duplicate3/script-to-test-versioning.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/scripts/duplicate4/script-to-test-versioning.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/scripts/duplicate5/script-to-test-versioning.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/scripts/script-to-test-filename-change.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/scripts/script-to-test-versioning.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_artifact_folders.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_can_curate.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_data.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_db.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_delete.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_dtype.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_from_values.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_has_parents.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_integrity.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_load.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_manager.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_models.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_notebooks.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_queryset.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_record.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_run.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_schema.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_search.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_settings.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_storage.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_track.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_transform.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_ulabel.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_versioning.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_view.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/core/test_visibility.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/curators/test_cat_managers.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/curators/test_curators_examples.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/curators/test_curators_multivalue.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/curators/test_cxg_curator.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/curators/test_dataframe_curators_accounting_example.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/curators/test_records.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/permissions/conftest.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/permissions/jwt_utils.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/permissions/scripts/check_lamin_dev.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/permissions/scripts/clean_lamin_dev.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/permissions/scripts/setup_instance.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/permissions/test_permissions.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/storage/conftest.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/storage/test_artifact_storage.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/storage/test_artifact_zarr.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/storage/test_cache.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/storage/test_storage_lifecycle.py +0 -0
- {lamindb-1.9.0 → lamindb-1.10.0}/tests/storage/test_transfer.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: lamindb
|
3
|
-
Version: 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.
|
14
|
-
Requires-Dist: lamindb_setup[aws]==1.
|
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": {},
|
@@ -47,7 +47,7 @@
|
|
47
47
|
},
|
48
48
|
"outputs": [],
|
49
49
|
"source": [
|
50
|
-
"#
|
50
|
+
"# pip install 'lamindb[jupyter]'\n",
|
51
51
|
"import lamindb as ln\n",
|
52
52
|
"\n",
|
53
53
|
"ln.track(\"l9lFf83aPwRc0000\")"
|
@@ -132,6 +132,23 @@
|
|
132
132
|
"ln.Storage.df()"
|
133
133
|
]
|
134
134
|
},
|
135
|
+
{
|
136
|
+
"cell_type": "markdown",
|
137
|
+
"metadata": {},
|
138
|
+
"source": [
|
139
|
+
"You can now set it as a local default storage location.\n",
|
140
|
+
"Next time you connect to the instance, this won't be necessary and the location will be automatically detected as the local default."
|
141
|
+
]
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"cell_type": "code",
|
145
|
+
"execution_count": null,
|
146
|
+
"metadata": {},
|
147
|
+
"outputs": [],
|
148
|
+
"source": [
|
149
|
+
"ln.settings.local_storage = \"./our_local_storage\""
|
150
|
+
]
|
151
|
+
},
|
135
152
|
{
|
136
153
|
"cell_type": "markdown",
|
137
154
|
"metadata": {},
|
@@ -336,7 +353,11 @@
|
|
336
353
|
{
|
337
354
|
"cell_type": "code",
|
338
355
|
"execution_count": null,
|
339
|
-
"metadata": {
|
356
|
+
"metadata": {
|
357
|
+
"tags": [
|
358
|
+
"hide-output"
|
359
|
+
]
|
360
|
+
},
|
340
361
|
"outputs": [],
|
341
362
|
"source": [
|
342
363
|
"artifact.save(upload=True)"
|
@@ -352,7 +373,11 @@
|
|
352
373
|
{
|
353
374
|
"cell_type": "code",
|
354
375
|
"execution_count": null,
|
355
|
-
"metadata": {
|
376
|
+
"metadata": {
|
377
|
+
"tags": [
|
378
|
+
"hide-output"
|
379
|
+
]
|
380
|
+
},
|
356
381
|
"outputs": [],
|
357
382
|
"source": [
|
358
383
|
"ln.settings.storage.root.view_tree()"
|
@@ -368,7 +393,11 @@
|
|
368
393
|
{
|
369
394
|
"cell_type": "code",
|
370
395
|
"execution_count": null,
|
371
|
-
"metadata": {
|
396
|
+
"metadata": {
|
397
|
+
"tags": [
|
398
|
+
"hide-output"
|
399
|
+
]
|
400
|
+
},
|
372
401
|
"outputs": [],
|
373
402
|
"source": [
|
374
403
|
"assert artifact.path.exists()\n",
|
@@ -394,7 +423,11 @@
|
|
394
423
|
{
|
395
424
|
"cell_type": "code",
|
396
425
|
"execution_count": null,
|
397
|
-
"metadata": {
|
426
|
+
"metadata": {
|
427
|
+
"tags": [
|
428
|
+
"hide-output"
|
429
|
+
]
|
430
|
+
},
|
398
431
|
"outputs": [],
|
399
432
|
"source": [
|
400
433
|
"filepath = ln.core.datasets.file_mini_csv()\n",
|
@@ -412,7 +445,11 @@
|
|
412
445
|
{
|
413
446
|
"cell_type": "code",
|
414
447
|
"execution_count": null,
|
415
|
-
"metadata": {
|
448
|
+
"metadata": {
|
449
|
+
"tags": [
|
450
|
+
"hide-output"
|
451
|
+
]
|
452
|
+
},
|
416
453
|
"outputs": [],
|
417
454
|
"source": [
|
418
455
|
"ln.Artifact.df(include=\"storage__root\")"
|
@@ -435,7 +472,11 @@
|
|
435
472
|
{
|
436
473
|
"cell_type": "code",
|
437
474
|
"execution_count": null,
|
438
|
-
"metadata": {
|
475
|
+
"metadata": {
|
476
|
+
"tags": [
|
477
|
+
"hide-output"
|
478
|
+
]
|
479
|
+
},
|
439
480
|
"outputs": [],
|
440
481
|
"source": [
|
441
482
|
"storage_record = ln.Storage.get(root__endswith=\"our_local_storage\")\n",
|
@@ -461,7 +502,11 @@
|
|
461
502
|
{
|
462
503
|
"cell_type": "code",
|
463
504
|
"execution_count": null,
|
464
|
-
"metadata": {
|
505
|
+
"metadata": {
|
506
|
+
"tags": [
|
507
|
+
"hide-ouput"
|
508
|
+
]
|
509
|
+
},
|
465
510
|
"outputs": [],
|
466
511
|
"source": [
|
467
512
|
"artifact.delete(permanent=True)\n",
|
@@ -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.
|
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.
|
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": "
|
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.
|
181
|
+
"version": "3.12.8"
|
181
182
|
}
|
182
183
|
},
|
183
184
|
"nbformat": 4,
|
@@ -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
|
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
|
-
|
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
|
@@ -1236,6 +1236,9 @@ class CatVector:
|
|
1236
1236
|
registry = self._field.field.model
|
1237
1237
|
field_name = self._field.field.name
|
1238
1238
|
non_validated_records: SQLRecordList[Any] = [] # type: ignore
|
1239
|
+
type_record = None
|
1240
|
+
if self._subtype_str != "" and "=" not in self._subtype_str:
|
1241
|
+
type_record = registry.get(name=self._subtype_str)
|
1239
1242
|
if df is not None and registry == Feature:
|
1240
1243
|
nonval_columns = Feature.inspect(df.columns, mute=True).non_validated
|
1241
1244
|
non_validated_records = Feature.from_df(df.loc[:, nonval_columns])
|
@@ -1252,6 +1255,9 @@ class CatVector:
|
|
1252
1255
|
init_kwargs = {field_name: value}
|
1253
1256
|
if registry == Feature:
|
1254
1257
|
init_kwargs["dtype"] = "cat" if dtype is None else dtype
|
1258
|
+
if type_record is not None:
|
1259
|
+
# if subtype_str is set, we need to set the type for new records
|
1260
|
+
init_kwargs["type"] = type_record
|
1255
1261
|
non_validated_records.append(registry(**init_kwargs, **create_kwargs))
|
1256
1262
|
if len(non_validated_records) > 0:
|
1257
1263
|
ln_save(non_validated_records)
|
@@ -1,12 +1,16 @@
|
|
1
|
-
from
|
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
|
+
}
|