Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Enable to easily join features onto artifacts via Artifact.df() #2238

Merged
merged 10 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ lamin-tutorial/
mytest/
rds/
mydb/
docs/test-registries/
docs/test-annotate-flexible/
docs/lamindb.*
lamin_sphinx
Expand Down
2 changes: 1 addition & 1 deletion docs/arrays.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Query arrays"
"# Slice arrays"
]
},
{
Expand Down
89 changes: 35 additions & 54 deletions docs/faq/search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,19 @@
"# How does search work?"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "955b6253",
"metadata": {},
"outputs": [],
"source": [
"from laminci.db import setup_local_test_postgres"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7f312433",
"metadata": {},
"outputs": [],
"source": [
"pgurl = setup_local_test_postgres()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "286aeebc",
"metadata": {},
"metadata": {
"tags": [
"hide-cell"
]
},
"outputs": [],
"source": [
"from laminci.db import setup_local_test_postgres\n",
"pgurl = setup_local_test_postgres()\n",
"!lamin init --name benchmark_search --db {pgurl} --schema bionty --storage ./benchmark_search"
]
},
Expand All @@ -43,7 +29,7 @@
"id": "40234d47",
"metadata": {},
"source": [
"Here we show how to perform text search on `Record` and evaluate some search queries."
"Here we show how to perform text search on `Record` and evaluate some search queries for the {class}`bionty.CellType` ontology."
]
},
{
Expand All @@ -54,36 +40,32 @@
"outputs": [],
"source": [
"import lamindb as ln\n",
"import bionty as bt"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "83a46a9a",
"metadata": {},
"outputs": [],
"source": [
"import bionty as bt\n",
"\n",
"SEARCH_QUERIES_EXACT = (\"t cell\", \"stem cell\", \"b cell\", \"regulatory B cell\", \"Be2 cell\", \"adipocyte\")\n",
"SEARCH_QUERIES_CONTAINS = (\"t cel\", \"t-cel\", \"neural\", \"kidney\", \"kidne\")\n",
"TOP_N = 20\n",
"\n",
"bt.CellType.import_source()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7991a73f",
"cell_type": "markdown",
"id": "799b528e",
"metadata": {},
"outputs": [],
"source": [
"SEARCH_QUERIES_EXACT = (\"t cell\", \"stem cell\", \"b cell\", \"regulatory B cell\", \"Be2 cell\", \"adipocyte\")\n",
"SEARCH_QUERIES_CONTAINS = (\"t cel\", \"t-cel\", \"neural\", \"kidney\", \"kidne\")\n",
"TOP_N = 20"
"## Search the registry"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "682fcd2f",
"metadata": {},
"metadata": {
"tags": [
"hide-output"
]
},
"outputs": [],
"source": [
"for query in SEARCH_QUERIES_EXACT:\n",
Expand All @@ -98,7 +80,11 @@
"cell_type": "code",
"execution_count": null,
"id": "ee059b0d",
"metadata": {},
"metadata": {
"tags": [
"hide-output"
]
},
"outputs": [],
"source": [
"for query in SEARCH_QUERIES_CONTAINS:\n",
Expand All @@ -116,29 +102,24 @@
"id": "f4e41c9b",
"metadata": {},
"source": [
"Also check `bionty` public ontologies search:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "eb5aa05a",
"metadata": {},
"outputs": [],
"source": [
"ct_public = bt.CellType.public()"
"## Search the public ontology"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d42c3594",
"metadata": {},
"metadata": {
"tags": [
"hide-output"
]
},
"outputs": [],
"source": [
"ct_public = bt.CellType.public()\n",
"\n",
"df = ct_public.search(\"b cell\", limit=20)\n",
"assert df.iloc[0][\"name\"] == \"B cell\"\n",
"\n",
"df"
]
},
Expand Down
Loading