diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f91485..7bad9bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.15.6 + rev: v0.16.10 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/README.md b/README.md index 5f4a3eb..c2cdec0 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ The `list_datasets()` function will display all available datasets along with th ```python import scrnaseq + datasets = scrnaseq.list_datasets() print(datasets[["name", "version"]].head(3)) @@ -57,11 +58,8 @@ res = scrnaseq.search_datasets("pancreas") from gypsum_client import define_text_query res = scrnaseq.search_datasets( - define_text_query("GRCm38", field="genome") - & ( - define_text_query("neuro%", partial=True) - | define_text_query("pancrea%", partial=True) - ) + define_text_query("GRCm38", field="genome") + & (define_text_query("neuro%", partial=True) | define_text_query("pancrea%", partial=True)) ) print(res[["name", "version"]].head(3)) @@ -169,9 +167,9 @@ Want to contribute your own dataset to this package? It's easy! Just follow thes row_names = [f"GENE_{i}" for i in range(mat.shape[0])] col_names = list("ABCDEFGHIJ") sce = SingleCellExperiment( - assays={"counts": mat}, - row_data=BiocFrame(row_names=row_names), - column_data=BiocFrame(row_names=col_names), + assays={"counts": mat}, + row_data=BiocFrame(row_names=row_names), + column_data=BiocFrame(row_names=col_names), ) ``` @@ -187,13 +185,13 @@ Want to contribute your own dataset to this package? It's easy! Just follow thes ```python meta = { - "title": "My dataset forked from ziesel brain", - "description": "This is a copy of the ziesel", - "taxonomy_id": ["10090"], # NCBI ID - "genome": ["GRCh38"], # genome build - "sources": [{"provider": "GEO", "id": "GSE12345"}], - "maintainer_name": "Shizuka Mogami", - "maintainer_email": "mogami.shizuka@765pro.com", + "title": "My dataset forked from ziesel brain", + "description": "This is a copy of the ziesel", + "taxonomy_id": ["10090"], # NCBI ID + "genome": ["GRCh38"], # genome build + "sources": [{"provider": "GEO", "id": "GSE12345"}], + "maintainer_name": "Shizuka Mogami", + "maintainer_email": "mogami.shizuka@765pro.com", } ``` diff --git a/setup.py b/setup.py index 8279d2c..554cc9f 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ if __name__ == "__main__": try: setup(use_scm_version={"version_scheme": "no-guess-dev"}) - except: # noqa + except: print( "\n\nAn error occurred while building the project, " "please ensure you have the most updated version of setuptools, " diff --git a/src/scrnaseq/list_versions.py b/src/scrnaseq/list_versions.py index 0343aa9..60bd526 100644 --- a/src/scrnaseq/list_versions.py +++ b/src/scrnaseq/list_versions.py @@ -1,5 +1,3 @@ -from typing import List - import gypsum_client as gypc __author__ = "Jayaram Kancherla" @@ -7,7 +5,7 @@ __license__ = "MIT" -def list_versions(name: str) -> List[str]: +def list_versions(name: str) -> list[str]: """List all available versions for a dataset. Example: diff --git a/src/scrnaseq/polish_dataset.py b/src/scrnaseq/polish_dataset.py index 6778cc0..978083f 100644 --- a/src/scrnaseq/polish_dataset.py +++ b/src/scrnaseq/polish_dataset.py @@ -1,5 +1,3 @@ -from typing import Type - import numpy as np from singlecellexperiment import SingleCellExperiment from summarizedexperiment import SummarizedExperiment @@ -10,12 +8,12 @@ def polish_dataset( - x: Type[SummarizedExperiment], + x: type[SummarizedExperiment], reformat_assay_by_density: float = 0.3, attempt_integer_conversion: bool = True, remove_altexp_coldata: bool = True, forbid_nested_altexp: bool = True, -) -> Type[SummarizedExperiment]: +) -> type[SummarizedExperiment]: """Optimize dataset for saving. Prepare a @@ -68,7 +66,7 @@ def polish_dataset( def _polish_dataset( - x: Type[SummarizedExperiment], + x: type[SummarizedExperiment], reformat_assay_by_density: float, attempt_integer_conversion: bool, remove_altexp_coldata: bool, diff --git a/src/scrnaseq/search_datasets.py b/src/scrnaseq/search_datasets.py index b19570e..dc18ca0 100644 --- a/src/scrnaseq/search_datasets.py +++ b/src/scrnaseq/search_datasets.py @@ -1,6 +1,5 @@ import sqlite3 from functools import lru_cache -from typing import Union from biocframe import BiocFrame from gypsum_client import cache_directory, fetch_metadata_database @@ -18,7 +17,7 @@ @lru_cache def search_datasets( - query: Union[str, GypsumSearchClause], + query: str | GypsumSearchClause, cache_dir: str = cache_directory(), overwrite: bool = False, latest: bool = True,