diff --git a/adaptive/utils.py b/adaptive/utils.py index ff80f62f1..d0482c1e6 100644 --- a/adaptive/utils.py +++ b/adaptive/utils.py @@ -19,7 +19,7 @@ from dask.distributed import Client as AsyncDaskClient -def named_product(**items: Sequence[Any]): +def named_product(**items: Sequence[Any]) -> list[dict[str, Any]]: names = items.keys() vals = items.values() return [dict(zip(names, res)) for res in product(*vals)] @@ -160,7 +160,7 @@ def submit(self, fn: Callable, *args, **kwargs) -> concurrent.Future: # type: i fut.set_exception(e) return fut - def map(self, fn, *iterable, timeout=None, chunksize=1): + def map(self, fn, *iterable, timeout=None, chunksize=1): # noqa: A003 return map(fn, iterable) def shutdown(self, wait=True): diff --git a/docs/source/conf.py b/docs/source/conf.py index cbe37c5c8..5e09fc717 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,7 +21,7 @@ # -- Project information ----------------------------------------------------- project = "adaptive" -copyright = "2018-2023, Adaptive Authors" +copyright = "2018-2023, Adaptive Authors" # noqa: A001 author = "Adaptive Authors" # The short X.Y version diff --git a/pyproject.toml b/pyproject.toml index 63037d1ec..59883a1cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,16 +31,16 @@ dependencies = [ other = [ "dill", "distributed", - "ipyparallel>=6.2.5", # because of https://github.com/ipython/ipyparallel/issues/404 - "scikit-optimize>=0.8.1", # because of https://github.com/scikit-optimize/scikit-optimize/issues/931 + "ipyparallel>=6.2.5", # because of https://github.com/ipython/ipyparallel/issues/404 + "scikit-optimize>=0.8.1", # because of https://github.com/scikit-optimize/scikit-optimize/issues/931 "scikit-learn", "wexpect; os_name == 'nt'", "pexpect; os_name != 'nt'", ] notebook = [ "ipython", - "ipykernel>=4.8.0", # because https://github.com/ipython/ipykernel/issues/274 and https://github.com/ipython/ipykernel/issues/263 - "jupyter_client>=5.2.2", # because https://github.com/jupyter/jupyter_client/pull/314 + "ipykernel>=4.8.0", # because https://github.com/ipython/ipykernel/issues/274 and https://github.com/ipython/ipykernel/issues/263 + "jupyter_client>=5.2.2", # because https://github.com/jupyter/jupyter_client/pull/314 "holoviews>=1.9.1", "ipywidgets", "bokeh", @@ -99,7 +99,69 @@ line-length = 88 target-version = "py39" [tool.ruff.lint] -select = ["B", "C", "E", "F", "W", "T", "B9", "I", "UP"] +select = [ + "A", # flake8-builtins + "AIR", # Airflow + # "ANN", # flake8-annotations + # "ARG", # flake8-unused-arguments + # "ASYNC", # flake8-async + "B", # flake8-bugbear + # "BLE", # flake8-blind-except + "C4", # flake8-comprehensions + "C90", # mccabe + # "COM", # flake8-commas + # "CPY", # flake8-copyright + # "D", # pydocstyle + # "DJ", # flake8-django + # "DTZ", # flake8-datetimez + "E", # pycodestyle + "W", # pycodestyle + "E", # Error + # "EM", # flake8-errmsg + # "ERA", # eradicate + # "EXE", # flake8-executable + "F", # Pyflakes + # "FA", # flake8-future-annotations + # "FBT", # flake8-boolean-trap + # "FIX", # flake8-fixme + # "FLY", # flynt + # "FURB", # refurb + # "G", # flake8-logging-format + "I", # isort + # "ICN", # flake8-import-conventions + # "INP", # flake8-no-pep420 + # "INT", # flake8-gettext + # "ISC", # flake8-implicit-str-concat + # "LOG", # flake8-logging + # "N", # pep8-naming + # "NPY", # NumPy-specific rules + # "PD", # pandas-vet + # "PERF", # Perflint + # "PGH", # pygrep-hooks + # "PIE", # flake8-pie + # "PL", # Pylint + # "PT", # flake8-pytest-style + # "PTH", # flake8-use-pathlib + # "PYI", # flake8-pyi + # "Q", # flake8-quotes + # "RET", # flake8-return + # "RSE", # flake8-raise + # "RUF", # Ruff-specific rules + # "S", # flake8-bandit + # "SIM", # flake8-simplify + # "SLF", # flake8-self + # "SLOT", # flake8-slots + "T10", # flake8-debugger + "T20", # flake8-print + # "TCH", # flake8-type-checking + # "TD", # flake8-todos + # "TID", # flake8-tidy-imports + # "TRIO", # flake8-trio + # "TRY", # tryceratops + "UP", # pyupgrade + # "W", # Warning + # "YTT", # flake8-2020 +] ignore = [ "T20", # flake8-print "ANN101", # Missing type annotation for {name} in method