Skip to content

Commit

Permalink
🚚 Deprecate the --schema argument of lamin init in favor of `--mo…
Browse files Browse the repository at this point in the history
…dules` (#185)
  • Loading branch information
falexwolf authored Jan 11, 2025
1 parent 28a34b1 commit 2a33236
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bionty/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Install and mount `bionty` in a new instance:
>>> pip install 'bionty'
>>> lamin init --storage <storage_name> --schema bionty
>>> lamin init --storage <storage_name> --modules bionty
Import the package:
Expand Down
4 changes: 2 additions & 2 deletions bionty/_bionty.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion bionty/core/_bionty.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions bionty/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand All @@ -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)

0 comments on commit 2a33236

Please sign in to comment.