diff --git a/docs/hub-cloud/01-init-local-instance.ipynb b/docs/hub-cloud/01-init-local-instance.ipynb index 7d995b60..d06e4ccc 100644 --- a/docs/hub-cloud/01-init-local-instance.ipynb +++ b/docs/hub-cloud/01-init-local-instance.ipynb @@ -48,7 +48,7 @@ "outputs": [], "source": [ "from pathlib import Path\n", - "from lnschema_core.models import Storage\n", + "from lamindb.models import Storage\n", "\n", "assert ln_setup.settings.instance.storage.type_is_cloud == False\n", "assert ln_setup.settings.instance.owner == ln_setup.settings.user.handle\n", diff --git a/docs/hub-cloud/03-add-managed-storage.ipynb b/docs/hub-cloud/03-add-managed-storage.ipynb index 863895ba..4d10929e 100644 --- a/docs/hub-cloud/03-add-managed-storage.ipynb +++ b/docs/hub-cloud/03-add-managed-storage.ipynb @@ -326,7 +326,7 @@ "from laminhub_rest.core.instance.collaborator import InstanceCollaboratorHandler\n", "from laminhub_rest.core.account.user import UserAccountHandler\n", "from lamindb_setup.core._hub_client import connect_hub_with_auth\n", - "from lnschema_core.models import User\n", + "from lamindb.models import User\n", "\n", "admin_hub = connect_hub_with_auth()\n", "testuser2 = UserAccountHandler(admin_hub).get_by_handle(\"testuser2\")\n", diff --git a/docs/hub-cloud/08-test-multi-session.ipynb b/docs/hub-cloud/08-test-multi-session.ipynb index 9801bdc7..bf98c7b7 100644 --- a/docs/hub-cloud/08-test-multi-session.ipynb +++ b/docs/hub-cloud/08-test-multi-session.ipynb @@ -52,7 +52,7 @@ "metadata": {}, "outputs": [], "source": [ - "from lnschema_core.models import User" + "from lamindb.models import User" ] }, { diff --git a/lamindb_setup/_connect_instance.py b/lamindb_setup/_connect_instance.py index 2e0084a2..5163052a 100644 --- a/lamindb_setup/_connect_instance.py +++ b/lamindb_setup/_connect_instance.py @@ -308,13 +308,11 @@ def connect(slug: str, **kwargs) -> str | tuple | None: settings._instance_settings = None raise e # migrate away from lnschema-core - no_lnschema_core_file = ( - settings_dir / f"no_lnschema_core-{isettings.slug.replace('/', '')}" - ) - if not no_lnschema_core_file.exists(): - migrate_lnschema_core( - isettings, no_lnschema_core_file, write_file=_write_settings - ) + (settings_dir / f"no_lnschema_core-{isettings.slug.replace('/', '')}") + # if not no_lnschema_core_file.exists(): + # migrate_lnschema_core( + # isettings, no_lnschema_core_file, write_file=_write_settings + # ) return None diff --git a/lamindb_setup/_exportdb.py b/lamindb_setup/_exportdb.py index aaf41182..39f2c3fd 100644 --- a/lamindb_setup/_exportdb.py +++ b/lamindb_setup/_exportdb.py @@ -4,7 +4,7 @@ from pathlib import Path MODELS = { - "core": { + "lamindb": { "Collection": False, "Artifact": False, "Transform": False, diff --git a/lamindb_setup/_init_instance.py b/lamindb_setup/_init_instance.py index 1eda955b..577e0684 100644 --- a/lamindb_setup/_init_instance.py +++ b/lamindb_setup/_init_instance.py @@ -42,8 +42,8 @@ def get_schema_module_name(schema_name, raise_import_error: bool = True) -> str def register_storage_in_instance(ssettings: StorageSettings): - from lnschema_core.models import Storage - from lnschema_core.users import current_user_id + from lamindb.models import Storage + from lamindb.users import current_user_id from .core.hashing import hash_and_encode_as_b62 @@ -71,7 +71,7 @@ def register_storage_in_instance(ssettings: StorageSettings): def register_user(usettings): - from lnschema_core.models import User + from lamindb.models import User try: # need to have try except because of integer primary key migration @@ -100,7 +100,7 @@ def register_user_and_storage_in_instance(isettings: InstanceSettings, usettings def reload_schema_modules(isettings: InstanceSettings, include_core: bool = True): - schema_names = ["core"] if include_core else [] + schema_names = ["lamindb"] if include_core else [] # schema_names += list(isettings.schema) schema_module_names = [get_schema_module_name(n) for n in schema_names] diff --git a/lamindb_setup/_schema_metadata.py b/lamindb_setup/_schema_metadata.py index 039ba1cf..8857711a 100644 --- a/lamindb_setup/_schema_metadata.py +++ b/lamindb_setup/_schema_metadata.py @@ -232,7 +232,7 @@ def _get_related_fields_metadata(self, model, fields: list[ForeignObjectRel]): return related_fields def _get_field_metadata(self, model, field: Field): - from lnschema_core.models import LinkORM + from lamindb.models import LinkORM internal_type = field.get_internal_type() model_name = field.model._meta.model_name @@ -288,7 +288,7 @@ def _get_field_metadata(self, model, field: Field): @staticmethod def _get_through_many_to_many(field_or_rel: ManyToManyField | ManyToManyRel): - from lnschema_core.models import Registry + from lamindb.models import Registry if isinstance(field_or_rel, ManyToManyField): if field_or_rel.model != Registry: @@ -360,7 +360,7 @@ def _get_relation_type(model, field: Field): class _SchemaHandler: def __init__(self) -> None: - self.included_modules = ["core"] + list(settings.instance.schema) + self.included_modules = ["lamindb"] + list(settings.instance.schema) self.modules = self._get_modules_metadata() def to_dict(self, include_django_objects: bool = True): @@ -376,7 +376,7 @@ def to_json(self): return self.to_dict(include_django_objects=False) def _get_modules_metadata(self): - from lnschema_core.models import Record, Registry + from lamindb.models import Record, Registry all_models = { module_name: { diff --git a/lamindb_setup/core/_settings_instance.py b/lamindb_setup/core/_settings_instance.py index ed9b352a..97410673 100644 --- a/lamindb_setup/core/_settings_instance.py +++ b/lamindb_setup/core/_settings_instance.py @@ -121,7 +121,7 @@ def name(self) -> str: def _search_local_root( self, local_root: str | None = None, mute_warning: bool = False ) -> StorageSettings | None: - from lnschema_core.models import Storage + from lamindb.models import Storage if local_root is not None: local_records = Storage.objects.filter(root=local_root) diff --git a/lamindb_setup/core/_settings_storage.py b/lamindb_setup/core/_settings_storage.py index a68ab917..d0faef2a 100644 --- a/lamindb_setup/core/_settings_storage.py +++ b/lamindb_setup/core/_settings_storage.py @@ -230,7 +230,7 @@ def record(self) -> Any: """Storage record in the current instance.""" if self._record is None: # dynamic import because of import order - from lnschema_core.models import Storage + from lamindb.models import Storage from ._settings import settings diff --git a/lamindb_setup/core/_settings_user.py b/lamindb_setup/core/_settings_user.py index f55b73d0..195eebcb 100644 --- a/lamindb_setup/core/_settings_user.py +++ b/lamindb_setup/core/_settings_user.py @@ -48,7 +48,7 @@ def __repr__(self) -> str: @property def id(self): """Integer id valid in current intance.""" - from lnschema_core.users import current_user_id + from lamindb.users import current_user_id # there is no cache needed here because current_user_id() # has its own cache diff --git a/lamindb_setup/core/django.py b/lamindb_setup/core/django.py index 517c4834..5a13639f 100644 --- a/lamindb_setup/core/django.py +++ b/lamindb_setup/core/django.py @@ -54,7 +54,7 @@ def setup_django( } from .._init_instance import get_schema_module_name - schema_names = ["core"] + list(isettings.schema) + schema_names = ["lamindb"] + list(isettings.schema) raise_import_error = True if init else False installed_apps = [ package_name