Prepare transfer artifacts from a local instance to a cloud instance¶
!lamin settings set auto-connect false
import lamindb as ln
import bionty as bt
import wetlab as wl
import pandas as pd
ln.setup.init(storage="./test-transfer-to-cloud", modules="bionty,wetlab")
ln.setup.settings.auto_connect = False
→ initialized lamindb: testuser1/test-transfer-to-cloud
artifact = ln.Artifact.from_df(
pd.DataFrame({"a": [1, 2, 3]}), description="test-transfer-to-cloud"
).save()
features = bt.CellMarker.from_values(
["PD1", "CD21"], field=bt.CellMarker.name, organism="human"
)
ln.save(features)
artifact.features.add_feature_set(ln.FeatureSet(features), slot="var")
organism = bt.Organism.from_source(name="human").save()
artifact.labels.add(organism)
experiment = wl.Experiment(name="experiment-test-transfer-to-cloud").save()
artifact.experiments.add(experiment)
artifact.describe()
! no run & transform got linked, call `ln.track()` & re-run
Artifact .parquet/DataFrame ├── General │ ├── .uid = 'eju4fdhwcvisNTkE0000' │ ├── .size = 1562 │ ├── .hash = 'poQJlkY6NKUW_FTujwevGQ' │ ├── .path = │ │ /home/runner/work/lamindb/lamindb/docs/storage/test-transfer-to-cloud/.lamindb/eju4fdhwcvisNTkE0000.parquet │ ├── .created_by = testuser1 (Test User1) │ └── .created_at = 2025-01-17 14:21:29 ├── Dataset features/._schemas_m2m │ └── var • 2 [bionty.CellMarker] │ PD1 num │ CD21 num └── Labels └── .organisms bionty.Organism human .experiments wetlab.Experiment experiment-test-transfer-to-cloud
assert artifact.features["var"].count() == 2