From 2a33236cedca113f534b7f9ad9328538c903780a Mon Sep 17 00:00:00 2001 From: Alex Wolf Date: Sun, 12 Jan 2025 00:33:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Deprecate=20the=20`--schema`=20a?= =?UTF-8?q?rgument=20of=20`lamin=20init`=20in=20favor=20of=20`--modules`?= =?UTF-8?q?=20(#185)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bionty/__init__.py | 2 +- bionty/_bionty.py | 4 ++-- bionty/core/_bionty.py | 2 +- bionty/models.py | 4 ++-- noxfile.py | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bionty/__init__.py b/bionty/__init__.py index b2f0a60..9075d19 100644 --- a/bionty/__init__.py +++ b/bionty/__init__.py @@ -9,7 +9,7 @@ Install and mount `bionty` in a new instance: >>> pip install 'bionty' ->>> lamin init --storage --schema bionty +>>> lamin init --storage --modules bionty Import the package: diff --git a/bionty/_bionty.py b/bionty/_bionty.py index 19c0170..c4d17fd 100644 --- a/bionty/_bionty.py +++ b/bionty/_bionty.py @@ -77,10 +77,10 @@ def get_source_record( from .models import Source if public_ontology.__class__.__name__ == "StaticReference": - entity_name = registry.__get_name_with_schema__() + entity_name = registry.__get_name_with_module__() else: entity_name = ( - f"{registry.__get_schema_name__()}.{public_ontology.__class__.__name__}" + f"{registry.__get_module_name__()}.{public_ontology.__class__.__name__}" ) kwargs = { "entity": entity_name, diff --git a/bionty/core/_bionty.py b/bionty/core/_bionty.py index 9c561e0..8a84b53 100644 --- a/bionty/core/_bionty.py +++ b/bionty/core/_bionty.py @@ -99,7 +99,7 @@ def filter_bionty_df_columns( def _prepare_bionty_df(model: type[Record], bionty_df: pd.DataFrame): """Prepare the bionty DataFrame to match the model fields.""" - if model.__get_name_with_schema__() == "bionty.Gene": + if model.__get_name_with_module__() == "bionty.Gene": # groupby ensembl_gene_id and concat ncbi_gene_ids groupby_id_col = ( "ensembl_gene_id" if "ensembl_gene_id" in bionty_df else "stable_id" diff --git a/bionty/models.py b/bionty/models.py index 889e712..f279668 100644 --- a/bionty/models.py +++ b/bionty/models.py @@ -293,7 +293,7 @@ def add_source(cls, source: Source, currently_used=True) -> Source: import lamindb as ln unique_kwargs = { - "entity": cls.__get_name_with_schema__(), + "entity": cls.__get_name_with_module__(), "name": source.name, "version": source.version, "organism": source.organism, @@ -392,7 +392,7 @@ def public( except (AttributeError, ValueError): if source is None: kwargs = { - "entity": cls.__get_name_with_schema__(), + "entity": cls.__get_name_with_module__(), "currently_used": True, } if organism is not None: diff --git a/noxfile.py b/noxfile.py index 6a14f4d..a40999e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -16,7 +16,7 @@ def lint(session: nox.Session) -> None: @nox.session @nox.parametrize("group", ["bionty-unit", "bionty-docs"]) def build(session: nox.Session, group: str): - branch = "migrate" if IS_PR else "main" # point back to "release" + branch = "main" if IS_PR else "main" # point back to "release" install_lamindb(session, branch=branch) session.run(*"uv pip install --system -e .[dev]".split()) @@ -25,5 +25,5 @@ def build(session: nox.Session, group: str): session.run(*f"pytest {coverage_args} ./tests".split()) elif group == "bionty-docs": session.run(*f"pytest -s {coverage_args} ./docs/guide".split()) - run(session, "lamin init --storage ./docsbuild --schema bionty") + run(session, "lamin init --storage ./docsbuild --modules bionty") build_docs(session, strict=False)