diff --git a/.github/workflows/checks-testing.yml b/.github/workflows/checks-testing.yml index 9c61942..889762e 100644 --- a/.github/workflows/checks-testing.yml +++ b/.github/workflows/checks-testing.yml @@ -56,7 +56,7 @@ jobs: - name: Install dependencies and project run: | poetry env use ${{ matrix.python-version }} - poetry install --with test + poetry install --with test --with dev - name: Check with isort run: | poetry run isort --check-only . diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4d0db26..1b4aeb2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -112,7 +112,7 @@ repos: args: ["--rcfile=pyproject.toml"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.991 + rev: v1.0.0 hooks: - id: mypy args: diff --git a/Brewfile.lock.json b/Brewfile.lock.json index 0a759c7..7dbc9c6 100644 --- a/Brewfile.lock.json +++ b/Brewfile.lock.json @@ -46,226 +46,221 @@ } }, "pre-commit": { - "version": "2.21.0", + "version": "3.0.4", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:6f263ff1b1689dbf474b10b6ba7a3177ff93d23d941dd3a02ff4435298cc6bd0", - "sha256": "6f263ff1b1689dbf474b10b6ba7a3177ff93d23d941dd3a02ff4435298cc6bd0" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:9fb4ab83155ae362ec142f0d2758469305af8077bcab2a6cef05eb252cdd6204", + "sha256": "9fb4ab83155ae362ec142f0d2758469305af8077bcab2a6cef05eb252cdd6204" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:6f263ff1b1689dbf474b10b6ba7a3177ff93d23d941dd3a02ff4435298cc6bd0", - "sha256": "6f263ff1b1689dbf474b10b6ba7a3177ff93d23d941dd3a02ff4435298cc6bd0" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:9fb4ab83155ae362ec142f0d2758469305af8077bcab2a6cef05eb252cdd6204", + "sha256": "9fb4ab83155ae362ec142f0d2758469305af8077bcab2a6cef05eb252cdd6204" }, "arm64_big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:6f263ff1b1689dbf474b10b6ba7a3177ff93d23d941dd3a02ff4435298cc6bd0", - "sha256": "6f263ff1b1689dbf474b10b6ba7a3177ff93d23d941dd3a02ff4435298cc6bd0" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:9fb4ab83155ae362ec142f0d2758469305af8077bcab2a6cef05eb252cdd6204", + "sha256": "9fb4ab83155ae362ec142f0d2758469305af8077bcab2a6cef05eb252cdd6204" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:dba52d85b254022a7c38b0da6b4ebdb2c80f247f4bde35cbcc94c2c33e858dca", - "sha256": "dba52d85b254022a7c38b0da6b4ebdb2c80f247f4bde35cbcc94c2c33e858dca" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:6752798daae8b7c64e58da8f470377628d059c0eb2d6906e0dbce971475534c0", + "sha256": "6752798daae8b7c64e58da8f470377628d059c0eb2d6906e0dbce971475534c0" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:dba52d85b254022a7c38b0da6b4ebdb2c80f247f4bde35cbcc94c2c33e858dca", - "sha256": "dba52d85b254022a7c38b0da6b4ebdb2c80f247f4bde35cbcc94c2c33e858dca" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:6752798daae8b7c64e58da8f470377628d059c0eb2d6906e0dbce971475534c0", + "sha256": "6752798daae8b7c64e58da8f470377628d059c0eb2d6906e0dbce971475534c0" }, "big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:dba52d85b254022a7c38b0da6b4ebdb2c80f247f4bde35cbcc94c2c33e858dca", - "sha256": "dba52d85b254022a7c38b0da6b4ebdb2c80f247f4bde35cbcc94c2c33e858dca" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:6752798daae8b7c64e58da8f470377628d059c0eb2d6906e0dbce971475534c0", + "sha256": "6752798daae8b7c64e58da8f470377628d059c0eb2d6906e0dbce971475534c0" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:b7d3dc2b1f79bedf6c2e2bd784db8771a2d3443d14cf28bbcc683d24e7b10b22", - "sha256": "b7d3dc2b1f79bedf6c2e2bd784db8771a2d3443d14cf28bbcc683d24e7b10b22" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:845c19eb90f864a0c2816ed02bc1758b8d6839f63dc601d0d9675bd6781409ca", + "sha256": "845c19eb90f864a0c2816ed02bc1758b8d6839f63dc601d0d9675bd6781409ca" } } } }, "black": { - "version": "22.12.0", + "version": "23.1.0", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:1aa63e750fea5207479cdcd6f08df42758e7c2f1d73f920fd58b74adea251b82", - "sha256": "1aa63e750fea5207479cdcd6f08df42758e7c2f1d73f920fd58b74adea251b82" + "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:ae6062bf90830375e496dfd84eba77d0a9312b909fbba4957e45da3fed54951d", + "sha256": "ae6062bf90830375e496dfd84eba77d0a9312b909fbba4957e45da3fed54951d" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:dd536e8616a2796d75a91f5028842e75175d99383e562a6d323b65e4d0668835", - "sha256": "dd536e8616a2796d75a91f5028842e75175d99383e562a6d323b65e4d0668835" + "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:f6c97cde2c69f0f1df35d1fc618d0cbbda04a7740eff6080790318b3bb37e6c7", + "sha256": "f6c97cde2c69f0f1df35d1fc618d0cbbda04a7740eff6080790318b3bb37e6c7" }, "arm64_big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:ccbf72333258e1a88279f1657709d044f52343f26f8cd982d15b9e7baaeeb0ff", - "sha256": "ccbf72333258e1a88279f1657709d044f52343f26f8cd982d15b9e7baaeeb0ff" + "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:536556660bb74752b01dc7e03ee780f04ba3772f2878eafb526270c1ac123b85", + "sha256": "536556660bb74752b01dc7e03ee780f04ba3772f2878eafb526270c1ac123b85" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:119f90d4c3d908402fc967f3221ad0bbd36fd34702a3616ec486d1773d7fe550", - "sha256": "119f90d4c3d908402fc967f3221ad0bbd36fd34702a3616ec486d1773d7fe550" + "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:ea591a19856673900992a3cf4a5f001bb2d1929de57c92f99c4c0e3f164b3db5", + "sha256": "ea591a19856673900992a3cf4a5f001bb2d1929de57c92f99c4c0e3f164b3db5" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:bd53688ae7595c8fecb2ad7c87e0445f45f81d9dc76c24d0bfbe0eddda0d3c31", - "sha256": "bd53688ae7595c8fecb2ad7c87e0445f45f81d9dc76c24d0bfbe0eddda0d3c31" + "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:6a6cd63250a320792272a7d364d0baf62113ca3f85f75293dc16522bd4d91ab1", + "sha256": "6a6cd63250a320792272a7d364d0baf62113ca3f85f75293dc16522bd4d91ab1" }, "big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:0cda26de6bfc75c744015ad68b806d545f0bf9e924ceade17fa2c75b51585de5", - "sha256": "0cda26de6bfc75c744015ad68b806d545f0bf9e924ceade17fa2c75b51585de5" + "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:e33d1ba1ae0c89f1f4dc3a0918eb03c413768468e023ee8d8faf22cfb8690953", + "sha256": "e33d1ba1ae0c89f1f4dc3a0918eb03c413768468e023ee8d8faf22cfb8690953" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:cd53120baf141cee4ccb67b6c3cfe48f48c8897d5d4d74e929bf44ec4a6f1be2", - "sha256": "cd53120baf141cee4ccb67b6c3cfe48f48c8897d5d4d74e929bf44ec4a6f1be2" + "url": "https://ghcr.io/v2/homebrew/core/black/blobs/sha256:6b0e292dd65039a3c1638410c3b7780cd2ebbf0f5b770a4810ea192447c3a1b3", + "sha256": "6b0e292dd65039a3c1638410c3b7780cd2ebbf0f5b770a4810ea192447c3a1b3" } } } }, "mypy": { - "version": "0.991", + "version": "1.0.0", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:895f00e65b177c34d4b4bcacb81c8d7f44ab9f9a9df88566a8f417b3c998b934", - "sha256": "895f00e65b177c34d4b4bcacb81c8d7f44ab9f9a9df88566a8f417b3c998b934" + "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:a30b53ec14b75490fc5da91f1fe9e568580328469d71ad20c1f5bc81391988f8", + "sha256": "a30b53ec14b75490fc5da91f1fe9e568580328469d71ad20c1f5bc81391988f8" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:22ff690ce4f975ad294d7955323da8fbe809b6281851bd157b9620839ed8bbbf", - "sha256": "22ff690ce4f975ad294d7955323da8fbe809b6281851bd157b9620839ed8bbbf" + "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:5f59be1f67a878b27f0ffbf2991012cfc30092d01e1f21063ca2113325ef6142", + "sha256": "5f59be1f67a878b27f0ffbf2991012cfc30092d01e1f21063ca2113325ef6142" }, "arm64_big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:4047975ce033bf2bda81b888ed622a7cf3d936240731df891a0a746dd57b316a", - "sha256": "4047975ce033bf2bda81b888ed622a7cf3d936240731df891a0a746dd57b316a" + "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:e98a1bd593d47324a96910e6fd4bc94dfac69c0f4e648ecad7fbcef113de5e5f", + "sha256": "e98a1bd593d47324a96910e6fd4bc94dfac69c0f4e648ecad7fbcef113de5e5f" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:864a08160980218aeac27ce109f9225cd3135a77f60c6eb3c44af4a13aed3ff6", - "sha256": "864a08160980218aeac27ce109f9225cd3135a77f60c6eb3c44af4a13aed3ff6" + "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:fa8f3048f48f3c0ab9cccc80e1bf847881a749caced499e59f072e1ff799729a", + "sha256": "fa8f3048f48f3c0ab9cccc80e1bf847881a749caced499e59f072e1ff799729a" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:02f44a88333b0a6f09eedc9c653b7d547db18e0256b0fab3e7ab0b44853d716a", - "sha256": "02f44a88333b0a6f09eedc9c653b7d547db18e0256b0fab3e7ab0b44853d716a" + "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:a134bb8a72aa87fbd78cce0d2412d2335e8341699b2fb7902ae68d2e9a849018", + "sha256": "a134bb8a72aa87fbd78cce0d2412d2335e8341699b2fb7902ae68d2e9a849018" }, "big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:b5e8e1a568aa9ce995fd07dcd11320dd9eae8b254c6c67a91615691b3539c9c4", - "sha256": "b5e8e1a568aa9ce995fd07dcd11320dd9eae8b254c6c67a91615691b3539c9c4" - }, - "catalina": { - "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:582e4f03123861d5d3831353452f440b96f169a45c44f221d64b96b078884661", - "sha256": "582e4f03123861d5d3831353452f440b96f169a45c44f221d64b96b078884661" + "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:249d2210d15e6ebf22810c8c3055a40c607ffc1cf68066e3e4240a497d8c5b70", + "sha256": "249d2210d15e6ebf22810c8c3055a40c607ffc1cf68066e3e4240a497d8c5b70" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:a38066ed71085b2af0027ce142024c02d06bc57ac2631dd06c57913ae5d8f7fe", - "sha256": "a38066ed71085b2af0027ce142024c02d06bc57ac2631dd06c57913ae5d8f7fe" + "url": "https://ghcr.io/v2/homebrew/core/mypy/blobs/sha256:51aa3f4ca2d97e9be631b099faa3fa52a2122de31b3a46031aa5aed0ef93ac1e", + "sha256": "51aa3f4ca2d97e9be631b099faa3fa52a2122de31b3a46031aa5aed0ef93ac1e" } } } }, "pylint": { - "version": "2.15.10", + "version": "2.16.1", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:0e6f61b221dad13a1d8626337f0fe0ba9b9b68b65e05c792390caece1cc81da7", - "sha256": "0e6f61b221dad13a1d8626337f0fe0ba9b9b68b65e05c792390caece1cc81da7" + "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:9138cae2ea7c1c6221b7d9eca9bb8643230c900bf5774811185773c1adccdab7", + "sha256": "9138cae2ea7c1c6221b7d9eca9bb8643230c900bf5774811185773c1adccdab7" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:6a0964ce79dc81dea582aa54812fc36e982416f9beb62f8f08391e68107592ea", - "sha256": "6a0964ce79dc81dea582aa54812fc36e982416f9beb62f8f08391e68107592ea" + "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:fc11ebc2f9e6b9d44078d3742aa03a17f3bb6f47819cc9cd513a17df782bf2a2", + "sha256": "fc11ebc2f9e6b9d44078d3742aa03a17f3bb6f47819cc9cd513a17df782bf2a2" }, "arm64_big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:62395eba374ccd9bd53f2626ff77ae525e2d48a96ddc0dd15c574286b375d72a", - "sha256": "62395eba374ccd9bd53f2626ff77ae525e2d48a96ddc0dd15c574286b375d72a" + "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:913f230e47b8c2004fdf7f24b74dec42cd2c21f57510ff56d4b5f26a0ef3ae16", + "sha256": "913f230e47b8c2004fdf7f24b74dec42cd2c21f57510ff56d4b5f26a0ef3ae16" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:edfb93568ff4ab44f3f0fcb4340f2157218f01f249632d1bc699259d94891e6b", - "sha256": "edfb93568ff4ab44f3f0fcb4340f2157218f01f249632d1bc699259d94891e6b" + "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:64fd2f4c68256b5e562b042d56bac97cd3d95d092ad69e438bab7862ec61e826", + "sha256": "64fd2f4c68256b5e562b042d56bac97cd3d95d092ad69e438bab7862ec61e826" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:1635bb1741b882582b57767f0c45f2c3515fdff355583ad3af302241c988c51e", - "sha256": "1635bb1741b882582b57767f0c45f2c3515fdff355583ad3af302241c988c51e" + "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:bc1c892920e6fd18cdc806844fbbe7a75eead32ffc66d613a41139d7c4d41ec2", + "sha256": "bc1c892920e6fd18cdc806844fbbe7a75eead32ffc66d613a41139d7c4d41ec2" }, "big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:14a47f5982b778348ca57bffd067943e4d32a66a9e5205fc32dd102c4308c353", - "sha256": "14a47f5982b778348ca57bffd067943e4d32a66a9e5205fc32dd102c4308c353" + "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:d45e43f454387892c19f22acd7f61c5717132e0f6b8af92059a442a58f3f1d64", + "sha256": "d45e43f454387892c19f22acd7f61c5717132e0f6b8af92059a442a58f3f1d64" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:c661479d7f2b22e02f5609464e7875d720a840a52e513cfb71b01ae2cd80f292", - "sha256": "c661479d7f2b22e02f5609464e7875d720a840a52e513cfb71b01ae2cd80f292" + "url": "https://ghcr.io/v2/homebrew/core/pylint/blobs/sha256:fb2b3142c79d1e9909f79addb413ab111ab4d6edd6bc04279d016f967dfdb19d", + "sha256": "fb2b3142c79d1e9909f79addb413ab111ab4d6edd6bc04279d016f967dfdb19d" } } } }, "isort": { - "version": "5.11.4", + "version": "5.12.0", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:94af0d1b4bac94356a51f88cd8d66c6a2b8ee3981c3ea1965518a043f95856a3", - "sha256": "94af0d1b4bac94356a51f88cd8d66c6a2b8ee3981c3ea1965518a043f95856a3" + "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:9ef29d8c4cf23dc882bc6c9e9557f3768c9958542158f6edd203b9be08a7c34d", + "sha256": "9ef29d8c4cf23dc882bc6c9e9557f3768c9958542158f6edd203b9be08a7c34d" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:36013e7c59d87b8e3f92fe31a5eb86407ee61336f34e7d05677c4f9d115e080d", - "sha256": "36013e7c59d87b8e3f92fe31a5eb86407ee61336f34e7d05677c4f9d115e080d" + "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:8db78503c60295ff50a1808f6b0fa0ca2a6c414c861385eb4e2f840c25e41513", + "sha256": "8db78503c60295ff50a1808f6b0fa0ca2a6c414c861385eb4e2f840c25e41513" }, "arm64_big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:1b24e0130404440bdd7687316b68b3eab7fce73e924c5084ba114c611a82d380", - "sha256": "1b24e0130404440bdd7687316b68b3eab7fce73e924c5084ba114c611a82d380" + "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:77befe934c459a512ba42ec882928f6560ef7a7e4973ce58067d53bcea9e37e5", + "sha256": "77befe934c459a512ba42ec882928f6560ef7a7e4973ce58067d53bcea9e37e5" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:1595d7c52269c275beb673eff398eb87e5904e35de6efe369945507ee0a51426", - "sha256": "1595d7c52269c275beb673eff398eb87e5904e35de6efe369945507ee0a51426" + "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:20d60ae5afe0f3b9ad6d83e3bb862631eee8f5d567ecaa988bf69f4534beefb1", + "sha256": "20d60ae5afe0f3b9ad6d83e3bb862631eee8f5d567ecaa988bf69f4534beefb1" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:c89d32db7a376a13d06d5d675df72457476048a8b9dc10e3c042b1ef2b0ca0c1", - "sha256": "c89d32db7a376a13d06d5d675df72457476048a8b9dc10e3c042b1ef2b0ca0c1" + "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:1664136b00f4ae23f07c20f36a0a0303e8f8480910905e398e0febea56239c33", + "sha256": "1664136b00f4ae23f07c20f36a0a0303e8f8480910905e398e0febea56239c33" }, "big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:bd687d2bc483df4e8e550d138e57169591b472d404e061d256d4adcb8e8fcc67", - "sha256": "bd687d2bc483df4e8e550d138e57169591b472d404e061d256d4adcb8e8fcc67" + "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:d633c35d1ee149d1fb5fc0ac262c5fc30539363fd952a041ec4939cb1808a718", + "sha256": "d633c35d1ee149d1fb5fc0ac262c5fc30539363fd952a041ec4939cb1808a718" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:952ab7c281a259090b4066d1dc3b95372b817afe617774356eef0b952d953256", - "sha256": "952ab7c281a259090b4066d1dc3b95372b817afe617774356eef0b952d953256" + "url": "https://ghcr.io/v2/homebrew/core/isort/blobs/sha256:f5be5b318a34e64f4c13388e7fe8582eae88a5557fe6632d8ed402d3ff071c79", + "sha256": "f5be5b318a34e64f4c13388e7fe8582eae88a5557fe6632d8ed402d3ff071c79" } } } @@ -281,6 +276,14 @@ "CLT": "14.2.0.0.1.1668646533", "Xcode": "14.1", "macOS": "12.6.1" + }, + "ventura": { + "HOMEBREW_VERSION": "3.6.21", + "HOMEBREW_PREFIX": "/opt/homebrew", + "Homebrew/homebrew-core": "5fa8ba5038b183d54bd2238169e4cac950e26f16", + "CLT": "14.2.0.0.1.1668646533", + "Xcode": "14.1", + "macOS": "13.2" } } } diff --git a/docs/README.md b/docs/README.md index e8382b8..04b367d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -49,6 +49,7 @@ poetry install | [`dumbbell`](https://invia-flights.github.io/blitzly/plots/dumbbell/) | [`simple_dumbbell`](https://invia-flights.github.io/blitzly/plots/dumbbell/#blitzly.plots.dumbbell.simple_dumbbell) | Plots a dumbbell plot. This can be used to compare two columns of data to visualize changes. | | [`histogram`](https://invia-flights.github.io/blitzly/plots/histogram/) | [`simple_histogram`](https://invia-flights.github.io/blitzly/plots/histogram/#blitzly.plots.histogram.simple_histogram) | Plots a histogram with one ore more distributions. | | [`matrix`](https://invia-flights.github.io/blitzly/plots/matrix/) | [`binary_confusion_matrix`](https://invia-flights.github.io/blitzly/plots/matrix/#blitzly.plots.matrix.binary_confusion_matrix) | Plots a confusion matrix for binary classification data. | +| [`matrix`](https://invia-flights.github.io/blitzly/plots/matrix/) | [`cramers_v_corr_matrix`](https://invia-flights.github.io/blitzly/plots/matrix/#blitzly.plots.matrix.cramers_v_corr_matrix) | Cramer's V correlation for categorical features. | | [`matrix`](https://invia-flights.github.io/blitzly/plots/matrix/) | [`pearson_corr_matrix`](https://invia-flights.github.io/blitzly/plots/matrix/#blitzly.plots.matrix.pearson_corr_matrix) | Plots a Pearson product-moment correlation coefficients matrix. | | [`scatter`](https://invia-flights.github.io/blitzly/plots/scatter/) | [`scatter_matrix`](https://invia-flights.github.io/blitzly/plots/scatter/#blitzly.plots.scatter.scatter_matrix) | Plots a scatter matrix. | | [`scatter`](https://invia-flights.github.io/blitzly/plots/scatter/) | [`multi_scatter`](https://invia-flights.github.io/blitzly/plots/scatter/#blitzly.plots.scatter.multi_scatter) | Create a multi scatter plot. It can be used to visualize the relationship between multiple variables from the same Pandas DataFrame. | diff --git a/poetry.lock b/poetry.lock index 6abb7f5..c95486f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1106,42 +1106,38 @@ mkdocstrings = ">=0.19" [[package]] name = "mypy" -version = "0.991" +version = "1.0.0" description = "Optional static typing for Python" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "mypy-0.991-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7d17e0a9707d0772f4a7b878f04b4fd11f6f5bcb9b3813975a9b13c9332153ab"}, - {file = "mypy-0.991-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0714258640194d75677e86c786e80ccf294972cc76885d3ebbb560f11db0003d"}, - {file = "mypy-0.991-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0c8f3be99e8a8bd403caa8c03be619544bc2c77a7093685dcf308c6b109426c6"}, - {file = "mypy-0.991-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc9ec663ed6c8f15f4ae9d3c04c989b744436c16d26580eaa760ae9dd5d662eb"}, - {file = "mypy-0.991-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4307270436fd7694b41f913eb09210faff27ea4979ecbcd849e57d2da2f65305"}, - {file = "mypy-0.991-cp310-cp310-win_amd64.whl", hash = "sha256:901c2c269c616e6cb0998b33d4adbb4a6af0ac4ce5cd078afd7bc95830e62c1c"}, - {file = "mypy-0.991-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d13674f3fb73805ba0c45eb6c0c3053d218aa1f7abead6e446d474529aafc372"}, - {file = "mypy-0.991-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1c8cd4fb70e8584ca1ed5805cbc7c017a3d1a29fb450621089ffed3e99d1857f"}, - {file = "mypy-0.991-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:209ee89fbb0deed518605edddd234af80506aec932ad28d73c08f1400ef80a33"}, - {file = "mypy-0.991-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37bd02ebf9d10e05b00d71302d2c2e6ca333e6c2a8584a98c00e038db8121f05"}, - {file = "mypy-0.991-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:26efb2fcc6b67e4d5a55561f39176821d2adf88f2745ddc72751b7890f3194ad"}, - {file = "mypy-0.991-cp311-cp311-win_amd64.whl", hash = "sha256:3a700330b567114b673cf8ee7388e949f843b356a73b5ab22dd7cff4742a5297"}, - {file = "mypy-0.991-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:1f7d1a520373e2272b10796c3ff721ea1a0712288cafaa95931e66aa15798813"}, - {file = "mypy-0.991-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:641411733b127c3e0dab94c45af15fea99e4468f99ac88b39efb1ad677da5711"}, - {file = "mypy-0.991-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:3d80e36b7d7a9259b740be6d8d906221789b0d836201af4234093cae89ced0cd"}, - {file = "mypy-0.991-cp37-cp37m-win_amd64.whl", hash = "sha256:e62ebaad93be3ad1a828a11e90f0e76f15449371ffeecca4a0a0b9adc99abcef"}, - {file = "mypy-0.991-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:b86ce2c1866a748c0f6faca5232059f881cda6dda2a893b9a8373353cfe3715a"}, - {file = "mypy-0.991-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ac6e503823143464538efda0e8e356d871557ef60ccd38f8824a4257acc18d93"}, - {file = "mypy-0.991-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0cca5adf694af539aeaa6ac633a7afe9bbd760df9d31be55ab780b77ab5ae8bf"}, - {file = "mypy-0.991-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a12c56bf73cdab116df96e4ff39610b92a348cc99a1307e1da3c3768bbb5b135"}, - {file = "mypy-0.991-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:652b651d42f155033a1967739788c436491b577b6a44e4c39fb340d0ee7f0d70"}, - {file = "mypy-0.991-cp38-cp38-win_amd64.whl", hash = "sha256:4175593dc25d9da12f7de8de873a33f9b2b8bdb4e827a7cae952e5b1a342e243"}, - {file = "mypy-0.991-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:98e781cd35c0acf33eb0295e8b9c55cdbef64fcb35f6d3aa2186f289bed6e80d"}, - {file = "mypy-0.991-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6d7464bac72a85cb3491c7e92b5b62f3dcccb8af26826257760a552a5e244aa5"}, - {file = "mypy-0.991-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c9166b3f81a10cdf9b49f2d594b21b31adadb3d5e9db9b834866c3258b695be3"}, - {file = "mypy-0.991-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8472f736a5bfb159a5e36740847808f6f5b659960115ff29c7cecec1741c648"}, - {file = "mypy-0.991-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e80e758243b97b618cdf22004beb09e8a2de1af481382e4d84bc52152d1c476"}, - {file = "mypy-0.991-cp39-cp39-win_amd64.whl", hash = "sha256:74e259b5c19f70d35fcc1ad3d56499065c601dfe94ff67ae48b85596b9ec1461"}, - {file = "mypy-0.991-py3-none-any.whl", hash = "sha256:de32edc9b0a7e67c2775e574cb061a537660e51210fbf6006b0b36ea695ae9bb"}, - {file = "mypy-0.991.tar.gz", hash = "sha256:3c0165ba8f354a6d9881809ef29f1a9318a236a6d81c690094c5df32107bde06"}, + {file = "mypy-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0626db16705ab9f7fa6c249c017c887baf20738ce7f9129da162bb3075fc1af"}, + {file = "mypy-1.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1ace23f6bb4aec4604b86c4843276e8fa548d667dbbd0cb83a3ae14b18b2db6c"}, + {file = "mypy-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87edfaf344c9401942883fad030909116aa77b0fa7e6e8e1c5407e14549afe9a"}, + {file = "mypy-1.0.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0ab090d9240d6b4e99e1fa998c2d0aa5b29fc0fb06bd30e7ad6183c95fa07593"}, + {file = "mypy-1.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:7cc2c01dfc5a3cbddfa6c13f530ef3b95292f926329929001d45e124342cd6b7"}, + {file = "mypy-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:14d776869a3e6c89c17eb943100f7868f677703c8a4e00b3803918f86aafbc52"}, + {file = "mypy-1.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bb2782a036d9eb6b5a6efcdda0986774bf798beef86a62da86cb73e2a10b423d"}, + {file = "mypy-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5cfca124f0ac6707747544c127880893ad72a656e136adc935c8600740b21ff5"}, + {file = "mypy-1.0.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8845125d0b7c57838a10fd8925b0f5f709d0e08568ce587cc862aacce453e3dd"}, + {file = "mypy-1.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:01b1b9e1ed40544ef486fa8ac022232ccc57109f379611633ede8e71630d07d2"}, + {file = "mypy-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c7cf862aef988b5fbaa17764ad1d21b4831436701c7d2b653156a9497d92c83c"}, + {file = "mypy-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5cd187d92b6939617f1168a4fe68f68add749902c010e66fe574c165c742ed88"}, + {file = "mypy-1.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:4e5175026618c178dfba6188228b845b64131034ab3ba52acaffa8f6c361f805"}, + {file = "mypy-1.0.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2f6ac8c87e046dc18c7d1d7f6653a66787a4555085b056fe2d599f1f1a2a2d21"}, + {file = "mypy-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7306edca1c6f1b5fa0bc9aa645e6ac8393014fa82d0fa180d0ebc990ebe15964"}, + {file = "mypy-1.0.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3cfad08f16a9c6611e6143485a93de0e1e13f48cfb90bcad7d5fde1c0cec3d36"}, + {file = "mypy-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67cced7f15654710386e5c10b96608f1ee3d5c94ca1da5a2aad5889793a824c1"}, + {file = "mypy-1.0.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:a86b794e8a56ada65c573183756eac8ac5b8d3d59daf9d5ebd72ecdbb7867a43"}, + {file = "mypy-1.0.0-cp38-cp38-win_amd64.whl", hash = "sha256:50979d5efff8d4135d9db293c6cb2c42260e70fb010cbc697b1311a4d7a39ddb"}, + {file = "mypy-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3ae4c7a99e5153496243146a3baf33b9beff714464ca386b5f62daad601d87af"}, + {file = "mypy-1.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5e398652d005a198a7f3c132426b33c6b85d98aa7dc852137a2a3be8890c4072"}, + {file = "mypy-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be78077064d016bc1b639c2cbcc5be945b47b4261a4f4b7d8923f6c69c5c9457"}, + {file = "mypy-1.0.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:92024447a339400ea00ac228369cd242e988dd775640755fa4ac0c126e49bb74"}, + {file = "mypy-1.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:fe523fcbd52c05040c7bee370d66fee8373c5972171e4fbc323153433198592d"}, + {file = "mypy-1.0.0-py3-none-any.whl", hash = "sha256:2efa963bdddb27cb4a0d42545cd137a8d2b883bd181bbc4525b568ef6eca258f"}, + {file = "mypy-1.0.0.tar.gz", hash = "sha256:f34495079c8d9da05b183f9f7daec2878280c2ad7cc81da686ef0b484cea2ecf"}, ] [package.dependencies] @@ -1474,19 +1470,19 @@ files = [ [[package]] name = "platformdirs" -version = "2.6.2" +version = "3.0.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-2.6.2-py3-none-any.whl", hash = "sha256:83c8f6d04389165de7c9b6f0c682439697887bca0aa2f1c87ef1826be3584490"}, - {file = "platformdirs-2.6.2.tar.gz", hash = "sha256:e1fea1fe471b9ff8332e229df3cb7de4f53eeea4998d3b6bfff542115e998bd2"}, + {file = "platformdirs-3.0.0-py3-none-any.whl", hash = "sha256:b1d5eb14f221506f50d6604a561f4c5786d9e80355219694a1b244bcd96f4567"}, + {file = "platformdirs-3.0.0.tar.gz", hash = "sha256:8a1228abb1ef82d788f74139988b137e78692984ec7b08eaa6c65f1723af28f9"}, ] [package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.5)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] [[package]] name = "plotly" @@ -1521,14 +1517,14 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "2.21.0" +version = "3.0.4" description = "A framework for managing and maintaining multi-language pre-commit hooks." category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pre_commit-2.21.0-py2.py3-none-any.whl", hash = "sha256:e2f91727039fc39a92f58a588a25b87f936de6567eed4f0e673e0507edc75bad"}, - {file = "pre_commit-2.21.0.tar.gz", hash = "sha256:31ef31af7e474a8d8995027fefdfcf509b5c913ff31f2015b4ec4beb26a6f658"}, + {file = "pre_commit-3.0.4-py2.py3-none-any.whl", hash = "sha256:9e3255edb0c9e7fe9b4f328cb3dc86069f8fdc38026f1bf521018a05eaf4d67b"}, + {file = "pre_commit-3.0.4.tar.gz", hash = "sha256:bc4687478d55578c4ac37272fe96df66f73d9b5cf81be6f28627d4e712e752d5"}, ] [package.dependencies] @@ -2150,14 +2146,14 @@ pbr = ">=2.0.0,<2.1.0 || >2.1.0" [[package]] name = "tenacity" -version = "8.1.0" +version = "8.2.0" description = "Retry code until it succeeds" category = "main" optional = false python-versions = ">=3.6" files = [ - {file = "tenacity-8.1.0-py3-none-any.whl", hash = "sha256:35525cd47f82830069f0d6b73f7eb83bc5b73ee2fff0437952cedf98b27653ac"}, - {file = "tenacity-8.1.0.tar.gz", hash = "sha256:e48c437fdf9340f5666b92cd7990e96bc5fc955e1298baf4a907e3972067a445"}, + {file = "tenacity-8.2.0-py3-none-any.whl", hash = "sha256:b723061a78ed0f4524190eae321d3d84100227d51c5677035b6615d91895e0d6"}, + {file = "tenacity-8.2.0.tar.gz", hash = "sha256:a43bcd8910406e0884ca0db3db7bed581f389c1d05165e992a1ddabfc81df05e"}, ] [package.extras] @@ -2258,20 +2254,20 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "virtualenv" -version = "20.18.0" +version = "20.19.0" description = "Virtual Python Environment builder" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.18.0-py3-none-any.whl", hash = "sha256:9d61e4ec8d2c0345dab329fb825eb05579043766a4b26a2f66b28948de68c722"}, - {file = "virtualenv-20.18.0.tar.gz", hash = "sha256:f262457a4d7298a6b733b920a196bf8b46c8af15bf1fd9da7142995eff15118e"}, + {file = "virtualenv-20.19.0-py3-none-any.whl", hash = "sha256:54eb59e7352b573aa04d53f80fc9736ed0ad5143af445a1e539aada6eb947dd1"}, + {file = "virtualenv-20.19.0.tar.gz", hash = "sha256:37a640ba82ed40b226599c522d411e4be5edb339a0c0de030c0dc7b646d61590"}, ] [package.dependencies] distlib = ">=0.3.6,<1" filelock = ">=3.4.1,<4" -platformdirs = ">=2.4,<3" +platformdirs = ">=2.4,<4" [package.extras] docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=22.12)"] @@ -2422,4 +2418,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.12" -content-hash = "e31533f6de08bc170435d6902b3ff9853034703ed0dc87d12f81016d99ec0577" +content-hash = "3f5388a2841232dbfb5f37a29d6fc5081872905756989904bd49d651df5c8c60" diff --git a/pyproject.toml b/pyproject.toml index c37334b..a6d79d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,10 +51,10 @@ kaleido = "0.2.1" [tool.poetry.group.dev.dependencies] black = {extras = ["jupyter"], version = "^23.1.0"} bandit = "^1.7.4" -isort = "^5.11.4" -mypy = "^0.991" -pylint = "^2.15.10" -pre-commit = "^2.21.0" +isort = "^5.12.0" +mypy = "^1.0.0" +pylint = "^2.16.1" +pre-commit = "^3.0.4" nbstripout = "^0.6.1" ssort = "^0.11.6" @@ -106,10 +106,6 @@ warn_return_any = false no_namespace_packages = true exclude = ["tests", "docs"] -[tool.black] -target-version = ['py311'] - - [tool.isort] profile = "black" skip_glob = ["docs/*"] diff --git a/requirements.txt b/requirements.txt index 9947d2e..a0fee7b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -151,37 +151,33 @@ mdurl==0.1.2 ; python_version >= "3.8" and python_version < "3.12" \ mypy-extensions==1.0.0 ; python_version >= "3.8" and python_version < "3.12" \ --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 -mypy==0.991 ; python_version >= "3.8" and python_version < "3.12" \ - --hash=sha256:0714258640194d75677e86c786e80ccf294972cc76885d3ebbb560f11db0003d \ - --hash=sha256:0c8f3be99e8a8bd403caa8c03be619544bc2c77a7093685dcf308c6b109426c6 \ - --hash=sha256:0cca5adf694af539aeaa6ac633a7afe9bbd760df9d31be55ab780b77ab5ae8bf \ - --hash=sha256:1c8cd4fb70e8584ca1ed5805cbc7c017a3d1a29fb450621089ffed3e99d1857f \ - --hash=sha256:1f7d1a520373e2272b10796c3ff721ea1a0712288cafaa95931e66aa15798813 \ - --hash=sha256:209ee89fbb0deed518605edddd234af80506aec932ad28d73c08f1400ef80a33 \ - --hash=sha256:26efb2fcc6b67e4d5a55561f39176821d2adf88f2745ddc72751b7890f3194ad \ - --hash=sha256:37bd02ebf9d10e05b00d71302d2c2e6ca333e6c2a8584a98c00e038db8121f05 \ - --hash=sha256:3a700330b567114b673cf8ee7388e949f843b356a73b5ab22dd7cff4742a5297 \ - --hash=sha256:3c0165ba8f354a6d9881809ef29f1a9318a236a6d81c690094c5df32107bde06 \ - --hash=sha256:3d80e36b7d7a9259b740be6d8d906221789b0d836201af4234093cae89ced0cd \ - --hash=sha256:4175593dc25d9da12f7de8de873a33f9b2b8bdb4e827a7cae952e5b1a342e243 \ - --hash=sha256:4307270436fd7694b41f913eb09210faff27ea4979ecbcd849e57d2da2f65305 \ - --hash=sha256:5e80e758243b97b618cdf22004beb09e8a2de1af481382e4d84bc52152d1c476 \ - --hash=sha256:641411733b127c3e0dab94c45af15fea99e4468f99ac88b39efb1ad677da5711 \ - --hash=sha256:652b651d42f155033a1967739788c436491b577b6a44e4c39fb340d0ee7f0d70 \ - --hash=sha256:6d7464bac72a85cb3491c7e92b5b62f3dcccb8af26826257760a552a5e244aa5 \ - --hash=sha256:74e259b5c19f70d35fcc1ad3d56499065c601dfe94ff67ae48b85596b9ec1461 \ - --hash=sha256:7d17e0a9707d0772f4a7b878f04b4fd11f6f5bcb9b3813975a9b13c9332153ab \ - --hash=sha256:901c2c269c616e6cb0998b33d4adbb4a6af0ac4ce5cd078afd7bc95830e62c1c \ - --hash=sha256:98e781cd35c0acf33eb0295e8b9c55cdbef64fcb35f6d3aa2186f289bed6e80d \ - --hash=sha256:a12c56bf73cdab116df96e4ff39610b92a348cc99a1307e1da3c3768bbb5b135 \ - --hash=sha256:ac6e503823143464538efda0e8e356d871557ef60ccd38f8824a4257acc18d93 \ - --hash=sha256:b8472f736a5bfb159a5e36740847808f6f5b659960115ff29c7cecec1741c648 \ - --hash=sha256:b86ce2c1866a748c0f6faca5232059f881cda6dda2a893b9a8373353cfe3715a \ - --hash=sha256:bc9ec663ed6c8f15f4ae9d3c04c989b744436c16d26580eaa760ae9dd5d662eb \ - --hash=sha256:c9166b3f81a10cdf9b49f2d594b21b31adadb3d5e9db9b834866c3258b695be3 \ - --hash=sha256:d13674f3fb73805ba0c45eb6c0c3053d218aa1f7abead6e446d474529aafc372 \ - --hash=sha256:de32edc9b0a7e67c2775e574cb061a537660e51210fbf6006b0b36ea695ae9bb \ - --hash=sha256:e62ebaad93be3ad1a828a11e90f0e76f15449371ffeecca4a0a0b9adc99abcef +mypy==1.0.0 ; python_version >= "3.8" and python_version < "3.12" \ + --hash=sha256:01b1b9e1ed40544ef486fa8ac022232ccc57109f379611633ede8e71630d07d2 \ + --hash=sha256:0ab090d9240d6b4e99e1fa998c2d0aa5b29fc0fb06bd30e7ad6183c95fa07593 \ + --hash=sha256:14d776869a3e6c89c17eb943100f7868f677703c8a4e00b3803918f86aafbc52 \ + --hash=sha256:1ace23f6bb4aec4604b86c4843276e8fa548d667dbbd0cb83a3ae14b18b2db6c \ + --hash=sha256:2efa963bdddb27cb4a0d42545cd137a8d2b883bd181bbc4525b568ef6eca258f \ + --hash=sha256:2f6ac8c87e046dc18c7d1d7f6653a66787a4555085b056fe2d599f1f1a2a2d21 \ + --hash=sha256:3ae4c7a99e5153496243146a3baf33b9beff714464ca386b5f62daad601d87af \ + --hash=sha256:3cfad08f16a9c6611e6143485a93de0e1e13f48cfb90bcad7d5fde1c0cec3d36 \ + --hash=sha256:4e5175026618c178dfba6188228b845b64131034ab3ba52acaffa8f6c361f805 \ + --hash=sha256:50979d5efff8d4135d9db293c6cb2c42260e70fb010cbc697b1311a4d7a39ddb \ + --hash=sha256:5cd187d92b6939617f1168a4fe68f68add749902c010e66fe574c165c742ed88 \ + --hash=sha256:5cfca124f0ac6707747544c127880893ad72a656e136adc935c8600740b21ff5 \ + --hash=sha256:5e398652d005a198a7f3c132426b33c6b85d98aa7dc852137a2a3be8890c4072 \ + --hash=sha256:67cced7f15654710386e5c10b96608f1ee3d5c94ca1da5a2aad5889793a824c1 \ + --hash=sha256:7306edca1c6f1b5fa0bc9aa645e6ac8393014fa82d0fa180d0ebc990ebe15964 \ + --hash=sha256:7cc2c01dfc5a3cbddfa6c13f530ef3b95292f926329929001d45e124342cd6b7 \ + --hash=sha256:87edfaf344c9401942883fad030909116aa77b0fa7e6e8e1c5407e14549afe9a \ + --hash=sha256:8845125d0b7c57838a10fd8925b0f5f709d0e08568ce587cc862aacce453e3dd \ + --hash=sha256:92024447a339400ea00ac228369cd242e988dd775640755fa4ac0c126e49bb74 \ + --hash=sha256:a86b794e8a56ada65c573183756eac8ac5b8d3d59daf9d5ebd72ecdbb7867a43 \ + --hash=sha256:bb2782a036d9eb6b5a6efcdda0986774bf798beef86a62da86cb73e2a10b423d \ + --hash=sha256:be78077064d016bc1b639c2cbcc5be945b47b4261a4f4b7d8923f6c69c5c9457 \ + --hash=sha256:c7cf862aef988b5fbaa17764ad1d21b4831436701c7d2b653156a9497d92c83c \ + --hash=sha256:e0626db16705ab9f7fa6c249c017c887baf20738ce7f9129da162bb3075fc1af \ + --hash=sha256:f34495079c8d9da05b183f9f7daec2878280c2ad7cc81da686ef0b484cea2ecf \ + --hash=sha256:fe523fcbd52c05040c7bee370d66fee8373c5972171e4fbc323153433198592d nbformat==5.7.2 ; python_version >= "3.8" and python_version < "3.12" \ --hash=sha256:36340fa5c0bbcbf3fec3473414e6ca7eb872df83a80bc108d2875afd6af99586 \ --hash=sha256:796469290e50e1bf9c19a55ca4fbe66319d99349e47ab94780247edde4bd7618 @@ -269,15 +265,15 @@ pickleshare==0.7.5 ; python_version >= "3.8" and python_version < "3.12" \ pkgutil-resolve-name==1.3.10 ; python_version >= "3.8" and python_version < "3.9" \ --hash=sha256:357d6c9e6a755653cfd78893817c0853af365dd51ec97f3d358a819373bbd174 \ --hash=sha256:ca27cc078d25c5ad71a9de0a7a330146c4e014c2462d9af19c6b828280649c5e -platformdirs==2.6.2 ; python_version >= "3.8" and python_version < "3.12" \ - --hash=sha256:83c8f6d04389165de7c9b6f0c682439697887bca0aa2f1c87ef1826be3584490 \ - --hash=sha256:e1fea1fe471b9ff8332e229df3cb7de4f53eeea4998d3b6bfff542115e998bd2 +platformdirs==3.0.0 ; python_version >= "3.8" and python_version < "3.12" \ + --hash=sha256:8a1228abb1ef82d788f74139988b137e78692984ec7b08eaa6c65f1723af28f9 \ + --hash=sha256:b1d5eb14f221506f50d6604a561f4c5786d9e80355219694a1b244bcd96f4567 plotly==5.11.0 ; python_version >= "3.8" and python_version < "3.12" \ --hash=sha256:4efef479c2ec1d86dcdac8405b6ca70ca65649a77408e39a7e84a1ea2db6c787 \ --hash=sha256:52fd74b08aa4fd5a55b9d3034a30dbb746e572d7ed84897422f927fdf687ea5f -pre-commit==2.21.0 ; python_version >= "3.8" and python_version < "3.12" \ - --hash=sha256:31ef31af7e474a8d8995027fefdfcf509b5c913ff31f2015b4ec4beb26a6f658 \ - --hash=sha256:e2f91727039fc39a92f58a588a25b87f936de6567eed4f0e673e0507edc75bad +pre-commit==3.0.4 ; python_version >= "3.8" and python_version < "3.12" \ + --hash=sha256:9e3255edb0c9e7fe9b4f328cb3dc86069f8fdc38026f1bf521018a05eaf4d67b \ + --hash=sha256:bc4687478d55578c4ac37272fe96df66f73d9b5cf81be6f28627d4e712e752d5 prompt-toolkit==3.0.36 ; python_version >= "3.8" and python_version < "3.12" \ --hash=sha256:3e163f254bef5a03b146397d7c1963bd3e2812f0964bb9a24e6ec761fd28db63 \ --hash=sha256:aa64ad242a462c5ff0363a7b9cfe696c20d55d9fc60c11fd8e632d064804d305 @@ -447,9 +443,9 @@ stack-data==0.6.2 ; python_version >= "3.8" and python_version < "3.12" \ stevedore==4.1.1 ; python_version >= "3.8" and python_version < "3.12" \ --hash=sha256:7f8aeb6e3f90f96832c301bff21a7eb5eefbe894c88c506483d355565d88cc1a \ --hash=sha256:aa6436565c069b2946fe4ebff07f5041e0c8bf18c7376dd29edf80cf7d524e4e -tenacity==8.1.0 ; python_version >= "3.8" and python_version < "3.12" \ - --hash=sha256:35525cd47f82830069f0d6b73f7eb83bc5b73ee2fff0437952cedf98b27653ac \ - --hash=sha256:e48c437fdf9340f5666b92cd7990e96bc5fc955e1298baf4a907e3972067a445 +tenacity==8.2.0 ; python_version >= "3.8" and python_version < "3.12" \ + --hash=sha256:a43bcd8910406e0884ca0db3db7bed581f389c1d05165e992a1ddabfc81df05e \ + --hash=sha256:b723061a78ed0f4524190eae321d3d84100227d51c5677035b6615d91895e0d6 threadpoolctl==3.1.0 ; python_version >= "3.8" and python_version < "3.12" \ --hash=sha256:8b99adda265feb6773280df41eece7b2e6561b772d21ffd52e372f999024907b \ --hash=sha256:a335baacfaa4400ae1f0d8e3a58d6674d2f8828e3716bb2802c44955ad391380 @@ -468,9 +464,9 @@ traitlets==5.9.0 ; python_version >= "3.8" and python_version < "3.12" \ typing-extensions==4.4.0 ; python_version >= "3.8" and python_version < "3.12" \ --hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \ --hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e -virtualenv==20.18.0 ; python_version >= "3.8" and python_version < "3.12" \ - --hash=sha256:9d61e4ec8d2c0345dab329fb825eb05579043766a4b26a2f66b28948de68c722 \ - --hash=sha256:f262457a4d7298a6b733b920a196bf8b46c8af15bf1fd9da7142995eff15118e +virtualenv==20.19.0 ; python_version >= "3.8" and python_version < "3.12" \ + --hash=sha256:37a640ba82ed40b226599c522d411e4be5edb339a0c0de030c0dc7b646d61590 \ + --hash=sha256:54eb59e7352b573aa04d53f80fc9736ed0ad5143af445a1e539aada6eb947dd1 wcwidth==0.2.6 ; python_version >= "3.8" and python_version < "3.12" \ --hash=sha256:a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0 wrapt==1.14.1 ; python_version >= "3.8" and python_version < "3.12" \ diff --git a/src/blitzly/plots/matrix.py b/src/blitzly/plots/matrix.py index db7e33c..0b6b2f8 100644 --- a/src/blitzly/plots/matrix.py +++ b/src/blitzly/plots/matrix.py @@ -1,4 +1,5 @@ -from typing import List, Optional, Tuple, Union +import itertools +from typing import Dict, List, Optional, Tuple, Union import numpy as np import pandas as pd @@ -6,7 +7,9 @@ import plotly.graph_objects as go from numpy.typing import NDArray from plotly.basedatatypes import BaseFigure +from scipy import stats from sklearn.metrics import confusion_matrix as sk_confusion_matrix +from sklearn.preprocessing import OrdinalEncoder from blitzly.etc.utils import check_data, save_show_return, update_figure_layout @@ -162,3 +165,93 @@ def pearson_corr_matrix( fig = update_figure_layout(fig, title, size, show_scale=show_scale) return save_show_return(fig, write_html_path, show) + + +def cramers_v_corr_matrix( + data: pd.DataFrame, + title: str = "Cramer's V correlation matrix", + show_scale: bool = False, + size: Tuple[int, int] = (700, 700), + decimal_places: int = 3, + plotly_kwargs: Optional[dict] = None, + show: bool = True, + write_html_path: Optional[str] = None, +) -> BaseFigure: + """[Cramer's V correlation](https://www.wikiwand.com/en/Cram%C3%A9r%27s_V) + matrix. It can be used to get the correlations between nominal variables. + + Example: + ```python + from blitzly.matrix import cramers_v_corr_matrix + import pandas as pd + + df = pd.DataFrame( + { + "foo": ["1", "1", "1", "2", "2", "2"], + "bar": ["3", "2", "3", "7", "5", "7"], + "blitzly": ["9", "3", "4", "6", "7", "9"], + "licht": ["1", "1", "1", "2", "2", "2"], + } + ) + + fig = cramers_v_corr_matrix(df) + ``` + + Args: + data (pd.DataFrame): The data which should be plotted. All columns need to be nominal/categorical. + title (Optional[str]): The title of the correlation matrix. + show_scale (Optional[bool]): Whether to show the color scale. + decimal_places (Optional[int]): The number of decimal places to round the values to. This only applies to the values shown on the plot. + size (Optional[Tuple[int, int]): Size of the plot. + plotly_kwargs (Optional[dict]): Additional keyword arguments for Plotly. + show (bool): Whether to show the figure. + write_html_path (Optional[str]): The path to which the histogram should be written as an HTML file. + + Returns: + BaseFigure: The figure. + """ + + data = check_data( + data, min_columns=2, min_rows=2, as_pandas=True, only_numerical_values=False + ) + + if all(x == np.object_ for x in list(data.dtypes)) is False: + raise Warning( + """All columns should be from type `object` since the encoding is done internally. + But don't worry. It should work anyway.""" + ) + + d: Dict[str, List[Union[str, float]]] = { + "Feature1": [], + "Feature2": [], + "Correlation": [], + } + data = pd.DataFrame(OrdinalEncoder().fit_transform(data) + 1, columns=data.columns) + + for _, x in enumerate(itertools.combinations(data.columns, r=2)): + temp_data = np.array(pd.crosstab(data[x[0]], data[x[1]])) + + chi2 = stats.chi2_contingency(temp_data, correction=False)[0] + n = np.sum(temp_data) + minimum_dimension = min(temp_data.shape) - 1 + res = np.sqrt((chi2 / n) / minimum_dimension) + + d["Feature1"].append(x[0]) + d["Feature2"].append(x[1]) + d["Correlation"].append(res) + + df = pd.DataFrame(d) + + fig = go.Figure( + data=go.Heatmap( + z=df["Correlation"], + text=np.round(df["Correlation"], decimals=decimal_places), + texttemplate="%{text}", + x=d["Feature1"], + y=d["Feature2"], + ), + **(plotly_kwargs or {}), + ) + + fig = update_figure_layout(fig, title, size, show_scale=show_scale) + return save_show_return(fig, write_html_path, show) diff --git a/tests/expected_figs/matrix/cramers_v_corr_matrix/valid_cramers_v_corr_matrix_from_pandas.joblib b/tests/expected_figs/matrix/cramers_v_corr_matrix/valid_cramers_v_corr_matrix_from_pandas.joblib new file mode 100644 index 0000000..cad9a5c Binary files /dev/null and b/tests/expected_figs/matrix/cramers_v_corr_matrix/valid_cramers_v_corr_matrix_from_pandas.joblib differ diff --git a/tests/test_cases/test_matrix.py b/tests/test_cases/test_matrix.py index 1b62288..a8b5532 100644 --- a/tests/test_cases/test_matrix.py +++ b/tests/test_cases/test_matrix.py @@ -3,7 +3,11 @@ import pandas as pd import pytest -from blitzly.plots.matrix import binary_confusion_matrix, pearson_corr_matrix +from blitzly.plots.matrix import ( + binary_confusion_matrix, + cramers_v_corr_matrix, + pearson_corr_matrix, +) from tests.helper import fig_to_array # pylint: disable=missing-function-docstring, missing-class-docstring, redefined-outer-name @@ -51,6 +55,74 @@ def valid_multi_class_classification_data(): return np.array([[1, 0, 2, 1, 0, 2], [2, 2, 1, 1, 0, 1], [2, 0, 1, 2, 0, 1]]) +@pytest.fixture() +def cramers_v_corr_matrix_test_data(): + return pd.DataFrame( + { + "foo": [ + "1", + "1", + "1", + "2", + "2", + "2", + ], + "bar": ["3", "2", "3", "7", "5", "7"], + "blitzly": ["9", "3", "4", "6", "7", "9"], + "licht": ["1", "1", "1", "2", "2", "2"], + } + ) + + +@pytest.fixture() +def cramers_v_corr_matrix_test_numerical_data(): + return pd.DataFrame( + { + "foo": [ + 1, + 1, + 1, + 2, + 2, + 2, + ], + "bar": [3, 2, 3, 7, 5, 7], + "blitzly": [9, 3, 4, 6, 7, 9], + "licht": [1, 1, 1, 2, 2, 2], + } + ) + + +@pytest.fixture() +def valid_cramers_v_corr_matrix_from_pandas(): + return joblib.load( + "tests/expected_figs/matrix/cramers_v_corr_matrix/valid_cramers_v_corr_matrix_from_pandas.joblib" + ) + + +class TestCramersVCorrelationMatrix: + @staticmethod + def test_matrix_with_valid_pandas_data( + cramers_v_corr_matrix_test_data, valid_cramers_v_corr_matrix_from_pandas + ): + fig = cramers_v_corr_matrix(cramers_v_corr_matrix_test_data, show=False) + np.testing.assert_equal( + fig_to_array(fig), fig_to_array(valid_cramers_v_corr_matrix_from_pandas) + ) + + @staticmethod + def test_matrix_with_numerical_data(cramers_v_corr_matrix_test_numerical_data): + with pytest.raises(Warning) as warning: + _ = cramers_v_corr_matrix( + cramers_v_corr_matrix_test_numerical_data, show=False + ) + assert ( + str(warning.value) + == """All columns should be from type `object` since the encoding is done internally. + But don't worry. It should work anyway.""" + ) + + class TestBinaryConfusionMatrix: @staticmethod def test_matrix_with_valid_data(