Init a local instance

!lamin login testuser1
import lamindb_setup as ln_setup
ln_setup.init(storage="./mydata")
Hide code cell content
from pathlib import Path
from lnschema_core.models import Storage

assert ln_setup.settings.instance.storage.type_is_cloud == False
assert ln_setup.settings.instance.owner == ln_setup.settings.user.handle
assert ln_setup.settings.instance.name == "mydata"
assert ln_setup.settings.storage.root.as_posix() == Path("mydata").resolve().as_posix()
storage_root = ln_setup.settings.storage.root
assert storage_root.exists()
assert ln_setup.settings.storage.id is not None
assert (
    ln_setup.settings.instance.db
    == f"sqlite:///{Path('./mydata').resolve().as_posix()}/{ln_setup.settings.instance._id.hex}.lndb"
)
assert ln_setup.settings.storage._instance_id == ln_setup.settings.instance._id
assert Storage.objects.get(instance_uid=ln_setup.settings.instance.uid).root == ln_setup.settings.storage.root_as_str
ln_setup.delete("mydata", force=True)
from lamindb_setup.core._settings_store import instance_settings_file

settings_file = instance_settings_file("mydata", "testuser1")
assert not storage_root.exists()
assert settings_file.exists() == False