From 5bed7c6490ab9a54013a603cf4161577c1b69f91 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 16:30:20 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.8.2 → v0.15.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.2...v0.15.7) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a832683..2917f7b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ exclude: '^docs/conf.py' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: check-added-large-files @@ -19,7 +19,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.2 + rev: v0.15.7 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] From 1c25650a3afba3b41398403c97a4173e98e84b28 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 16:31:43 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CHANGELOG.md | 4 ++-- docs/requirements.txt | 4 ++-- setup.py | 10 +++++----- src/orgdb/orgdb.py | 2 +- tests/conftest.py | 4 ++-- tests/test_orgdb.py | 16 ++++++++-------- tests/test_real.py | 2 +- tests/test_registry.py | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea495e0..1838022 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Version 0.0.1 +## Version 0.0.1 -- Initial implementation to access OrgDB objects. +- Initial implementation to access OrgDB objects. - This also fetches the annotation hub sqlite file and queries for available org sqlite files instead of a static registry used in the txdb package. diff --git a/docs/requirements.txt b/docs/requirements.txt index a1b9d2b..c20cf60 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,9 +1,9 @@ +furo +myst-nb # Requirements file for ReadTheDocs, check .readthedocs.yml. # To build the module reference correctly, make sure every external package # under `install_requires` in `setup.cfg` is also listed here! # sphinx_rtd_theme myst-parser[linkify] sphinx>=3.2.1 -myst-nb -furo sphinx-autodoc-typehints diff --git a/setup.py b/setup.py index 5876aab..82758ea 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ """ - Setup file for orgdb. - Use setup.cfg to configure your project. +Setup file for orgdb. +Use setup.cfg to configure your project. - This file was generated with PyScaffold 4.6. - PyScaffold helps you to put up the scaffold of your new Python project. - Learn more under: https://pyscaffold.org/ +This file was generated with PyScaffold 4.6. +PyScaffold helps you to put up the scaffold of your new Python project. +Learn more under: https://pyscaffold.org/ """ from setuptools import setup diff --git a/src/orgdb/orgdb.py b/src/orgdb/orgdb.py index fa42d55..d583c62 100644 --- a/src/orgdb/orgdb.py +++ b/src/orgdb/orgdb.py @@ -543,7 +543,7 @@ def genes(self) -> GenomicRanges: return GenomicRanges.empty() query = """ - SELECT + SELECT g.gene_id, c.seqname, c.start_location, diff --git a/tests/conftest.py b/tests/conftest.py index c2998c2..c31d312 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,7 @@ - https://docs.pytest.org/en/stable/writing_plugins.html """ -import sqlite3 +import sqlite3 from orgdb import OrgDb import pytest @@ -102,4 +102,4 @@ def mock_orgdb(mock_orgdb_path): """Return an open OrgDb instance using the mock database.""" db = OrgDb(mock_orgdb_path) yield db - db.close() \ No newline at end of file + db.close() diff --git a/tests/test_orgdb.py b/tests/test_orgdb.py index fe7ca4a..2610a29 100644 --- a/tests/test_orgdb.py +++ b/tests/test_orgdb.py @@ -41,19 +41,19 @@ def test_select_simple(mock_orgdb): def test_select_multikey(mock_orgdb): res = mock_orgdb.select(keys=["1", "10"], columns=["SYMBOL"], keytype="ENTREZID") assert len(res) == 2 - + symbols = res.get_column("SYMBOL") assert "A1BG" in symbols assert "NAT2" in symbols def test_select_go_expansion(mock_orgdb): res = mock_orgdb.select(keys="1", columns=["GO"], keytype="ENTREZID") - + col_names = list(res.column_names) assert "GO" in col_names assert "EVIDENCE" in col_names assert "ONTOLOGY" in col_names - + assert len(res) == 2 go_ids = res.get_column("GO") assert "GO:0000001" in go_ids @@ -66,12 +66,12 @@ def test_select_many_to_one(mock_orgdb): def test_mapIds(mock_orgdb): keys = ["1", "10", "100"] - + res = mock_orgdb.mapIds(keys, column="SYMBOL", keytype="ENTREZID") assert isinstance(res, dict) assert res["1"] == "A1BG" assert res["10"] == "NAT2" - + res_list = mock_orgdb.mapIds(["1"], column="GO", keytype="ENTREZID", multiVals="list") assert isinstance(res_list["1"], list) assert len(res_list["1"]) == 2 @@ -81,12 +81,12 @@ def test_genes_genomicranges(mock_orgdb): gr = mock_orgdb.genes() assert isinstance(gr, GenomicRanges) assert len(gr) == 2 - + names = list(gr.names) idx = names.index("1") assert str(gr.seqnames[idx]) == "chr19" assert gr.start[idx] == 58346806 assert gr.end[idx] == 58353492 - + assert "gene_id" in gr.mcols.column_names - assert gr.mcols.get_column("gene_id")[idx] == "1" \ No newline at end of file + assert gr.mcols.get_column("gene_id")[idx] == "1" diff --git a/tests/test_real.py b/tests/test_real.py index 089b069..9f0e603 100644 --- a/tests/test_real.py +++ b/tests/test_real.py @@ -21,6 +21,6 @@ def test_real_orgdb_workflow(tmp_path): "GO:0048699", "GO:0048143"], columns="SYMBOL") - + assert res.shape == (104, 4) orgdb.close() diff --git a/tests/test_registry.py b/tests/test_registry.py index 57ca98f..bc788d6 100644 --- a/tests/test_registry.py +++ b/tests/test_registry.py @@ -9,7 +9,7 @@ def registry(tmp_path): def test_registry_init(registry): assert isinstance(registry, OrgDbRegistry) assert "org.Hs.eg.db" in registry.list_orgdb() - + def test_get_record(registry): rec = registry.get_record("org.Hs.eg.db") assert rec.orgdb_id == "org.Hs.eg.db"