Prepare transfer artifacts from a local instance to a cloud instance
¶
!lamin disconnect
import lamindb as ln
import bionty as bt
import pertdb
import pandas as pd
ln.setup.init(storage="./test-transfer-to-cloud", modules="bionty,pertdb")
→ initialized lamindb: testuser1/test-transfer-to-cloud
artifact = ln.Artifact.from_dataframe(
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"
).save()
artifact.features._add_schema(ln.Schema(features), slot="var")
organism = bt.Organism.from_source(name="human").save()
artifact.labels.add(organism)
compound = pertdb.Compound(name="compound-test-transfer-to-cloud").save()
artifact.compounds.add(compound)
artifact.describe()
! no run & transform got linked, call `ln.track()` & re-run
→ writing the in-memory object into cache
Artifact: (0000) | description: test-transfer-to-cloud ├── uid: cinWFwFmf5UHv2dI0000 run: │ kind: dataset otype: DataFrame │ hash: tf8xmO4a3_kkB7dxC6ae9g size: 1.6 KB │ branch: main space: all │ created_at: 2026-02-05 16:08:59 UTC created_by: testuser1 │ n_observations: 3 ├── storage/path: │ /home/runner/work/lamindb/lamindb/docs/storage/test-transfer-to-cloud/.lamindb/cinWFwFmf5UHv2dI0000.parquet ├── Dataset features │ └── var (2 bionty.CellMarker) │ CD21 num │ PD1 num └── Labels └── .compounds pertdb.Compound compound-test-transfer-to-cloud .organisms bionty.Organism human
assert artifact.features.slots["var"].members.count() == 2