Skip to content

Retire notebooks/ and the 'notebooks' pyproject extra #441

Description

@turbomam

Drop the notebooks/ directory and the notebooks pyproject extra from metpo.

Why

The notebooks pyproject extra pulls in jupyter, notebook, jupyterlab, matplotlib, numpy, python-levenshtein, chromadb, and openai. This is the main source of Dependabot churn. The 2026-05-18 batch alone was 13 high and 7 medium alerts, all from this dependency tree.

No code under metpo/ imports any Jupyter or IPython modules. Nothing outside the notebooks themselves needs the Jupyter stack.

What is in notebooks/

Two notebooks, plus an .ipynb_checkpoints/ autosave folder and an outdated README.md. The README lists four notebooks; two of those (ols_search_example.ipynb and explore_embeddings.ipynb) have already been deleted, so the README is wrong.

query_chromadb.ipynb (12 cells, ChromaDB-dependent)

Demonstration of semantic similarity search using ChromaDB. It opens the local ChromaDB at data/chromadb/chroma_ols20_nonols4/, embeds a user query using OpenAI's embedding API, and returns the nearest-neighbor ontology terms. The stored collection covers roughly 20 OLS ontologies plus the 4 BioPortal-only ones (D3O, OMP, MPO, n4l_merged). Purely a demo of the pipeline that #364 is in the process of replacing.

assess_ontology_by_api_search.ipynb (49 cells, not ChromaDB-dependent)

Baseline ontology-popularity analysis. It reads 50 METPO term labels (a 20% sample) from data/metpo_terms/metpo_sample_labels.tsv, calls BioPortal's REST search API for each label, and tallies which external ontologies return hits. The result answers "which ontologies most often match METPO labels?" and is useful input for #364. Does not use ChromaDB or any Jupyter-specific machinery beyond the notebook wrapper.

Proposed steps

  1. Delete query_chromadb.ipynb. Recoverable from git history if ever needed.
  2. Convert assess_ontology_by_api_search.ipynb into a Click command-line script under metpo/scripts/, per the metpo CLAUDE.md script standards. The logic is straightforward: read a TSV of labels, loop over them, call the BioPortal search API, aggregate hits per ontology, write output TSV.
  3. Delete the notebooks/ directory and the .ipynb_checkpoints/ autosave folder.
  4. Remove the notebooks extra from pyproject.toml; re-run uv lock to drop the Jupyter, Notebook, and JupyterLab dependency tree.
  5. Remove the install-notebooks target from the Makefile.

ChromaDB direction (context for #364)

The broader goal is to remove ChromaDB as a metpo dependency. The replacement plan tracked in #364 is a hybrid: OLS4's /api/v2/classes/llm_search endpoint for the roughly 270 OLS-hosted ontologies, and linkml-store with the LLMIndexer for the 4 BioPortal-only ontologies (D3O, OMP, MPO, n4l_merged). Any ChromaDB usage that survives the #364 cleanup must be clearly scoped to only the highest-value BioPortal-only ontologies. Broad ChromaDB indexing is not the long-term path.

Impact

Related

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions