From ce3310dd7f99e0d0345076f1624959257299df68 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:23:08 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.4 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.4...v0.9.1) - [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...v1.14.1) --- .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 f7bddcc..b5b45da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: check-toml - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.7.4' + rev: 'v0.9.1' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -25,7 +25,7 @@ repos: types_or: [python, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.1 hooks: - id: mypy entry: python3 -m mypy --config-file pyproject.toml From fdd5dbcdfeff949bbbb2dad3f2dc197d66b99ba8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:23:39 +0000 Subject: [PATCH 2/3] [pre-commit.ci] Add auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cycquery/ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cycquery/ops.py b/cycquery/ops.py index 48d04f0..cfa73a8 100644 --- a/cycquery/ops.py +++ b/cycquery/ops.py @@ -161,7 +161,7 @@ def __setattr__(self, name: str, value: "QueryOp") -> None: elif ops is not None and name in ops: if value is not None: raise TypeError( - "Cannot assign '{}' as child op '{}' " "(QueryOp or None expected)", + "Cannot assign '{}' as child op '{}' (QueryOp or None expected)", ) ops[name] = value else: From 0b93785f329d8a5616f7ed3a350d3babe4859d7d Mon Sep 17 00:00:00 2001 From: Amrit Krishnan Date: Fri, 17 Jan 2025 10:28:12 -0500 Subject: [PATCH 3/3] Fixes to lint --- cycquery/__init__.py | 9 ++++++ cycquery/base.py | 2 +- cycquery/eicu.py | 1 - cycquery/gemini.py | 1 - cycquery/interface.py | 1 - cycquery/mimiciii.py | 1 - cycquery/mimiciv.py | 1 - cycquery/omop.py | 2 +- cycquery/ops.py | 48 ++++++++++++++++++++++++++-- cycquery/orm.py | 4 +-- cycquery/post_process/gemini.py | 1 - cycquery/post_process/mimiciv.py | 1 - cycquery/post_process/util.py | 1 - cycquery/util.py | 1 - cycquery/utils/file.py | 1 - cycquery/utils/log.py | 1 - cycquery/utils/profile.py | 3 +- docs/source/conf.py | 1 - docs/source/tutorials/eicu.ipynb | 1 - docs/source/tutorials/gemini.ipynb | 1 - docs/source/tutorials/mimiciii.ipynb | 1 - docs/source/tutorials/mimiciv.ipynb | 1 - docs/source/tutorials/omop.ipynb | 1 - pyproject.toml | 16 +++++----- setup.py | 1 - tests/cycquery/test_ops.py | 1 - 26 files changed, 67 insertions(+), 36 deletions(-) diff --git a/cycquery/__init__.py b/cycquery/__init__.py index d9de579..18a91e7 100644 --- a/cycquery/__init__.py +++ b/cycquery/__init__.py @@ -6,3 +6,12 @@ from cycquery.mimiciii import MIMICIIIQuerier from cycquery.mimiciv import MIMICIVQuerier from cycquery.omop import OMOPQuerier + +__all__ = [ + "DatasetQuerier", + "EICUQuerier", + "GEMINIQuerier", + "MIMICIIIQuerier", + "MIMICIVQuerier", + "OMOPQuerier", +] diff --git a/cycquery/base.py b/cycquery/base.py index 90b5358..c5caafe 100644 --- a/cycquery/base.py +++ b/cycquery/base.py @@ -17,7 +17,6 @@ ) from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) @@ -113,6 +112,7 @@ def __init__( database: str = "", schemas: Optional[List[str]] = None, ) -> None: + """Initialize the querier.""" config = DatasetQuerierConfig( database=database, user=user, diff --git a/cycquery/eicu.py b/cycquery/eicu.py index 591a7d5..7c1baf6 100644 --- a/cycquery/eicu.py +++ b/cycquery/eicu.py @@ -9,7 +9,6 @@ from cycquery.base import DatasetQuerier from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) diff --git a/cycquery/gemini.py b/cycquery/gemini.py index 5cb7617..0463a3e 100644 --- a/cycquery/gemini.py +++ b/cycquery/gemini.py @@ -10,7 +10,6 @@ from cycquery.interface import QueryInterface from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) diff --git a/cycquery/interface.py b/cycquery/interface.py index 2e7e05c..4b38127 100644 --- a/cycquery/interface.py +++ b/cycquery/interface.py @@ -13,7 +13,6 @@ from cycquery.utils.file import save_dataframe from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) diff --git a/cycquery/mimiciii.py b/cycquery/mimiciii.py index c6f0654..f9d7b9c 100644 --- a/cycquery/mimiciii.py +++ b/cycquery/mimiciii.py @@ -11,7 +11,6 @@ from cycquery.interface import QueryInterface from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) diff --git a/cycquery/mimiciv.py b/cycquery/mimiciv.py index 014274b..1a19e6b 100644 --- a/cycquery/mimiciv.py +++ b/cycquery/mimiciv.py @@ -14,7 +14,6 @@ from cycquery.util import get_column from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) diff --git a/cycquery/omop.py b/cycquery/omop.py index 9f3c1bd..430bd0c 100644 --- a/cycquery/omop.py +++ b/cycquery/omop.py @@ -11,7 +11,6 @@ from cycquery.utils.common import to_list from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) @@ -66,6 +65,7 @@ def __init__( port: int = 5432, schema_name: str = "omop", ) -> None: + """Initialize OMOP querier.""" super().__init__( database=database, user=user, diff --git a/cycquery/ops.py b/cycquery/ops.py index cfa73a8..694b47c 100644 --- a/cycquery/ops.py +++ b/cycquery/ops.py @@ -46,7 +46,6 @@ from cycquery.utils.common import to_datetime_format, to_list, to_list_optional from cycquery.utils.log import setup_logging - LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) @@ -86,6 +85,7 @@ class QueryOp: _ops: typing.Dict[str, "QueryOp"] def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + """Initialize the class.""" super().__setattr__("_ops", OrderedDict()) @abstractmethod @@ -623,6 +623,8 @@ def _process_checks( Table on which to perform the operation. cols Columns to check. + cols_not_in + Columns that should not be in the table. timestamp_cols Timestamp columns to check. @@ -673,6 +675,7 @@ def __init__( fill_values: typing.Union[typing.Any, typing.List[typing.Any]], new_col_names: typing.Optional[typing.Union[str, typing.List[str]]] = None, ) -> None: + """Initialize the operation.""" super().__init__() self.cols = cols self.fill_values = fill_values @@ -735,6 +738,7 @@ class Drop(QueryOp): """ def __init__(self, cols: typing.Union[str, typing.List[str]]) -> None: + """Initialize the operation.""" super().__init__() self.cols = cols @@ -774,6 +778,7 @@ class Rename(QueryOp): """ def __init__(self, rename_map: typing.Dict[str, str], check_exists: bool = True): + """Initialize the operation.""" super().__init__() self.rename_map = rename_map self.check_exists = check_exists @@ -826,6 +831,7 @@ def __init__( stop_index: int, new_col_label: typing.Optional[str] = None, ): + """Initialize the operation.""" super().__init__() self.col = col self.start_index = start_index @@ -875,6 +881,7 @@ class Reorder(QueryOp): """ def __init__(self, cols: typing.List[str]): + """Initialize the operation.""" super().__init__() self.cols = cols @@ -914,6 +921,7 @@ class ReorderAfter(QueryOp): """ def __init__(self, cols: typing.Union[str, typing.List[str]], after: str): + """Initialize the operation.""" super().__init__() self.cols = cols self.after = after @@ -958,6 +966,7 @@ class Keep(QueryOp): """ def __init__(self, cols: typing.Union[str, typing.List[str]]): + """Initialize the operation.""" super().__init__() self.cols = cols @@ -1005,6 +1014,7 @@ def __init__( cols: typing.Union[str, typing.List[str]], new_col_labels: typing.Optional[typing.Union[str, typing.List[str]]] = None, ): + """Initialize the operation.""" super().__init__() self.cols = cols self.new_col_labels = new_col_labels @@ -1045,6 +1055,7 @@ class Literal(QueryOp): """ def __init__(self, value: typing.Any, col: str): + """Initialize the operation.""" super().__init__() self.value = value self.col = col @@ -1088,6 +1099,7 @@ class ExtractTimestampComponent(QueryOp): """ def __init__(self, timestamp_col: str, extract_str: str, label: str): + """Initialize the operation.""" super().__init__() self.timestamp_col = timestamp_col self.extract_str = extract_str @@ -1151,6 +1163,7 @@ def __init__( add: typing.Union[int, float, typing.List[int], typing.List[float]], new_col_labels: typing.Optional[typing.Union[str, typing.List[str]]] = None, ): + """Initialize the operation.""" super().__init__() self.add_to = add_to self.add = add @@ -1227,6 +1240,7 @@ def __init__( delta: timedelta, new_col_labels: typing.Optional[typing.Union[str, typing.List[str]]] = None, ): + """Initialize the operation.""" super().__init__() self.add_to = add_to self.delta = delta @@ -1297,6 +1311,7 @@ def __init__( negative: typing.Optional[bool] = False, new_col_labels: typing.Optional[typing.Union[str, typing.List[str]]] = None, ): + """Initialize the operation.""" super().__init__() self.add_to = add_to self.col = col @@ -1378,6 +1393,7 @@ def __init__( new_col_labels: typing.Optional[typing.Union[str, typing.List[str]]] = None, **delta_kwargs: typing.Any, ) -> None: + """Initialize the operation.""" super().__init__() self.add_to = add_to self.negative = negative @@ -1444,6 +1460,7 @@ class Cast(QueryOp): """ def __init__(self, cols: typing.Union[str, typing.List[str]], type_: str): + """Initialize the operation.""" super().__init__() self.cols = cols self.type_ = type_ @@ -1510,6 +1527,7 @@ def __init__( union_table: TableTypes, union_all: typing.Optional[bool] = False, ): + """Initialize the operation.""" super().__init__() self.union_table = union_table self.union_all = union_all @@ -1592,6 +1610,7 @@ def __init__( join_table_cols: typing.Optional[typing.Union[str, typing.List[str]]] = None, isouter: typing.Optional[bool] = False, ) -> None: + """Initialize the operation.""" super().__init__() if on is not None and cond is not None: raise ValueError("Cannot specify both the 'on' and 'cond' arguments.") @@ -1718,6 +1737,7 @@ def __init__( binarize_col: typing.Optional[str] = None, **cond_kwargs: typing.Any, ) -> None: + """Initialize the operation.""" super().__init__() self.col = col self.value = value @@ -1800,6 +1820,7 @@ def __init__( binarize_col: typing.Optional[str] = None, **cond_kwargs: typing.Any, ) -> None: + """Initialize the operation.""" super().__init__() self.col = col self.value = value @@ -1884,6 +1905,7 @@ def __init__( binarize_col: typing.Optional[str] = None, **cond_kwargs: typing.Any, ) -> None: + """Initialize the operation.""" super().__init__() self.col = col self.value = value @@ -1962,6 +1984,7 @@ def __init__( not_: bool = False, binarize_col: typing.Optional[str] = None, ): + """Initialize the operation.""" super().__init__() self.col = col self.regex = regex @@ -2034,6 +2057,7 @@ def __init__( binarize_col: typing.Optional[str] = None, **cond_kwargs: typing.Any, ) -> None: + """Initialize the operation.""" super().__init__() self.col = col self.values = values @@ -2121,6 +2145,7 @@ def __init__( binarize_col: typing.Optional[str] = None, **cond_kwargs: typing.Any, ) -> None: + """Initialize the operation.""" super().__init__() self.col = col self.substrings = to_list(substrings) @@ -2199,6 +2224,7 @@ def __init__( binarize_col: typing.Optional[str] = None, **cond_kwargs: typing.Any, ) -> None: + """Initialize the operation.""" super().__init__() self.col = col self.string = string @@ -2278,6 +2304,7 @@ def __init__( binarize_col: typing.Optional[str] = None, **cond_kwargs: typing.Any, ) -> None: + """Initialize the operation.""" super().__init__() self.col = col self.string = string @@ -2355,6 +2382,7 @@ def __init__( not_: bool = False, binarize_col: typing.Optional[str] = None, ): + """Initialize the operation.""" super().__init__() self.timestamp_col = timestamp_col self.years = years @@ -2432,6 +2460,7 @@ def __init__( not_: bool = False, binarize_col: typing.Optional[str] = None, ): + """Initialize the operation.""" super().__init__() self.timestamp_col = timestamp_col self.months = months @@ -2509,6 +2538,7 @@ def __init__( not_: bool = False, binarize_col: typing.Optional[str] = None, ): + """Initialize the operation.""" super().__init__() self.timestamp_col = timestamp_col self.timestamp = timestamp @@ -2583,6 +2613,7 @@ def __init__( not_: bool = False, binarize_col: typing.Optional[str] = None, ): + """Initialize the operation.""" super().__init__() self.timestamp_col = timestamp_col self.timestamp = timestamp @@ -2657,6 +2688,7 @@ def __init__( not_: bool = False, binarize_col: typing.Optional[str] = None, ): + """Initialize the operation.""" super().__init__() self.col = col self.pattern = pattern @@ -2714,6 +2746,7 @@ class Or(QueryOp): """ def __init__(self, *cond_ops: typing.Union[QueryOp, typing.List[QueryOp]]): + """Initialize the operation.""" super().__init__() self.cond_ops = cond_ops @@ -2766,6 +2799,7 @@ class And(QueryOp): """ def __init__(self, *cond_ops: typing.Union[QueryOp, typing.List[QueryOp]]): + """Initialize the operation.""" super().__init__() self.cond_ops = cond_ops @@ -2817,6 +2851,7 @@ class Limit(QueryOp): """ def __init__(self, number: int): + """Initialize the operation.""" super().__init__() self.number = number @@ -2844,11 +2879,11 @@ class RandomizeOrder(QueryOp): Useful when the data is ordered, so certain rows cannot be seen or analyzed when limited. - Examples + Examples: -------- >>> RandomizeOrder()(table) - Warnings + Warnings: -------- Becomes quite slow on large tables. @@ -2888,6 +2923,7 @@ class DropNulls(QueryOp): """ def __init__(self, cols: typing.Union[str, typing.List[str]]): + """Initialize the operation.""" super().__init__() self.cols = cols @@ -2928,6 +2964,7 @@ class DropEmpty(QueryOp): """ def __init__(self, cols: typing.Union[str, typing.List[str]]): + """Initialize the operation.""" super().__init__() self.cols = cols @@ -2997,6 +3034,7 @@ def __init__( ], new_cols: typing.Optional[typing.Union[str, typing.List[str]]] = None, ): + """Initialize the operation.""" super().__init__() self.cols = cols self.funcs = funcs @@ -3062,6 +3100,7 @@ def __init__( cols: typing.Union[str, typing.List[str]], ascending: typing.Optional[typing.Union[bool, typing.List[bool]]] = None, ): + """Initialize the operation.""" super().__init__() self.cols = cols self.ascending = ascending @@ -3134,6 +3173,7 @@ def __init__( ], aggseps: typing.Optional[typing.Dict[str, str]] = None, ): + """Initialize the operation.""" super().__init__() self.groupby_cols = groupby_cols self.aggfuncs = aggfuncs @@ -3236,6 +3276,7 @@ class Distinct(QueryOp): """ def __init__(self, cols: typing.Union[str, typing.List[str]]): + """Initialize the operation.""" super().__init__() self.cols = cols @@ -3274,6 +3315,7 @@ class Count(QueryOp): """ def __init__(self, col: str): + """Initialize the count operation.""" super().__init__() self.col = col diff --git a/cycquery/orm.py b/cycquery/orm.py index f74b061..e5233b6 100644 --- a/cycquery/orm.py +++ b/cycquery/orm.py @@ -30,7 +30,6 @@ from cycquery.utils.log import setup_logging from cycquery.utils.profile import time_function - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) @@ -47,8 +46,7 @@ def _get_db_url( port: Optional[int] = None, database: str = "", ) -> str: - """ - Generate a database connection URL. + """Generate a database connection URL. This function constructs a URL for database connection, which is compatible with various database management systems (DBMS), including support for SQLite diff --git a/cycquery/post_process/gemini.py b/cycquery/post_process/gemini.py index 89cb416..6f87639 100644 --- a/cycquery/post_process/gemini.py +++ b/cycquery/post_process/gemini.py @@ -4,7 +4,6 @@ from cycquery.post_process.util import process_care_unit_changepoints - CARE_UNIT_HIERARCHY = [ "ER", "Emergency", diff --git a/cycquery/post_process/mimiciv.py b/cycquery/post_process/mimiciv.py index b0f7d8c..eefc267 100644 --- a/cycquery/post_process/mimiciv.py +++ b/cycquery/post_process/mimiciv.py @@ -5,7 +5,6 @@ from cycquery.post_process.util import process_care_unit_changepoints from cycquery.utils.profile import time_function - CARE_UNIT = "care_unit" ER = "ER" ICU = "ICU" diff --git a/cycquery/post_process/util.py b/cycquery/post_process/util.py index 824ed01..4c85835 100644 --- a/cycquery/post_process/util.py +++ b/cycquery/post_process/util.py @@ -5,7 +5,6 @@ import pandas as pd from pandas import Timestamp - CARE_UNIT = "care_unit" diff --git a/cycquery/util.py b/cycquery/util.py index a37d5f5..7ed423e 100644 --- a/cycquery/util.py +++ b/cycquery/util.py @@ -16,7 +16,6 @@ from cycquery.utils.common import to_list, to_list_optional from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) diff --git a/cycquery/utils/file.py b/cycquery/utils/file.py index cabd6fb..ec5e6a2 100644 --- a/cycquery/utils/file.py +++ b/cycquery/utils/file.py @@ -10,7 +10,6 @@ from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) diff --git a/cycquery/utils/log.py b/cycquery/utils/log.py index c83e2e8..d500070 100644 --- a/cycquery/utils/log.py +++ b/cycquery/utils/log.py @@ -3,7 +3,6 @@ import logging from typing import Optional, Union - LOG_FORMAT = "%(asctime)-15s %(levelname)-5s %(name)-15s - %(message)s" # https://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output diff --git a/cycquery/utils/profile.py b/cycquery/utils/profile.py index 089d2a3..c7233a5 100644 --- a/cycquery/utils/profile.py +++ b/cycquery/utils/profile.py @@ -1,3 +1,5 @@ +# noqa: A005 + """Useful functions for timing, profiling.""" import logging @@ -6,7 +8,6 @@ from cycquery.utils.log import setup_logging - # Logging. LOGGER = logging.getLogger(__name__) setup_logging(print_level="INFO", logger=LOGGER) diff --git a/docs/source/conf.py b/docs/source/conf.py index 1b28c8a..9672e57 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,7 +16,6 @@ import sys from typing import Any, Dict - sys.path.insert(0, os.path.abspath("../../cycquery")) diff --git a/docs/source/tutorials/eicu.ipynb b/docs/source/tutorials/eicu.ipynb index fd52836..535fd5d 100644 --- a/docs/source/tutorials/eicu.ipynb +++ b/docs/source/tutorials/eicu.ipynb @@ -43,7 +43,6 @@ "import cycquery.ops as qo\n", "from cycquery import EICUQuerier\n", "\n", - "\n", "querier = EICUQuerier(\n", " dbms=\"postgresql\",\n", " port=5432,\n", diff --git a/docs/source/tutorials/gemini.ipynb b/docs/source/tutorials/gemini.ipynb index 759a3fc..45ca4b9 100644 --- a/docs/source/tutorials/gemini.ipynb +++ b/docs/source/tutorials/gemini.ipynb @@ -87,7 +87,6 @@ "import cycquery.ops as qo\n", "from cycquery import GEMINIQuerier\n", "\n", - "\n", "querier = GEMINIQuerier(\n", " host=\"db.gemini-hpc.ca\",\n", " database=\"delirium_v4_0_1\",\n", diff --git a/docs/source/tutorials/mimiciii.ipynb b/docs/source/tutorials/mimiciii.ipynb index 1f10751..3216374 100644 --- a/docs/source/tutorials/mimiciii.ipynb +++ b/docs/source/tutorials/mimiciii.ipynb @@ -43,7 +43,6 @@ "import cycquery.ops as qo\n", "from cycquery import MIMICIIIQuerier\n", "\n", - "\n", "querier = MIMICIIIQuerier(\n", " dbms=\"postgresql\",\n", " port=5432,\n", diff --git a/docs/source/tutorials/mimiciv.ipynb b/docs/source/tutorials/mimiciv.ipynb index 7b27081..ca69e35 100644 --- a/docs/source/tutorials/mimiciv.ipynb +++ b/docs/source/tutorials/mimiciv.ipynb @@ -43,7 +43,6 @@ "import cycquery.ops as qo\n", "from cycquery import MIMICIVQuerier\n", "\n", - "\n", "querier = MIMICIVQuerier(\n", " dbms=\"postgresql\",\n", " port=5432,\n", diff --git a/docs/source/tutorials/omop.ipynb b/docs/source/tutorials/omop.ipynb index a651f18..f0b19b2 100644 --- a/docs/source/tutorials/omop.ipynb +++ b/docs/source/tutorials/omop.ipynb @@ -53,7 +53,6 @@ "import cycquery.ops as qo\n", "from cycquery import OMOPQuerier\n", "\n", - "\n", "querier = OMOPQuerier(\n", " dbms=\"postgresql\",\n", " port=5432,\n", diff --git a/pyproject.toml b/pyproject.toml index 09b48f0..2922a27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,7 +75,7 @@ plugins = ["sqlalchemy.ext.mypy.plugin"] [tool.ruff] include = ["*.py", "pyproject.toml", "*.ipynb"] -select = [ +lint.select = [ "A", # flake8-builtins "B", # flake8-bugbear "COM", # flake8-commas @@ -94,9 +94,9 @@ select = [ "ERA", # eradicate "PL", # pylint ] -fixable = ["A", "B", "COM", "C4", "RET", "SIM", "ICN", "Q", "RSE", "D", "E", "F", "I", "W", "N", "ERA", "PL"] +lint.fixable = ["A", "B", "COM", "C4", "RET", "SIM", "ICN", "Q", "RSE", "D", "E", "F", "I", "W", "N", "ERA", "PL"] line-length = 88 -ignore = [ +lint.ignore = [ "B905", # `zip()` without an explicit `strict=` parameter "E501", # line too long "D203", # 1 blank line required before class docstring @@ -106,19 +106,19 @@ ignore = [ ] # Ignore import violations in all `__init__.py` files. -[tool.ruff.per-file-ignores] +[lint.per-file-ignores] "__init__.py" = ["E402", "F401", "F403", "F811"] -[tool.ruff.pep8-naming] +[lint.pep8-naming] ignore-names = ["X*", "setUp"] -[tool.ruff.isort] +[lint.isort] lines-after-imports = 2 -[tool.ruff.pydocstyle] +[lint.pydocstyle] convention = "numpy" -[tool.ruff.pycodestyle] +[lint.pycodestyle] max-doc-length = 88 [tool.pytest.ini_options] diff --git a/setup.py b/setup.py index 183e0ed..7a5788c 100644 --- a/setup.py +++ b/setup.py @@ -2,5 +2,4 @@ from setuptools import setup - setup() diff --git a/tests/cycquery/test_ops.py b/tests/cycquery/test_ops.py index 958875e..28ccf4d 100644 --- a/tests/cycquery/test_ops.py +++ b/tests/cycquery/test_ops.py @@ -49,7 +49,6 @@ ) from cycquery.util import process_column - QUERIER = OMOPQuerier( database="synthea_integration_test", user="postgres",