From 3388d1c65097d613a0deee7bee316eb146d2ec67 Mon Sep 17 00:00:00 2001 From: jorenham Date: Sat, 23 Nov 2024 19:17:27 +0100 Subject: [PATCH 1/5] bump `basedpyright` to `1.22.0` --- .pre-commit-config.yaml | 2 +- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 66dd97b4..e9546928 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,7 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.42.0 + rev: v0.43.0 hooks: - id: markdownlint diff --git a/poetry.lock b/poetry.lock index 82959561..612675de 100644 --- a/poetry.lock +++ b/poetry.lock @@ -57,13 +57,13 @@ reports = ["lxml"] [[package]] name = "basedpyright" -version = "1.21.1" +version = "1.22.0" description = "static type checking for Python (but based)" optional = false python-versions = ">=3.8" files = [ - {file = "basedpyright-1.21.1-py3-none-any.whl", hash = "sha256:e4c30c84d5fe0f33ba2f7bd5b20019aa6f031ef4c5032705b4960dad52066667"}, - {file = "basedpyright-1.21.1.tar.gz", hash = "sha256:c27e5921768db2141360889978678152a685fe1c6ff95652b2157240a5fd575c"}, + {file = "basedpyright-1.22.0-py3-none-any.whl", hash = "sha256:6376107086ad25525429b8a94a2ffdb67c6dd2b1a6be38bf3c6ea9b5c3d1f688"}, + {file = "basedpyright-1.22.0.tar.gz", hash = "sha256:457e97ac4c3f694b900453d3f8824af36d17b9cef3d76c623e665dd4c7872d9c"}, ] [package.dependencies] @@ -1056,4 +1056,4 @@ scipy = ["scipy"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "30faa22fd985e8098413afb3113e4743fc29774fe771c17a86f18844cb2b841d" +content-hash = "f06aac819e64e414683dd764c5bf9106fcad80ae308349792ed4e3c0798d8315" diff --git a/pyproject.toml b/pyproject.toml index e0ef3cb5..1c5f1092 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ tox = "^4.23.2" [tool.poetry.group.lint.dependencies] basedmypy = {version = "^2.7.0", extras = ["faster-cache"]} -basedpyright = "^1.21.1" +basedpyright = "^1.22.0" codespell = "^2.3.0" mdformat = "^0.7.19" mdformat-gfm = "^0.3.7" From baf65895a5c256264f4349fb0b16dd3062a022ed Mon Sep 17 00:00:00 2001 From: jorenham Date: Sat, 23 Nov 2024 21:06:39 +0100 Subject: [PATCH 2/5] stricter basedpyright config --- poetry.lock | 135 ++++++++++++++++++++++++++++--------------------- pyproject.toml | 36 +++++++++---- 2 files changed, 103 insertions(+), 68 deletions(-) diff --git a/poetry.lock b/poetry.lock index 612675de..105279bb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -539,69 +539,86 @@ numpy = ["numpy (>=1.24)"] [[package]] name = "orjson" -version = "3.10.11" +version = "3.10.12" description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" optional = false python-versions = ">=3.8" files = [ - {file = "orjson-3.10.11-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:6dade64687f2bd7c090281652fe18f1151292d567a9302b34c2dbb92a3872f1f"}, - {file = "orjson-3.10.11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82f07c550a6ccd2b9290849b22316a609023ed851a87ea888c0456485a7d196a"}, - {file = "orjson-3.10.11-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bd9a187742d3ead9df2e49240234d728c67c356516cf4db018833a86f20ec18c"}, - {file = "orjson-3.10.11-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:77b0fed6f209d76c1c39f032a70df2d7acf24b1812ca3e6078fd04e8972685a3"}, - {file = "orjson-3.10.11-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:63fc9d5fe1d4e8868f6aae547a7b8ba0a2e592929245fff61d633f4caccdcdd6"}, - {file = "orjson-3.10.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65cd3e3bb4fbb4eddc3c1e8dce10dc0b73e808fcb875f9fab40c81903dd9323e"}, - {file = "orjson-3.10.11-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:6f67c570602300c4befbda12d153113b8974a3340fdcf3d6de095ede86c06d92"}, - {file = "orjson-3.10.11-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1f39728c7f7d766f1f5a769ce4d54b5aaa4c3f92d5b84817053cc9995b977acc"}, - {file = "orjson-3.10.11-cp310-none-win32.whl", hash = "sha256:1789d9db7968d805f3d94aae2c25d04014aae3a2fa65b1443117cd462c6da647"}, - {file = "orjson-3.10.11-cp310-none-win_amd64.whl", hash = "sha256:5576b1e5a53a5ba8f8df81872bb0878a112b3ebb1d392155f00f54dd86c83ff6"}, - {file = "orjson-3.10.11-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:1444f9cb7c14055d595de1036f74ecd6ce15f04a715e73f33bb6326c9cef01b6"}, - {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cdec57fe3b4bdebcc08a946db3365630332dbe575125ff3d80a3272ebd0ddafe"}, - {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4eed32f33a0ea6ef36ccc1d37f8d17f28a1d6e8eefae5928f76aff8f1df85e67"}, - {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80df27dd8697242b904f4ea54820e2d98d3f51f91e97e358fc13359721233e4b"}, - {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:705f03cee0cb797256d54de6695ef219e5bc8c8120b6654dd460848d57a9af3d"}, - {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03246774131701de8e7059b2e382597da43144a9a7400f178b2a32feafc54bd5"}, - {file = "orjson-3.10.11-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8b5759063a6c940a69c728ea70d7c33583991c6982915a839c8da5f957e0103a"}, - {file = "orjson-3.10.11-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:677f23e32491520eebb19c99bb34675daf5410c449c13416f7f0d93e2cf5f981"}, - {file = "orjson-3.10.11-cp311-none-win32.whl", hash = "sha256:a11225d7b30468dcb099498296ffac36b4673a8398ca30fdaec1e6c20df6aa55"}, - {file = "orjson-3.10.11-cp311-none-win_amd64.whl", hash = "sha256:df8c677df2f9f385fcc85ab859704045fa88d4668bc9991a527c86e710392bec"}, - {file = "orjson-3.10.11-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:360a4e2c0943da7c21505e47cf6bd725588962ff1d739b99b14e2f7f3545ba51"}, - {file = "orjson-3.10.11-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:496e2cb45de21c369079ef2d662670a4892c81573bcc143c4205cae98282ba97"}, - {file = "orjson-3.10.11-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7dfa8db55c9792d53c5952900c6a919cfa377b4f4534c7a786484a6a4a350c19"}, - {file = "orjson-3.10.11-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:51f3382415747e0dbda9dade6f1e1a01a9d37f630d8c9049a8ed0e385b7a90c0"}, - {file = "orjson-3.10.11-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f35a1b9f50a219f470e0e497ca30b285c9f34948d3c8160d5ad3a755d9299433"}, - {file = "orjson-3.10.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2f3b7c5803138e67028dde33450e054c87e0703afbe730c105f1fcd873496d5"}, - {file = "orjson-3.10.11-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f91d9eb554310472bd09f5347950b24442600594c2edc1421403d7610a0998fd"}, - {file = "orjson-3.10.11-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:dfbb2d460a855c9744bbc8e36f9c3a997c4b27d842f3d5559ed54326e6911f9b"}, - {file = "orjson-3.10.11-cp312-none-win32.whl", hash = "sha256:d4a62c49c506d4d73f59514986cadebb7e8d186ad510c518f439176cf8d5359d"}, - {file = "orjson-3.10.11-cp312-none-win_amd64.whl", hash = "sha256:f1eec3421a558ff7a9b010a6c7effcfa0ade65327a71bb9b02a1c3b77a247284"}, - {file = "orjson-3.10.11-cp313-cp313-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:c46294faa4e4d0eb73ab68f1a794d2cbf7bab33b1dda2ac2959ffb7c61591899"}, - {file = "orjson-3.10.11-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52e5834d7d6e58a36846e059d00559cb9ed20410664f3ad156cd2cc239a11230"}, - {file = "orjson-3.10.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a2fc947e5350fdce548bfc94f434e8760d5cafa97fb9c495d2fef6757aa02ec0"}, - {file = "orjson-3.10.11-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0efabbf839388a1dab5b72b5d3baedbd6039ac83f3b55736eb9934ea5494d258"}, - {file = "orjson-3.10.11-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a3f29634260708c200c4fe148e42b4aae97d7b9fee417fbdd74f8cfc265f15b0"}, - {file = "orjson-3.10.11-cp313-none-win32.whl", hash = "sha256:1a1222ffcee8a09476bbdd5d4f6f33d06d0d6642df2a3d78b7a195ca880d669b"}, - {file = "orjson-3.10.11-cp313-none-win_amd64.whl", hash = "sha256:bc274ac261cc69260913b2d1610760e55d3c0801bb3457ba7b9004420b6b4270"}, - {file = "orjson-3.10.11-cp38-cp38-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:19b3763e8bbf8ad797df6b6b5e0fc7c843ec2e2fc0621398534e0c6400098f87"}, - {file = "orjson-3.10.11-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1be83a13312e5e58d633580c5eb8d0495ae61f180da2722f20562974188af205"}, - {file = "orjson-3.10.11-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:afacfd1ab81f46dedd7f6001b6d4e8de23396e4884cd3c3436bd05defb1a6446"}, - {file = "orjson-3.10.11-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cb4d0bea56bba596723d73f074c420aec3b2e5d7d30698bc56e6048066bd560c"}, - {file = "orjson-3.10.11-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:96ed1de70fcb15d5fed529a656df29f768187628727ee2788344e8a51e1c1350"}, - {file = "orjson-3.10.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4bfb30c891b530f3f80e801e3ad82ef150b964e5c38e1fb8482441c69c35c61c"}, - {file = "orjson-3.10.11-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d496c74fc2b61341e3cefda7eec21b7854c5f672ee350bc55d9a4997a8a95204"}, - {file = "orjson-3.10.11-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:655a493bac606655db9a47fe94d3d84fc7f3ad766d894197c94ccf0c5408e7d3"}, - {file = "orjson-3.10.11-cp38-none-win32.whl", hash = "sha256:b9546b278c9fb5d45380f4809e11b4dd9844ca7aaf1134024503e134ed226161"}, - {file = "orjson-3.10.11-cp38-none-win_amd64.whl", hash = "sha256:b592597fe551d518f42c5a2eb07422eb475aa8cfdc8c51e6da7054b836b26782"}, - {file = "orjson-3.10.11-cp39-cp39-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:c95f2ecafe709b4e5c733b5e2768ac569bed308623c85806c395d9cca00e08af"}, - {file = "orjson-3.10.11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:80c00d4acded0c51c98754fe8218cb49cb854f0f7eb39ea4641b7f71732d2cb7"}, - {file = "orjson-3.10.11-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:461311b693d3d0a060439aa669c74f3603264d4e7a08faa68c47ae5a863f352d"}, - {file = "orjson-3.10.11-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:52ca832f17d86a78cbab86cdc25f8c13756ebe182b6fc1a97d534051c18a08de"}, - {file = "orjson-3.10.11-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f4c57ea78a753812f528178aa2f1c57da633754c91d2124cb28991dab4c79a54"}, - {file = "orjson-3.10.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b7fcfc6f7ca046383fb954ba528587e0f9336828b568282b27579c49f8e16aad"}, - {file = "orjson-3.10.11-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:86b9dd983857970c29e4c71bb3e95ff085c07d3e83e7c46ebe959bac07ebd80b"}, - {file = "orjson-3.10.11-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:4d83f87582d223e54efb2242a79547611ba4ebae3af8bae1e80fa9a0af83bb7f"}, - {file = "orjson-3.10.11-cp39-none-win32.whl", hash = "sha256:9fd0ad1c129bc9beb1154c2655f177620b5beaf9a11e0d10bac63ef3fce96950"}, - {file = "orjson-3.10.11-cp39-none-win_amd64.whl", hash = "sha256:10f416b2a017c8bd17f325fb9dee1fb5cdd7a54e814284896b7c3f2763faa017"}, - {file = "orjson-3.10.11.tar.gz", hash = "sha256:e35b6d730de6384d5b2dab5fd23f0d76fae8bbc8c353c2f78210aa5fa4beb3ef"}, + {file = "orjson-3.10.12-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:ece01a7ec71d9940cc654c482907a6b65df27251255097629d0dea781f255c6d"}, + {file = "orjson-3.10.12-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c34ec9aebc04f11f4b978dd6caf697a2df2dd9b47d35aa4cc606cabcb9df69d7"}, + {file = "orjson-3.10.12-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fd6ec8658da3480939c79b9e9e27e0db31dffcd4ba69c334e98c9976ac29140e"}, + {file = "orjson-3.10.12-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f17e6baf4cf01534c9de8a16c0c611f3d94925d1701bf5f4aff17003677d8ced"}, + {file = "orjson-3.10.12-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6402ebb74a14ef96f94a868569f5dccf70d791de49feb73180eb3c6fda2ade56"}, + {file = "orjson-3.10.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0000758ae7c7853e0a4a6063f534c61656ebff644391e1f81698c1b2d2fc8cd2"}, + {file = "orjson-3.10.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:888442dcee99fd1e5bd37a4abb94930915ca6af4db50e23e746cdf4d1e63db13"}, + {file = "orjson-3.10.12-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c1f7a3ce79246aa0e92f5458d86c54f257fb5dfdc14a192651ba7ec2c00f8a05"}, + {file = "orjson-3.10.12-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:802a3935f45605c66fb4a586488a38af63cb37aaad1c1d94c982c40dcc452e85"}, + {file = "orjson-3.10.12-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:1da1ef0113a2be19bb6c557fb0ec2d79c92ebd2fed4cfb1b26bab93f021fb885"}, + {file = "orjson-3.10.12-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7a3273e99f367f137d5b3fecb5e9f45bcdbfac2a8b2f32fbc72129bbd48789c2"}, + {file = "orjson-3.10.12-cp310-none-win32.whl", hash = "sha256:475661bf249fd7907d9b0a2a2421b4e684355a77ceef85b8352439a9163418c3"}, + {file = "orjson-3.10.12-cp310-none-win_amd64.whl", hash = "sha256:87251dc1fb2b9e5ab91ce65d8f4caf21910d99ba8fb24b49fd0c118b2362d509"}, + {file = "orjson-3.10.12-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:a734c62efa42e7df94926d70fe7d37621c783dea9f707a98cdea796964d4cf74"}, + {file = "orjson-3.10.12-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:750f8b27259d3409eda8350c2919a58b0cfcd2054ddc1bd317a643afc646ef23"}, + {file = "orjson-3.10.12-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb52c22bfffe2857e7aa13b4622afd0dd9d16ea7cc65fd2bf318d3223b1b6252"}, + {file = "orjson-3.10.12-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:440d9a337ac8c199ff8251e100c62e9488924c92852362cd27af0e67308c16ef"}, + {file = "orjson-3.10.12-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9e15c06491c69997dfa067369baab3bf094ecb74be9912bdc4339972323f252"}, + {file = "orjson-3.10.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:362d204ad4b0b8724cf370d0cd917bb2dc913c394030da748a3bb632445ce7c4"}, + {file = "orjson-3.10.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2b57cbb4031153db37b41622eac67329c7810e5f480fda4cfd30542186f006ae"}, + {file = "orjson-3.10.12-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:165c89b53ef03ce0d7c59ca5c82fa65fe13ddf52eeb22e859e58c237d4e33b9b"}, + {file = "orjson-3.10.12-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:5dee91b8dfd54557c1a1596eb90bcd47dbcd26b0baaed919e6861f076583e9da"}, + {file = "orjson-3.10.12-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:77a4e1cfb72de6f905bdff061172adfb3caf7a4578ebf481d8f0530879476c07"}, + {file = "orjson-3.10.12-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:038d42c7bc0606443459b8fe2d1f121db474c49067d8d14c6a075bbea8bf14dd"}, + {file = "orjson-3.10.12-cp311-none-win32.whl", hash = "sha256:03b553c02ab39bed249bedd4abe37b2118324d1674e639b33fab3d1dafdf4d79"}, + {file = "orjson-3.10.12-cp311-none-win_amd64.whl", hash = "sha256:8b8713b9e46a45b2af6b96f559bfb13b1e02006f4242c156cbadef27800a55a8"}, + {file = "orjson-3.10.12-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:53206d72eb656ca5ac7d3a7141e83c5bbd3ac30d5eccfe019409177a57634b0d"}, + {file = "orjson-3.10.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac8010afc2150d417ebda810e8df08dd3f544e0dd2acab5370cfa6bcc0662f8f"}, + {file = "orjson-3.10.12-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed459b46012ae950dd2e17150e838ab08215421487371fa79d0eced8d1461d70"}, + {file = "orjson-3.10.12-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8dcb9673f108a93c1b52bfc51b0af422c2d08d4fc710ce9c839faad25020bb69"}, + {file = "orjson-3.10.12-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:22a51ae77680c5c4652ebc63a83d5255ac7d65582891d9424b566fb3b5375ee9"}, + {file = "orjson-3.10.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:910fdf2ac0637b9a77d1aad65f803bac414f0b06f720073438a7bd8906298192"}, + {file = "orjson-3.10.12-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:24ce85f7100160936bc2116c09d1a8492639418633119a2224114f67f63a4559"}, + {file = "orjson-3.10.12-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8a76ba5fc8dd9c913640292df27bff80a685bed3a3c990d59aa6ce24c352f8fc"}, + {file = "orjson-3.10.12-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:ff70ef093895fd53f4055ca75f93f047e088d1430888ca1229393a7c0521100f"}, + {file = "orjson-3.10.12-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:f4244b7018b5753ecd10a6d324ec1f347da130c953a9c88432c7fbc8875d13be"}, + {file = "orjson-3.10.12-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:16135ccca03445f37921fa4b585cff9a58aa8d81ebcb27622e69bfadd220b32c"}, + {file = "orjson-3.10.12-cp312-none-win32.whl", hash = "sha256:2d879c81172d583e34153d524fcba5d4adafbab8349a7b9f16ae511c2cee8708"}, + {file = "orjson-3.10.12-cp312-none-win_amd64.whl", hash = "sha256:fc23f691fa0f5c140576b8c365bc942d577d861a9ee1142e4db468e4e17094fb"}, + {file = "orjson-3.10.12-cp313-cp313-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:47962841b2a8aa9a258b377f5188db31ba49af47d4003a32f55d6f8b19006543"}, + {file = "orjson-3.10.12-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6334730e2532e77b6054e87ca84f3072bee308a45a452ea0bffbbbc40a67e296"}, + {file = "orjson-3.10.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:accfe93f42713c899fdac2747e8d0d5c659592df2792888c6c5f829472e4f85e"}, + {file = "orjson-3.10.12-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a7974c490c014c48810d1dede6c754c3cc46598da758c25ca3b4001ac45b703f"}, + {file = "orjson-3.10.12-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:3f250ce7727b0b2682f834a3facff88e310f52f07a5dcfd852d99637d386e79e"}, + {file = "orjson-3.10.12-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f31422ff9486ae484f10ffc51b5ab2a60359e92d0716fcce1b3593d7bb8a9af6"}, + {file = "orjson-3.10.12-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5f29c5d282bb2d577c2a6bbde88d8fdcc4919c593f806aac50133f01b733846e"}, + {file = "orjson-3.10.12-cp313-none-win32.whl", hash = "sha256:f45653775f38f63dc0e6cd4f14323984c3149c05d6007b58cb154dd080ddc0dc"}, + {file = "orjson-3.10.12-cp313-none-win_amd64.whl", hash = "sha256:229994d0c376d5bdc91d92b3c9e6be2f1fbabd4cc1b59daae1443a46ee5e9825"}, + {file = "orjson-3.10.12-cp38-cp38-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:7d69af5b54617a5fac5c8e5ed0859eb798e2ce8913262eb522590239db6c6763"}, + {file = "orjson-3.10.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ed119ea7d2953365724a7059231a44830eb6bbb0cfead33fcbc562f5fd8f935"}, + {file = "orjson-3.10.12-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9c5fc1238ef197e7cad5c91415f524aaa51e004be5a9b35a1b8a84ade196f73f"}, + {file = "orjson-3.10.12-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:43509843990439b05f848539d6f6198d4ac86ff01dd024b2f9a795c0daeeab60"}, + {file = "orjson-3.10.12-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f72e27a62041cfb37a3de512247ece9f240a561e6c8662276beaf4d53d406db4"}, + {file = "orjson-3.10.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a904f9572092bb6742ab7c16c623f0cdccbad9eeb2d14d4aa06284867bddd31"}, + {file = "orjson-3.10.12-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:855c0833999ed5dc62f64552db26f9be767434917d8348d77bacaab84f787d7b"}, + {file = "orjson-3.10.12-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:897830244e2320f6184699f598df7fb9db9f5087d6f3f03666ae89d607e4f8ed"}, + {file = "orjson-3.10.12-cp38-cp38-musllinux_1_2_armv7l.whl", hash = "sha256:0b32652eaa4a7539f6f04abc6243619c56f8530c53bf9b023e1269df5f7816dd"}, + {file = "orjson-3.10.12-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:36b4aa31e0f6a1aeeb6f8377769ca5d125db000f05c20e54163aef1d3fe8e833"}, + {file = "orjson-3.10.12-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:5535163054d6cbf2796f93e4f0dbc800f61914c0e3c4ed8499cf6ece22b4a3da"}, + {file = "orjson-3.10.12-cp38-none-win32.whl", hash = "sha256:90a5551f6f5a5fa07010bf3d0b4ca2de21adafbbc0af6cb700b63cd767266cb9"}, + {file = "orjson-3.10.12-cp38-none-win_amd64.whl", hash = "sha256:703a2fb35a06cdd45adf5d733cf613cbc0cb3ae57643472b16bc22d325b5fb6c"}, + {file = "orjson-3.10.12-cp39-cp39-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:f29de3ef71a42a5822765def1febfb36e0859d33abf5c2ad240acad5c6a1b78d"}, + {file = "orjson-3.10.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de365a42acc65d74953f05e4772c974dad6c51cfc13c3240899f534d611be967"}, + {file = "orjson-3.10.12-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:91a5a0158648a67ff0004cb0df5df7dcc55bfc9ca154d9c01597a23ad54c8d0c"}, + {file = "orjson-3.10.12-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c47ce6b8d90fe9646a25b6fb52284a14ff215c9595914af63a5933a49972ce36"}, + {file = "orjson-3.10.12-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0eee4c2c5bfb5c1b47a5db80d2ac7aaa7e938956ae88089f098aff2c0f35d5d8"}, + {file = "orjson-3.10.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35d3081bbe8b86587eb5c98a73b97f13d8f9fea685cf91a579beddacc0d10566"}, + {file = "orjson-3.10.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:73c23a6e90383884068bc2dba83d5222c9fcc3b99a0ed2411d38150734236755"}, + {file = "orjson-3.10.12-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5472be7dc3269b4b52acba1433dac239215366f89dc1d8d0e64029abac4e714e"}, + {file = "orjson-3.10.12-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:7319cda750fca96ae5973efb31b17d97a5c5225ae0bc79bf5bf84df9e1ec2ab6"}, + {file = "orjson-3.10.12-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:74d5ca5a255bf20b8def6a2b96b1e18ad37b4a122d59b154c458ee9494377f80"}, + {file = "orjson-3.10.12-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:ff31d22ecc5fb85ef62c7d4afe8301d10c558d00dd24274d4bbe464380d3cd69"}, + {file = "orjson-3.10.12-cp39-none-win32.whl", hash = "sha256:c22c3ea6fba91d84fcb4cda30e64aff548fcf0c44c876e681f47d61d24b12e6b"}, + {file = "orjson-3.10.12-cp39-none-win_amd64.whl", hash = "sha256:be604f60d45ace6b0b33dd990a66b4526f1a7a186ac411c942674625456ca548"}, + {file = "orjson-3.10.12.tar.gz", hash = "sha256:0a78bbda3aea0f9f079057ee1ee8a1ecf790d4f1af88dd67493c6b8ee52506ff"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 1c5f1092..292d1a43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -151,18 +151,36 @@ stubPath = "." pythonVersion = "3.10" pythonPlatform = "All" typeCheckingMode = "strict" - -deprecateTypingAliases = true +# ignore comments enableTypeIgnoreComments = false -reportIgnoreCommentWithoutRule = true -reportImplicitRelativeImport = true -reportInvalidCast = true +reportIgnoreCommentWithoutRule = true # based reportUnnecessaryTypeIgnoreComment = true - +# imports +reportImplicitRelativeImport = true # based +reportPrivateLocalImportUsage = false # based +reportShadowedImports = true +# classes and inheritance +reportUnsafeMultipleInheritance = true # based +reportImplicitAbstractClass = true # based +reportImplicitOverride = true +reportUnannotatedClassAttribute = true # based +# linting +deprecateTypingAliases = true +enableReachabilityAnalysis = false # discouraged +reportCallInDefaultInitializer = true +reportImplicitStringConcatenation = true # based +reportPrivateUsage = false +# narrowing +strictGenericNarrowing = true # based +# TODO: enable once nothing is `Untyped` +reportAny = false # based +reportExplicitAny = false # based +# environment +failOnWarnings = true # based executionEnvironments = [ - {root = "codegen", reportUnusedParameter = false}, - {root = "scipy-stubs", reportDeprecated = false, reportPrivateUsage = false}, - {root = "tests", reportPrivateUsage = false, reportInvalidStubStatement = false}, + {root = "scipy-stubs", reportDeprecated = false, reportUnsafeMultipleInheritance = false, reportUnreachable = false}, + {root = "codegen", reportAny = true, reportExplicitAny = true, reportInvalidCast = true, reportPrivateUsage = true}, + {root = "tests", reportAny = true, reportInvalidCast = true, reportInvalidStubStatement = false}, ] [tool.repo-review] From 59d604760fff188997f1bfabcf9b2dce9190241f Mon Sep 17 00:00:00 2001 From: jorenham Date: Sat, 23 Nov 2024 21:07:58 +0100 Subject: [PATCH 3/5] stub the `scipy.stats._basedurn` cython module --- scipy-stubs/stats/_biasedurn.pyi | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 scipy-stubs/stats/_biasedurn.pyi diff --git a/scipy-stubs/stats/_biasedurn.pyi b/scipy-stubs/stats/_biasedurn.pyi new file mode 100644 index 00000000..39e4e5a6 --- /dev/null +++ b/scipy-stubs/stats/_biasedurn.pyi @@ -0,0 +1,54 @@ +# see `scipy/stats/_biasedurn.pyx` + +from typing import type_check_only +from typing_extensions import Never + +import numpy as np +import optype as op +import optype.numpy as onp +from scipy._typing import RNG + +@type_check_only +class _PyNCHypergeometric: + def __init__(self, /, n: op.CanInt, m: op.CanInt, N: op.CanInt, odds: op.CanFloat, accuracy: op.CanFloat) -> None: ... + def mode(self, /) -> int: ... + def mean(self, /) -> float: ... + def variance(self, /) -> float: ... + def probability(self, /, x: op.CanInt) -> float: ... + def moments(self, /) -> tuple[float, float]: ... + +### + +class _PyFishersNCHypergeometric(_PyNCHypergeometric): ... +class _PyWalleniusNCHypergeometric(_PyNCHypergeometric): ... + +class _PyStochasticLib3: + def __init__(self, /, *args: Never, **kwargs: Never) -> None: ... + def Random(self, /) -> float: ... + def SetAccuracy(self, /, accur: op.CanFloat) -> None: ... + def FishersNCHyp(self, /, n: op.CanInt, m: op.CanInt, N: op.CanInt, odds: op.CanFloat) -> _PyFishersNCHypergeometric: ... + def WalleniusNCHyp(self, /, n: op.CanInt, m: op.CanInt, N: op.CanInt, odds: op.CanFloat) -> _PyWalleniusNCHypergeometric: ... + # + def rvs_fisher( + self, + /, + n: op.CanInt, + m: op.CanInt, + N: op.CanInt, + odds: op.CanFloat, + size: op.CanInt, + random_state: RNG | None = None, + ) -> onp.Array1D[np.float64]: ... + def rvs_wallenius( + self, + /, + n: op.CanInt, + m: op.CanInt, + N: op.CanInt, + odds: op.CanFloat, + size: op.CanInt, + random_state: RNG | None = None, + ) -> onp.Array1D[np.float64]: ... + +def __setstate_cython__(self: object, pyx_state: object, /) -> None: ... +def __reduce_cython__(self: object) -> None: ... From 200bd49ecf4cd60d3867264b4f1cc3830412f683 Mon Sep 17 00:00:00 2001 From: jorenham Date: Sat, 23 Nov 2024 21:08:26 +0100 Subject: [PATCH 4/5] fix new `basedpyright` errors --- codegen/mods.py | 4 +++- scipy-stubs/_lib/_ccallback.pyi | 3 ++- scipy-stubs/fft/_backend.pyi | 4 ++-- scipy-stubs/integrate/_ode.pyi | 4 ++-- scipy-stubs/io/_mmio.pyi | 28 +++++++++++++------------- scipy-stubs/io/arff/_arffread.pyi | 12 +++++------ scipy-stubs/stats/_discrete_distns.pyi | 17 +++++++++------- scipy-stubs/stats/_kde.pyi | 2 +- scipy-stubs/stats/_stats_py.pyi | 4 +++- 9 files changed, 43 insertions(+), 35 deletions(-) diff --git a/codegen/mods.py b/codegen/mods.py index d0df59c6..27b58540 100644 --- a/codegen/mods.py +++ b/codegen/mods.py @@ -5,7 +5,7 @@ # ] # /// -from typing import Final +from typing import Final, final from typing_extensions import override import libcst as cst @@ -53,6 +53,7 @@ def leave_Module(self, original_node: cst.Module, updated_node: cst.Module) -> c return updated_node +@final class AnnotateMissing(_BaseMod): DESCRIPTION = "Sets the default return type to `None`, and other missing annotations to `scipy._typing.Untyped`" @@ -94,6 +95,7 @@ def leave_FunctionDef(self, /, original_node: cst.FunctionDef, updated_node: cst return updated_node +@final class FixTrailingComma(_BaseMod): DESCRIPTION = "Adds a trailing comma to parameters that don't fit on one line, so that ruff formats them correctly." diff --git a/scipy-stubs/_lib/_ccallback.pyi b/scipy-stubs/_lib/_ccallback.pyi index 798a53af..8c2b5d97 100644 --- a/scipy-stubs/_lib/_ccallback.pyi +++ b/scipy-stubs/_lib/_ccallback.pyi @@ -58,7 +58,7 @@ class _CFFIVoid(_CFFIType, Protocol): @type_check_only class _CFFIFunc(_CFFIType, Protocol[_CT_co, Unpack[_CTs]]): - is_array_type: ClassVar = False + is_array_type: ClassVar[bool] = False @property def args(self, /) -> tuple[Unpack[_CTs]]: ... @@ -78,6 +78,7 @@ class _CFFIFuncPtr(_CFFIFunc[_CT_co, Unpack[_CTs]], Protocol[_CT_co, Unpack[_CTs def as_raw_function(self, /) -> _CFFIFunc[_CT_co, Unpack[_CTs]]: ... @type_check_only +@final class _CFFIPointerType(_CFFIType, Protocol[_CT_co]): is_array_type: ClassVar = False is_raw_function: ClassVar = False diff --git a/scipy-stubs/fft/_backend.pyi b/scipy-stubs/fft/_backend.pyi index 0fd3e073..d188d236 100644 --- a/scipy-stubs/fft/_backend.pyi +++ b/scipy-stubs/fft/_backend.pyi @@ -1,6 +1,6 @@ from collections.abc import Mapping, Sequence from typing import Any, ClassVar, Protocol, final, type_check_only -from typing_extensions import TypeVar +from typing_extensions import LiteralString, TypeVar import optype as op @@ -8,7 +8,7 @@ _RT_co = TypeVar("_RT_co", covariant=True, default=Any) @type_check_only class _BaseBackend(Protocol[_RT_co]): - __ua_domain__: ClassVar = "numpy.scipy.fft" + __ua_domain__: ClassVar[LiteralString] = "numpy.scipy.fft" @staticmethod def __ua_function__(method: str, args: Sequence[object], kwargs: Mapping[str, object]) -> _RT_co: ... diff --git a/scipy-stubs/integrate/_ode.pyi b/scipy-stubs/integrate/_ode.pyi index 78e19404..f54ac4e5 100644 --- a/scipy-stubs/integrate/_ode.pyi +++ b/scipy-stubs/integrate/_ode.pyi @@ -184,7 +184,7 @@ class zvode(vode[np.complex128]): initialized: bool class dopri5(IntegratorBase[np.float64]): - name: ClassVar = "dopri5" + name: ClassVar[str] = "dopri5" messages: ClassVar[dict[int, str]] = ... rtol: Final[float] @@ -233,7 +233,7 @@ class dopri5(IntegratorBase[np.float64]): ) -> Literal[0, -1, 1]: ... class dop853(dopri5): - name: ClassVar = "dop853" + name: ClassVar[str] = "dop853" def __init__( self, /, diff --git a/scipy-stubs/io/_mmio.pyi b/scipy-stubs/io/_mmio.pyi index 9ef6bd85..ebb5b801 100644 --- a/scipy-stubs/io/_mmio.pyi +++ b/scipy-stubs/io/_mmio.pyi @@ -35,22 +35,22 @@ def mmwrite( ) -> None: ... class MMFile: - FORMAT_COORDINATE: ClassVar = "coordinate" - FORMAT_ARRAY: ClassVar = "array" - FORMAT_VALUES: ClassVar = "coordinate", "array" + FORMAT_COORDINATE: ClassVar[str] = "coordinate" + FORMAT_ARRAY: ClassVar[str] = "array" + FORMAT_VALUES: ClassVar[tuple[str, ...]] = "coordinate", "array" - FIELD_INTEGER: ClassVar = "integer" - FIELD_UNSIGNED: ClassVar = "unsigned-integer" - FIELD_REAL: ClassVar = "real" - FIELD_COMPLEX: ClassVar = "complex" - FIELD_PATTERN: ClassVar = "pattern" - FIELD_VALUES: ClassVar = "integer", "unsigned-integer", "real", "complex", "pattern" + FIELD_INTEGER: ClassVar[str] = "integer" + FIELD_UNSIGNED: ClassVar[str] = "unsigned-integer" + FIELD_REAL: ClassVar[str] = "real" + FIELD_COMPLEX: ClassVar[str] = "complex" + FIELD_PATTERN: ClassVar[str] = "pattern" + FIELD_VALUES: ClassVar[tuple[str, ...]] = "integer", "unsigned-integer", "real", "complex", "pattern" - SYMMETRY_GENERAL: ClassVar = "general" - SYMMETRY_SYMMETRIC: ClassVar = "symmetric" - SYMMETRY_SKEW_SYMMETRIC: ClassVar = "skew-symmetric" - SYMMETRY_HERMITIAN: ClassVar = "hermitian" - SYMMETRY_VALUES: ClassVar = "general", "symmetric", "skew-symmetric", "hermitian" + SYMMETRY_GENERAL: ClassVar[str] = "general" + SYMMETRY_SYMMETRIC: ClassVar[str] = "symmetric" + SYMMETRY_SKEW_SYMMETRIC: ClassVar[str] = "skew-symmetric" + SYMMETRY_HERMITIAN: ClassVar[str] = "hermitian" + SYMMETRY_VALUES: ClassVar[tuple[str, ...]] = "general", "symmetric", "skew-symmetric", "hermitian" DTYPES_BY_FIELD: ClassVar[dict[_Field, Literal["intp", "uint64", "d", "D"]]] = ... diff --git a/scipy-stubs/io/arff/_arffread.pyi b/scipy-stubs/io/arff/_arffread.pyi index 83ad1c42..cc508646 100644 --- a/scipy-stubs/io/arff/_arffread.pyi +++ b/scipy-stubs/io/arff/_arffread.pyi @@ -29,7 +29,7 @@ class ArffError(OSError): ... class ParseArffError(ArffError): ... class Attribute(Generic[_T_co], metaclass=abc.ABCMeta): - type_name: ClassVar[Any] + type_name: ClassVar[str] dtype: Any range: Any @@ -41,7 +41,7 @@ class Attribute(Generic[_T_co], metaclass=abc.ABCMeta): def parse_data(self, /, data_str: str) -> _T_co: ... class NominalAttribute(Attribute[str]): - type_name: ClassVar = "nominal" + type_name: ClassVar[str] = "nominal" dtype: tuple[type[np.bytes_], ...] range: Sequence[str] @@ -50,17 +50,17 @@ class NominalAttribute(Attribute[str]): def __init__(self, /, name: str, values: Sequence[str]) -> None: ... class NumericAttribute(Attribute[float]): - type_name: ClassVar = "numeric" + type_name: ClassVar[str] = "numeric" dtype: type[np.float64] range: None class StringAttribute(Attribute[None]): - type_name: ClassVar = "string" + type_name: ClassVar[str] = "string" dtype: type[np.object_] range: None class DateAttribute(Attribute[np.datetime64]): - type_name: ClassVar = "date" + type_name: ClassVar[str] = "date" dtype: np.datetime64 range: str @@ -70,7 +70,7 @@ class DateAttribute(Attribute[np.datetime64]): def __init__(self, /, name: str, date_format: str, datetime_unit: str) -> None: ... class RelationalAttribute(Attribute[np.ndarray[tuple[int], np.dtype[np.void]]]): - type_name: ClassVar = "relational" + type_name: ClassVar[str] = "relational" dtype: type[np.object_] range: None diff --git a/scipy-stubs/stats/_discrete_distns.pyi b/scipy-stubs/stats/_discrete_distns.pyi index 2d6cf3b7..e7cd1f5b 100644 --- a/scipy-stubs/stats/_discrete_distns.pyi +++ b/scipy-stubs/stats/_discrete_distns.pyi @@ -1,5 +1,6 @@ -from typing import ClassVar, Final +from typing import ClassVar, Final, Literal, final +from ._biasedurn import _PyFishersNCHypergeometric, _PyWalleniusNCHypergeometric from ._distn_infrastructure import rv_discrete __all__ = [ @@ -65,16 +66,18 @@ class skellam_gen(rv_discrete): ... class yulesimon_gen(rv_discrete): ... class _nchypergeom_gen(rv_discrete): - rvs_name: ClassVar = None - dist: ClassVar = None + rvs_name: ClassVar[Literal["rvs_fisher", "rvs_wallenius"] | None] = None + dist: ClassVar[type[_PyFishersNCHypergeometric | _PyWalleniusNCHypergeometric] | None] = None +@final class nchypergeom_fisher_gen(_nchypergeom_gen): - rvs_name: ClassVar = "rvs_fisher" - dist: ClassVar[type] = ... # scipy.stats._biasedurn._PyFishersNCHypergeometric + rvs_name: ClassVar[Literal["rvs_fisher"]] = "rvs_fisher" # pyright: ignore[reportIncompatibleVariableOverride] + dist: ClassVar[type[_PyFishersNCHypergeometric]] = ... # pyright: ignore[reportIncompatibleVariableOverride] +@final class nchypergeom_wallenius_gen(_nchypergeom_gen): - rvs_name: ClassVar = "rvs_wallenius" - dist: ClassVar[type] = ... # scipy.stats._biasedurn._PyWalleniusNCHypergeometric + rvs_name: ClassVar[Literal["rvs_wallenius"]] = "rvs_wallenius" # pyright: ignore[reportIncompatibleVariableOverride] + dist: ClassVar[type[_PyWalleniusNCHypergeometric]] = ... # pyright: ignore[reportIncompatibleVariableOverride] binom: Final[binom_gen] bernoulli: Final[bernoulli_gen] diff --git a/scipy-stubs/stats/_kde.pyi b/scipy-stubs/stats/_kde.pyi index 3e4a6574..e8130c65 100644 --- a/scipy-stubs/stats/_kde.pyi +++ b/scipy-stubs/stats/_kde.pyi @@ -35,7 +35,7 @@ class gaussian_kde: weights: onp.ToFloat1D | onp.ToFloat2D | None = None, ) -> None: ... def __call__(self, /, points: onp.ToFloat1D | onp.ToFloat2D) -> _Float1D: ... - evaluate = __call__ + def evaluate(self, /, points: onp.ToFloat1D | onp.ToFloat2D) -> _Float1D: ... def pdf(self, /, x: onp.ToFloat1D | onp.ToFloat2D) -> _Float1D: ... def logpdf(self, /, x: onp.ToFloat1D | onp.ToFloat2D) -> _Float1D: ... def integrate_gaussian(self, /, mean: onp.ToFloat1D, cov: onp.ToFloat2D) -> np.float64 | np.float32: ... diff --git a/scipy-stubs/stats/_stats_py.pyi b/scipy-stubs/stats/_stats_py.pyi index e9bde31e..12ccc443 100644 --- a/scipy-stubs/stats/_stats_py.pyi +++ b/scipy-stubs/stats/_stats_py.pyi @@ -1,7 +1,7 @@ from dataclasses import dataclass from collections.abc import Callable, Sequence from types import ModuleType -from typing import Any, Generic, Literal, Protocol, TypeAlias, overload, type_check_only +from typing import Any, Generic, Literal, Protocol, TypeAlias, final, overload, type_check_only from typing_extensions import NamedTuple, Self, TypeVar import numpy as np @@ -109,6 +109,7 @@ _NDT_real_co = TypeVar("_NDT_real_co", covariant=True, bound=float | _RealND, de class _RVSCallable(Protocol): def __call__(self, /, *, size: int | tuple[int, ...]) -> onp.ArrayND[np.floating[Any]]: ... +@final class _SimpleNormal: @overload def cdf(self, /, x: np.bool_ | np.uint8 | np.int8 | np.uint16 | np.int16 | np.float16 | np.float32) -> np.float32: ... @@ -126,6 +127,7 @@ class _SimpleNormal: def cdf(self, /, x: complex) -> np.complex128 | np.float64 | np.float32: ... sf = cdf +@final class _SimpleChi2: df: int def __init__(self, /, df: int) -> None: ... From af2c4588c0eb593c856a4e34a036d0e18d3e9a61 Mon Sep 17 00:00:00 2001 From: jorenham Date: Sat, 23 Nov 2024 21:13:39 +0100 Subject: [PATCH 5/5] workaround false-positive stubtest errors --- scipy-stubs/io/arff/_arffread.pyi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scipy-stubs/io/arff/_arffread.pyi b/scipy-stubs/io/arff/_arffread.pyi index cc508646..0a547198 100644 --- a/scipy-stubs/io/arff/_arffread.pyi +++ b/scipy-stubs/io/arff/_arffread.pyi @@ -29,7 +29,7 @@ class ArffError(OSError): ... class ParseArffError(ArffError): ... class Attribute(Generic[_T_co], metaclass=abc.ABCMeta): - type_name: ClassVar[str] + type_name: ClassVar[str | None] dtype: Any range: Any @@ -41,7 +41,7 @@ class Attribute(Generic[_T_co], metaclass=abc.ABCMeta): def parse_data(self, /, data_str: str) -> _T_co: ... class NominalAttribute(Attribute[str]): - type_name: ClassVar[str] = "nominal" + type_name: ClassVar[str | None] = "nominal" dtype: tuple[type[np.bytes_], ...] range: Sequence[str] @@ -50,17 +50,17 @@ class NominalAttribute(Attribute[str]): def __init__(self, /, name: str, values: Sequence[str]) -> None: ... class NumericAttribute(Attribute[float]): - type_name: ClassVar[str] = "numeric" + type_name: ClassVar[str | None] = "numeric" dtype: type[np.float64] range: None class StringAttribute(Attribute[None]): - type_name: ClassVar[str] = "string" + type_name: ClassVar[str | None] = "string" dtype: type[np.object_] range: None class DateAttribute(Attribute[np.datetime64]): - type_name: ClassVar[str] = "date" + type_name: ClassVar[str | None] = "date" dtype: np.datetime64 range: str @@ -70,7 +70,7 @@ class DateAttribute(Attribute[np.datetime64]): def __init__(self, /, name: str, date_format: str, datetime_unit: str) -> None: ... class RelationalAttribute(Attribute[np.ndarray[tuple[int], np.dtype[np.void]]]): - type_name: ClassVar[str] = "relational" + type_name: ClassVar[str | None] = "relational" dtype: type[np.object_] range: None