lamindb 1.6.1__tar.gz → 1.7a1__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.6.1 → lamindb-1.7a1}/.pre-commit-config.yaml +9 -3
- {lamindb-1.6.1 → lamindb-1.7a1}/PKG-INFO +5 -5
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/acid.ipynb +3 -3
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/setup.ipynb +4 -4
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/curate_soma_experiment.py +8 -8
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/transfer-local-to-cloud.ipynb +1 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/transfer.ipynb +90 -13
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/__init__.py +1 -3
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/_finish.py +32 -16
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/base/types.py +6 -4
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/_context.py +125 -55
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/_mapped_collection.py +1 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/_settings.py +44 -4
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/_track_environment.py +5 -2
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/loaders.py +1 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/_anndata_accessor.py +1 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/_tiledbsoma.py +14 -8
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/_valid_suffixes.py +0 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/_zarr.py +1 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/objects.py +13 -8
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/paths.py +9 -6
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/types.py +1 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/curators/_legacy.py +2 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/curators/core.py +106 -105
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/errors.py +9 -0
- lamindb-1.7a1/lamindb/examples/fixtures/sheets.py +224 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0103_remove_writelog_migration_state_and_more.py +1 -1
- lamindb-1.7a1/lamindb/migrations/0105_record_unique_name.py +20 -0
- lamindb-1.7a1/lamindb/migrations/0106_transfer_data_migration.py +25 -0
- lamindb-1.7a1/lamindb/migrations/0107_add_schema_to_record.py +68 -0
- lamindb-1.7a1/lamindb/migrations/0108_remove_record_sheet_remove_sheetproject_sheet_and_more.py +30 -0
- lamindb-1.7a1/lamindb/migrations/0109_record_input_of_runs_alter_record_run_and_more.py +123 -0
- lamindb-1.7a1/lamindb/migrations/0110_rename_values_artifacts_record_linked_artifacts.py +17 -0
- lamindb-1.7a1/lamindb/migrations/0111_remove_record__sort_order.py +148 -0
- lamindb-1.7a1/lamindb/migrations/0112_alter_recordartifact_feature_and_more.py +105 -0
- lamindb-1.7a1/lamindb/migrations/0113_lower_case_branch_and_space_names.py +62 -0
- lamindb-1.7a1/lamindb/migrations/0114_alter_run__status_code.py +24 -0
- lamindb-1.6.1/lamindb/migrations/0104_squashed.py → lamindb-1.7a1/lamindb/migrations/0114_squashed.py +258 -255
- lamindb-1.7a1/lamindb/migrations/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/__init__.py +4 -3
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/_describe.py +88 -31
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/_feature_manager.py +627 -658
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/_label_manager.py +1 -3
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/artifact.py +214 -99
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/collection.py +7 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/feature.py +288 -60
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/has_parents.py +3 -3
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/project.py +32 -15
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/query_manager.py +7 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/query_set.py +118 -41
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/record.py +140 -94
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/run.py +42 -42
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/save.py +102 -16
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/schema.py +41 -8
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/sqlrecord.py +87 -32
- lamindb-1.7a1/lamindb/models/storage.py +278 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/transform.py +10 -2
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/ulabel.py +9 -1
- lamindb-1.7a1/lamindb/py.typed +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/setup/__init__.py +1 -1
- lamindb-1.7a1/lamindb/setup/errors/__init__.py +4 -0
- lamindb-1.7a1/lamindb/setup/types/__init__.py +4 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/noxfile.py +6 -4
- {lamindb-1.6.1 → lamindb-1.7a1}/pyproject.toml +13 -4
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/conftest.py +6 -2
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/scripts/duplicate2/script-to-test-versioning.py +1 -1
- lamindb-1.7a1/tests/core/scripts/duplicate3/script-to-test-versioning.py +4 -0
- lamindb-1.7a1/tests/core/scripts/duplicate5/script-to-test-versioning.py +6 -0
- lamindb-1.6.1/tests/core/scripts/duplicate3/script-to-test-versioning.py → lamindb-1.7a1/tests/core/scripts/script-to-test-filename-change.py +0 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_artifact.py +16 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_artifact_folders.py +29 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_collection.py +2 -2
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_describe_and_df_calls.py +61 -19
- lamindb-1.7a1/tests/core/test_dtype.py +322 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_feature.py +56 -7
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_feature_label_manager.py +6 -7
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_models.py +1 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_queryset.py +2 -2
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_save.py +9 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_schema.py +73 -0
- lamindb-1.7a1/tests/core/test_settings.py +14 -0
- lamindb-1.7a1/tests/core/test_storage.py +31 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_track.py +11 -28
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_transform.py +1 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/curators/test_curators_examples.py +74 -50
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/curators/test_curators_general.py +215 -8
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/curators/test_dataframe_curators_accounting_example.py +1 -2
- lamindb-1.7a1/tests/curators/test_records.py +201 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/permissions/conftest.py +1 -1
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/permissions/scripts/check_lamin_dev.py +3 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/permissions/scripts/setup_access.py +12 -3
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/permissions/test_permissions.py +109 -20
- lamindb-1.7a1/tests/storage/conftest.py +91 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/storage/test_artifact_zarr.py +6 -1
- lamindb-1.7a1/tests/storage/test_storage_lifecycle.py +84 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/storage/test_transfer.py +43 -63
- lamindb-1.6.1/lamindb/models/core.py +0 -135
- lamindb-1.6.1/tests/core/scripts/script-to-test-filename-change.py +0 -3
- lamindb-1.6.1/tests/core/test_dtype.py +0 -160
- lamindb-1.6.1/tests/curators/test_records.py +0 -29
- lamindb-1.6.1/tests/storage/conftest.py +0 -49
- lamindb-1.6.1/tests/storage/test_switch_storage.py +0 -23
- {lamindb-1.6.1 → lamindb-1.7a1}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/.github/ISSUE_TEMPLATE/usage_question.yml +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/.github/workflows/build.yml +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/.github/workflows/doc-changes.yml +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/.gitignore +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/.gitmodules +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/CONTRIBUTING.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/LICENSE +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/README.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/api.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/arrays.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/bio-registries.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/bionty.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/changelog.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/clinicore.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/curate.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/curate-any.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/delete.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/idempotency.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/import-modules.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/keep-artifacts-local.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/pydantic-pandera.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/reference-field.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/search.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/symbol-mapping.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/test_notebooks.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/track-run-inputs.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/validate-fields.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq/visibility.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/faq.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/guide.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/includes/installation.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/index.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/lamindb.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/query-search.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/registries.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/curate_anndata_flexible.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/curate_dataframe_flexible.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/curate_dataframe_minimal_errors.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/curate_mudata.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/curate_spatialdata.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/define_mini_immuno_features_labels.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/define_mini_immuno_schema_flexible.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/define_schema_anndata_ensembl_gene_ids_and_valid_features_in_obs.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/define_schema_spatialdata.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/define_valid_features.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/ingest_mini_immuno_datasets.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/run_track_and_finish.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/run_track_with_params.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/run_workflow.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/scripts/synced_with_git.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/add-replace-cache.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/anndata-accessor.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/prepare-transfer-local-to-cloud.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/test-files/iris.csv +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/test-files/iris.data +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/test-files/new_iris.csv +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/test_notebooks.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/upload.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage/vitessce.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/storage.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/test_notebooks.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/track.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/docs/wetlab.md +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/_tracked.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/_view.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/base/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/base/fields.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/base/ids.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/base/uids.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/base/users.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/_compat.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/_sync_git.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/datasets/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/datasets/_core.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/datasets/_fake.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/datasets/_small.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/datasets/mini_immuno.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/exceptions.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/_backed_access.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/_polars_lazy_df.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/storage/_pyarrow_dataset.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/subsettings/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/subsettings/_annotation_settings.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/core/subsettings/_creation_settings.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/curators/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/curators/_cellxgene_schemas/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/curators/_cellxgene_schemas/schema_versions.csv +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/examples/__init__.py +0 -0
- {lamindb-1.6.1/lamindb/migrations → lamindb-1.7a1/lamindb/examples/fixtures}/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/examples/schemas/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/examples/schemas/_anndata.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/examples/schemas/_simple.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/integrations/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/integrations/_vitessce.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0069_squashed.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0070_lamindbv1_migrate_data.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0071_lamindbv1_migrate_schema.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0072_remove_user__branch_code_remove_user_aux_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0073_merge_ourprojects.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0074_lamindbv1_part4.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0075_lamindbv1_part5.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0076_lamindbv1_part6.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0077_lamindbv1_part6b.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0078_lamindbv1_part6c.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0079_alter_rundata_value_json_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0080_polish_lamindbv1.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0081_revert_textfield_collection.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0082_alter_feature_dtype.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0083_alter_feature_is_type_alter_flextable_is_type_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0084_alter_schemafeature_feature_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0085_alter_feature_is_type_alter_flextable_is_type_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0086_various.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0087_rename__schemas_m2m_artifact_feature_sets_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0088_schema_components.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0089_subsequent_runs.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0090_runproject_project_runs.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0091_alter_featurevalue_options_alter_space_options_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0092_alter_artifactfeaturevalue_artifact_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0093_alter_schemacomponent_unique_together.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0094_writeloglock_writelogmigrationstate_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0095_remove_rundata_flextable.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0096_remove_artifact__param_values_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0097_remove_schemaparam_param_remove_paramvalue_param_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0098_alter_feature_type_alter_project_type_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0099_alter_writelog_seqno.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0100_branch_alter_artifact__branch_code_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0101_alter_artifact_hash_alter_feature_name_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0102_remove_writelog_branch_code_and_more.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/migrations/0104_alter_branch_uid.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/_django.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/_from_values.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/_is_versioned.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/_relations.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/artifact_set.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/models/can_curate.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/lamindb/setup/core/__init__.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/conftest.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/_dataset_fixtures.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/notebooks/basic-r-notebook.Rmd.cleaned.html +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/notebooks/basic-r-notebook.Rmd.html +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/notebooks/duplicate/with-title-initialized-consecutive-finish.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/notebooks/no-title.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/notebooks/with-title-initialized-consecutive-finish-not-last-cell.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/notebooks/with-title-initialized-consecutive-finish.ipynb +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/scripts/duplicate1/script-to-test-versioning.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/scripts/duplicate4/script-to-test-versioning.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/scripts/script-to-test-versioning.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_can_curate.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_data.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_db.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_delete.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_from_values.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_has_parents.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_integrity.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_load.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_manager.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_notebooks.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_record.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_run.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_search.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_tracked.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_ulabel.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_versioning.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_view.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/core/test_visibility.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/curators/conftest.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/curators/test_cat_managers.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/curators/test_curators_multivalue.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/curators/test_cxg_curator.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/curators/test_pert_curator.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/permissions/jwt_utils.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/permissions/scripts/clean_lamin_dev.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/permissions/scripts/setup_instance.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/storage/test_artifact_storage.py +0 -0
- {lamindb-1.6.1 → lamindb-1.7a1}/tests/storage/test_cache.py +0 -0
- /lamindb-1.6.1/tests/storage/test_storage.py → /lamindb-1.7a1/tests/storage/test_streaming.py +0 -0
@@ -24,7 +24,7 @@ repos:
|
|
24
24
|
docs/notes/
|
25
25
|
)
|
26
26
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
27
|
-
rev: v0.9.
|
27
|
+
rev: v0.9.10
|
28
28
|
hooks:
|
29
29
|
- id: ruff
|
30
30
|
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes]
|
@@ -51,7 +51,12 @@ repos:
|
|
51
51
|
rev: v1.14.1
|
52
52
|
hooks:
|
53
53
|
- id: mypy
|
54
|
-
args:
|
54
|
+
args:
|
55
|
+
[
|
56
|
+
--no-strict-optional,
|
57
|
+
--ignore-missing-imports,
|
58
|
+
--disable-error-code=annotation-unchecked,
|
59
|
+
]
|
55
60
|
additional_dependencies: ["types-requests", "types-attrs"]
|
56
61
|
exclude: |
|
57
62
|
(?x)(
|
@@ -62,5 +67,6 @@ repos:
|
|
62
67
|
tests/permissions/conftest.py|
|
63
68
|
tests/writelog/conftest.py|
|
64
69
|
tests/writelog_sqlite/conftest.py|
|
65
|
-
tests/curators/test_curators_examples.py
|
70
|
+
tests/curators/test_curators_examples.py|
|
71
|
+
tests/core/conftest.py
|
66
72
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: lamindb
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.7a1
|
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
|
@@ -9,9 +9,9 @@ Classifier: Programming Language :: Python :: 3.10
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.11
|
10
10
|
Classifier: Programming Language :: Python :: 3.12
|
11
11
|
Classifier: Programming Language :: Python :: 3.13
|
12
|
-
Requires-Dist: lamin_utils==0.
|
13
|
-
Requires-Dist: lamin_cli==1.
|
14
|
-
Requires-Dist: lamindb_setup[aws]==1.
|
12
|
+
Requires-Dist: lamin_utils==0.15.0
|
13
|
+
Requires-Dist: lamin_cli==1.5.1
|
14
|
+
Requires-Dist: lamindb_setup[aws]==1.7.0
|
15
15
|
Requires-Dist: pyyaml
|
16
16
|
Requires-Dist: pyarrow
|
17
17
|
Requires-Dist: pandera>=0.24.0
|
@@ -23,7 +23,7 @@ Requires-Dist: anndata>=0.8.0,<=0.11.4
|
|
23
23
|
Requires-Dist: fsspec
|
24
24
|
Requires-Dist: graphviz
|
25
25
|
Requires-Dist: psycopg2-binary
|
26
|
-
Requires-Dist: bionty>=1.
|
26
|
+
Requires-Dist: bionty>=1.6.0 ; extra == "bionty"
|
27
27
|
Requires-Dist: clinicore ; extra == "clinicore"
|
28
28
|
Requires-Dist: tomlkit ; extra == "dev"
|
29
29
|
Requires-Dist: line_profiler ; extra == "dev"
|
@@ -115,7 +115,7 @@
|
|
115
115
|
"id": "11",
|
116
116
|
"metadata": {},
|
117
117
|
"source": [
|
118
|
-
"This raises a `
|
118
|
+
"This raises a `PermissionError`:"
|
119
119
|
]
|
120
120
|
},
|
121
121
|
{
|
@@ -125,7 +125,7 @@
|
|
125
125
|
"metadata": {},
|
126
126
|
"outputs": [],
|
127
127
|
"source": [
|
128
|
-
"with pytest.raises(
|
128
|
+
"with pytest.raises(PermissionError) as error:\n",
|
129
129
|
" artifact.save()\n",
|
130
130
|
"print(error.exconly())"
|
131
131
|
]
|
@@ -247,7 +247,7 @@
|
|
247
247
|
"name": "python",
|
248
248
|
"nbconvert_exporter": "python",
|
249
249
|
"pygments_lexer": "ipython3",
|
250
|
-
"version": "3.
|
250
|
+
"version": "3.10.16"
|
251
251
|
},
|
252
252
|
"nbproject": {
|
253
253
|
"id": "zz23msudiiQR",
|
@@ -100,10 +100,10 @@
|
|
100
100
|
"metadata": {},
|
101
101
|
"outputs": [],
|
102
102
|
"source": [
|
103
|
-
"from lamindb_setup._init_instance import CannotSwitchDefaultInstance\n",
|
103
|
+
"# from lamindb_setup._init_instance import CannotSwitchDefaultInstance\n",
|
104
104
|
"\n",
|
105
|
-
"with pytest.raises(CannotSwitchDefaultInstance):\n",
|
106
|
-
" ln.setup.init(storage=\"./testsetup2\")"
|
105
|
+
"# with pytest.raises(CannotSwitchDefaultInstance):\n",
|
106
|
+
"# ln.setup.init(storage=\"./testsetup2\")"
|
107
107
|
]
|
108
108
|
},
|
109
109
|
{
|
@@ -133,7 +133,7 @@
|
|
133
133
|
"name": "python",
|
134
134
|
"nbconvert_exporter": "python",
|
135
135
|
"pygments_lexer": "ipython3",
|
136
|
-
"version": "3.
|
136
|
+
"version": "3.10.16"
|
137
137
|
},
|
138
138
|
"vscode": {
|
139
139
|
"interpreter": {
|
@@ -3,9 +3,8 @@ import bionty as bt
|
|
3
3
|
import tiledbsoma as soma
|
4
4
|
import tiledbsoma.io
|
5
5
|
|
6
|
-
adata = ln.core.datasets.
|
6
|
+
adata = ln.core.datasets.mini_immuno.get_dataset1(otype="AnnData")
|
7
7
|
tiledbsoma.io.from_anndata("small_dataset.tiledbsoma", adata, measurement_name="RNA")
|
8
|
-
experiment = soma.Experiment.open("small_dataset.tiledbsoma")
|
9
8
|
|
10
9
|
obs_schema = ln.Schema(
|
11
10
|
name="soma_obs_schema",
|
@@ -32,11 +31,12 @@ soma_schema = ln.Schema(
|
|
32
31
|
},
|
33
32
|
).save()
|
34
33
|
|
35
|
-
|
36
|
-
curator.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
34
|
+
with soma.Experiment.open("small_dataset.tiledbsoma") as experiment:
|
35
|
+
curator = ln.curators.TiledbsomaExperimentCurator(experiment, soma_schema)
|
36
|
+
curator.validate()
|
37
|
+
artifact = curator.save_artifact(
|
38
|
+
key="examples/soma_experiment.tiledbsoma",
|
39
|
+
description="SOMA experiment with schema validation",
|
40
|
+
)
|
41
41
|
assert artifact.schema == soma_schema
|
42
42
|
artifact.describe()
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"source": [
|
41
41
|
"import lamindb as ln\n",
|
42
42
|
"\n",
|
43
|
-
"ln.track(\"
|
43
|
+
"ln.track(\"ITeOtm7bhtdq\")"
|
44
44
|
]
|
45
45
|
},
|
46
46
|
{
|
@@ -127,7 +127,7 @@
|
|
127
127
|
"cell_type": "markdown",
|
128
128
|
"metadata": {},
|
129
129
|
"source": [
|
130
|
-
"The artifact record
|
130
|
+
"The artifact record has been transferred to the current database without feature & label annotations, but with updated data lineage."
|
131
131
|
]
|
132
132
|
},
|
133
133
|
{
|
@@ -147,7 +147,7 @@
|
|
147
147
|
"cell_type": "markdown",
|
148
148
|
"metadata": {},
|
149
149
|
"source": [
|
150
|
-
"You see that the data itself remained in the original storage location, which has been added to the current instance's storage location as a read-only location."
|
150
|
+
"You see that the data itself remained in the original storage location, which has been added to the current instance's storage location as a read-only location (indicated by the fact that the `instance_uid` doesn't match the current instance)."
|
151
151
|
]
|
152
152
|
},
|
153
153
|
{
|
@@ -193,7 +193,11 @@
|
|
193
193
|
{
|
194
194
|
"cell_type": "code",
|
195
195
|
"execution_count": null,
|
196
|
-
"metadata": {
|
196
|
+
"metadata": {
|
197
|
+
"tags": [
|
198
|
+
"hide-output"
|
199
|
+
]
|
200
|
+
},
|
197
201
|
"outputs": [],
|
198
202
|
"source": [
|
199
203
|
"artifact.view_lineage()"
|
@@ -209,7 +213,11 @@
|
|
209
213
|
{
|
210
214
|
"cell_type": "code",
|
211
215
|
"execution_count": null,
|
212
|
-
"metadata": {
|
216
|
+
"metadata": {
|
217
|
+
"tags": [
|
218
|
+
"hide-output"
|
219
|
+
]
|
220
|
+
},
|
213
221
|
"outputs": [],
|
214
222
|
"source": [
|
215
223
|
"artifact.transform.description"
|
@@ -219,13 +227,17 @@
|
|
219
227
|
"cell_type": "markdown",
|
220
228
|
"metadata": {},
|
221
229
|
"source": [
|
222
|
-
"The transform key has
|
230
|
+
"The transform key has the form `f\"__lamindb_transfer__/{source_instance.uid}\"`:"
|
223
231
|
]
|
224
232
|
},
|
225
233
|
{
|
226
234
|
"cell_type": "code",
|
227
235
|
"execution_count": null,
|
228
|
-
"metadata": {
|
236
|
+
"metadata": {
|
237
|
+
"tags": [
|
238
|
+
"hide-output"
|
239
|
+
]
|
240
|
+
},
|
229
241
|
"outputs": [],
|
230
242
|
"source": [
|
231
243
|
"artifact.transform.key"
|
@@ -241,12 +253,78 @@
|
|
241
253
|
{
|
242
254
|
"cell_type": "code",
|
243
255
|
"execution_count": null,
|
244
|
-
"metadata": {
|
256
|
+
"metadata": {
|
257
|
+
"tags": [
|
258
|
+
"hide-output"
|
259
|
+
]
|
260
|
+
},
|
245
261
|
"outputs": [],
|
246
262
|
"source": [
|
247
263
|
"artifact.run.initiated_by_run.transform"
|
248
264
|
]
|
249
265
|
},
|
266
|
+
{
|
267
|
+
"cell_type": "markdown",
|
268
|
+
"metadata": {},
|
269
|
+
"source": [
|
270
|
+
"Upon re-transferring a record, it will identify that the record already exists in the target database and simply map the record."
|
271
|
+
]
|
272
|
+
},
|
273
|
+
{
|
274
|
+
"cell_type": "code",
|
275
|
+
"execution_count": null,
|
276
|
+
"metadata": {
|
277
|
+
"tags": [
|
278
|
+
"hide-output"
|
279
|
+
]
|
280
|
+
},
|
281
|
+
"outputs": [],
|
282
|
+
"source": [
|
283
|
+
"artifact = artifacts.filter(description__contains=\"Tabula Sapiens\").first()\n",
|
284
|
+
"artifact.save()"
|
285
|
+
]
|
286
|
+
},
|
287
|
+
{
|
288
|
+
"cell_type": "markdown",
|
289
|
+
"metadata": {},
|
290
|
+
"source": [
|
291
|
+
"If you also want to transfer annotations of the artifact, you can pass `transfer=\"annotations\"` to `save()`. Just note that this might populate your target database with metadata that doesn't match the conventions you want to enforce."
|
292
|
+
]
|
293
|
+
},
|
294
|
+
{
|
295
|
+
"cell_type": "code",
|
296
|
+
"execution_count": null,
|
297
|
+
"metadata": {
|
298
|
+
"tags": [
|
299
|
+
"hide-output"
|
300
|
+
]
|
301
|
+
},
|
302
|
+
"outputs": [],
|
303
|
+
"source": [
|
304
|
+
"artifact = artifacts.filter(description__contains=\"Tabula Sapiens\").first()\n",
|
305
|
+
"artifact.save(transfer=\"annotations\")"
|
306
|
+
]
|
307
|
+
},
|
308
|
+
{
|
309
|
+
"cell_type": "markdown",
|
310
|
+
"metadata": {},
|
311
|
+
"source": [
|
312
|
+
"The artifact is now annotated."
|
313
|
+
]
|
314
|
+
},
|
315
|
+
{
|
316
|
+
"cell_type": "code",
|
317
|
+
"execution_count": null,
|
318
|
+
"metadata": {
|
319
|
+
"tags": [
|
320
|
+
"hide-output"
|
321
|
+
]
|
322
|
+
},
|
323
|
+
"outputs": [],
|
324
|
+
"source": [
|
325
|
+
"artifact.describe()"
|
326
|
+
]
|
327
|
+
},
|
250
328
|
{
|
251
329
|
"cell_type": "code",
|
252
330
|
"execution_count": null,
|
@@ -258,11 +336,10 @@
|
|
258
336
|
"outputs": [],
|
259
337
|
"source": [
|
260
338
|
"# test the last 3 cells here\n",
|
261
|
-
"
|
262
|
-
"
|
263
|
-
"
|
264
|
-
"
|
265
|
-
"# assert artifact.run.initiated_by_run.transform.description == \"Transfer data\"\n",
|
339
|
+
"assert artifact.transform.description == \"Transfer from `laminlabs/lamindata`\"\n",
|
340
|
+
"assert artifact.transform.key == \"__lamindb_transfer__/4XIuR0tvaiXM\"\n",
|
341
|
+
"assert artifact.transform.uid == \"4XIuR0tvaiXM0000\"\n",
|
342
|
+
"assert artifact.run.initiated_by_run.transform.description == \"Transfer data\"\n",
|
266
343
|
"\n",
|
267
344
|
"# clean up test instance\n",
|
268
345
|
"!lamin delete --force test-transfer"
|
@@ -46,7 +46,6 @@ Manage flexible records to track, e.g., samples or donors.
|
|
46
46
|
:toctree: .
|
47
47
|
|
48
48
|
Record
|
49
|
-
Sheet
|
50
49
|
|
51
50
|
Manage projects.
|
52
51
|
|
@@ -109,7 +108,7 @@ Backwards compatibility.
|
|
109
108
|
|
110
109
|
# ruff: noqa: I001
|
111
110
|
# denote a release candidate for 0.1.0 with 0.1rc1, 0.1a1, 0.1b1, etc.
|
112
|
-
__version__ = "1.
|
111
|
+
__version__ = "1.7a1"
|
113
112
|
|
114
113
|
import warnings
|
115
114
|
|
@@ -155,7 +154,6 @@ if _check_instance_setup(from_module="lamindb"):
|
|
155
154
|
Space,
|
156
155
|
Branch,
|
157
156
|
Record,
|
158
|
-
Sheet,
|
159
157
|
)
|
160
158
|
from .models.save import save
|
161
159
|
from . import core
|
@@ -9,7 +9,7 @@ from typing import TYPE_CHECKING
|
|
9
9
|
import lamindb_setup as ln_setup
|
10
10
|
from lamin_utils import logger
|
11
11
|
from lamin_utils._logger import LEVEL_TO_COLORS, LEVEL_TO_ICONS, RESET_COLOR
|
12
|
-
from lamindb_setup.core.hashing import hash_file
|
12
|
+
from lamindb_setup.core.hashing import hash_dir, hash_file
|
13
13
|
|
14
14
|
from lamindb.models import Artifact, Run, Transform
|
15
15
|
|
@@ -241,6 +241,7 @@ def save_context_core(
|
|
241
241
|
transform: Transform,
|
242
242
|
filepath: Path,
|
243
243
|
finished_at: bool = False,
|
244
|
+
skip_save_report: bool = False,
|
244
245
|
ignore_non_consecutive: bool | None = None,
|
245
246
|
from_cli: bool = False,
|
246
247
|
is_retry: bool = False,
|
@@ -343,7 +344,6 @@ def save_context_core(
|
|
343
344
|
transform_hash, _ = hash_file(source_code_path) # ignore hash_type for now
|
344
345
|
if transform.hash is not None:
|
345
346
|
# check if the hash of the transform source code matches
|
346
|
-
# (for scripts, we already run the same logic in track() - we can deduplicate the call at some point)
|
347
347
|
if transform_hash != transform.hash:
|
348
348
|
response = input(
|
349
349
|
f"You are about to overwrite existing source code (hash '{transform.hash}') for Transform('{transform.uid}')."
|
@@ -361,26 +361,46 @@ def save_context_core(
|
|
361
361
|
transform.source_code = source_code_path.read_text()
|
362
362
|
transform.hash = transform_hash
|
363
363
|
|
364
|
-
# track run environment
|
365
364
|
if run is not None:
|
366
|
-
|
367
|
-
|
365
|
+
base_path = ln_setup.settings.cache_dir / "environments" / f"run_{run.uid}"
|
366
|
+
paths = [base_path / "run_env_pip.txt", base_path / "r_pak_lockfile.json"]
|
367
|
+
existing_paths = [path for path in paths if path.exists()]
|
368
|
+
|
369
|
+
if existing_paths:
|
368
370
|
overwrite_env = True
|
369
371
|
if run.environment_id is not None and from_cli:
|
370
372
|
logger.important("run.environment is already saved, ignoring")
|
371
373
|
overwrite_env = False
|
374
|
+
|
372
375
|
if overwrite_env:
|
373
|
-
|
376
|
+
# Use directory if multiple files exist, otherwise use the single file
|
377
|
+
artifact_path: Path = (
|
378
|
+
base_path if len(existing_paths) > 1 else existing_paths[0]
|
379
|
+
)
|
380
|
+
|
381
|
+
# Set description based on what we're saving
|
382
|
+
if len(existing_paths) == 1:
|
383
|
+
if existing_paths[0].name == "run_env_pip.txt":
|
384
|
+
description = "requirements.txt"
|
385
|
+
elif existing_paths[0].name == "r_pak_lockfile.json":
|
386
|
+
description = "r_pak_lockfile.json"
|
387
|
+
env_hash, _ = hash_file(artifact_path)
|
388
|
+
else:
|
389
|
+
description = "environments"
|
390
|
+
_, env_hash, _, _ = hash_dir(artifact_path)
|
391
|
+
|
374
392
|
artifact = ln.Artifact.objects.filter(hash=env_hash).one_or_none()
|
375
393
|
new_env_artifact = artifact is None
|
394
|
+
|
376
395
|
if new_env_artifact:
|
377
|
-
artifact = ln.Artifact(
|
378
|
-
|
379
|
-
description=
|
396
|
+
artifact = ln.Artifact(
|
397
|
+
artifact_path,
|
398
|
+
description=description,
|
380
399
|
kind="__lamindb_run__",
|
381
400
|
run=False,
|
382
401
|
)
|
383
402
|
artifact.save(upload=True, print_progress=False)
|
403
|
+
|
384
404
|
run.environment = artifact
|
385
405
|
if new_env_artifact:
|
386
406
|
logger.debug(f"saved run.environment: {run.environment}")
|
@@ -394,12 +414,8 @@ def save_context_core(
|
|
394
414
|
if update_finished_at:
|
395
415
|
run.finished_at = datetime.now(timezone.utc)
|
396
416
|
|
397
|
-
# track logs
|
398
|
-
if run is not None and not from_cli and not is_ipynb and not is_r_notebook:
|
399
|
-
save_run_logs(run)
|
400
|
-
|
401
417
|
# track report and set is_consecutive
|
402
|
-
if save_source_code_and_report:
|
418
|
+
if save_source_code_and_report and not skip_save_report:
|
403
419
|
if run is not None:
|
404
420
|
# do not save a run report if executing through nbconvert
|
405
421
|
if report_path is not None and notebook_runner != "nbconvert":
|
@@ -454,7 +470,7 @@ def save_context_core(
|
|
454
470
|
ln.Transform.get(transform_id_prior_to_save).delete()
|
455
471
|
|
456
472
|
# finalize
|
457
|
-
if not from_cli and run is not None:
|
473
|
+
if finished_at and not from_cli and run is not None:
|
458
474
|
run_time = run.finished_at - run.started_at
|
459
475
|
days = run_time.days
|
460
476
|
seconds = run_time.seconds
|
@@ -480,7 +496,7 @@ def save_context_core(
|
|
480
496
|
logger.important(
|
481
497
|
f"go to: https://lamin.ai/{instance_slug}/transform/{transform.uid}"
|
482
498
|
)
|
483
|
-
if not from_cli and save_source_code_and_report:
|
499
|
+
if finished_at and not from_cli and save_source_code_and_report:
|
484
500
|
thing = "notebook" if (is_ipynb or is_r_notebook) else "script"
|
485
501
|
logger.important(
|
486
502
|
f"to update your {thing} from the CLI, run: lamin save {filepath}"
|
@@ -27,7 +27,7 @@ from typing import Literal, Union
|
|
27
27
|
import numpy as np
|
28
28
|
import pandas as pd
|
29
29
|
from django.db.models.query_utils import DeferredAttribute as FieldAttr
|
30
|
-
from lamindb_setup.
|
30
|
+
from lamindb_setup.types import UPathStr # noqa: F401
|
31
31
|
|
32
32
|
# need to use Union because __future__.annotations doesn't do the job here <3.10
|
33
33
|
# typing.TypeAlias, >3.10 on but already deprecated
|
@@ -37,7 +37,7 @@ StrField = Union[str, FieldAttr] # typing.TypeAlias
|
|
37
37
|
TransformType = Literal[
|
38
38
|
"pipeline", "notebook", "upload", "script", "function", "linker"
|
39
39
|
]
|
40
|
-
ArtifactKind = Literal["dataset", "model"]
|
40
|
+
ArtifactKind = Literal["dataset", "model", "__lamindb_run__"]
|
41
41
|
|
42
42
|
# below is used for Feature.dtype and Param.dtype
|
43
43
|
Dtype = Literal[
|
@@ -51,10 +51,11 @@ Dtype = Literal[
|
|
51
51
|
"datetime", # datetime
|
52
52
|
"dict", # dictionary
|
53
53
|
"object", # this is a pandas input dtype, we're only using it for complicated types, not for strings
|
54
|
+
"path", # path, validated as str, but specially treated in the UI
|
54
55
|
]
|
55
56
|
"""Data type.
|
56
57
|
|
57
|
-
|
58
|
+
String-serialized representations of common data types.
|
58
59
|
|
59
60
|
Overview
|
60
61
|
========
|
@@ -68,8 +69,9 @@ integer `"int"` `int64 | int32 | int16 | int8 | uint | ...`
|
|
68
69
|
float `"float"` `float64 | float32 | float16 | float8 | ...`
|
69
70
|
string `"str"` `object`
|
70
71
|
datetime `"datetime"` `datetime`
|
71
|
-
date `"date"` `date`
|
72
|
+
date `"date"` `object` (pandera requires an ISO-format string, convert with `df["date"] = df["date"].dt.date`)
|
72
73
|
dictionary `"dict"` `object`
|
74
|
+
path `"path"` `str` (pandas does not have a dedicated path type, validated as `str`)
|
73
75
|
============ ============ =================================================
|
74
76
|
|
75
77
|
Categoricals
|