From fddc4f413ee007ccb1fc5cd8c2ca918e515efcff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 16:12:56 +0000 Subject: [PATCH 1/2] Build(deps-dev): Bump ruff from 0.4.2 to 0.4.5 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.2 to 0.4.5. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.4.2...v0.4.5) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/poetry.lock b/poetry.lock index 1662566c..b03e0661 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2476,28 +2476,28 @@ files = [ [[package]] name = "ruff" -version = "0.4.2" +version = "0.4.5" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.4.2-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:8d14dc8953f8af7e003a485ef560bbefa5f8cc1ad994eebb5b12136049bbccc5"}, - {file = "ruff-0.4.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:24016ed18db3dc9786af103ff49c03bdf408ea253f3cb9e3638f39ac9cf2d483"}, - {file = "ruff-0.4.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e2e06459042ac841ed510196c350ba35a9b24a643e23db60d79b2db92af0c2b"}, - {file = "ruff-0.4.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3afabaf7ba8e9c485a14ad8f4122feff6b2b93cc53cd4dad2fd24ae35112d5c5"}, - {file = "ruff-0.4.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:799eb468ea6bc54b95527143a4ceaf970d5aa3613050c6cff54c85fda3fde480"}, - {file = "ruff-0.4.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:ec4ba9436a51527fb6931a8839af4c36a5481f8c19e8f5e42c2f7ad3a49f5069"}, - {file = "ruff-0.4.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6a2243f8f434e487c2a010c7252150b1fdf019035130f41b77626f5655c9ca22"}, - {file = "ruff-0.4.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8772130a063f3eebdf7095da00c0b9898bd1774c43b336272c3e98667d4fb8fa"}, - {file = "ruff-0.4.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ab165ef5d72392b4ebb85a8b0fbd321f69832a632e07a74794c0e598e7a8376"}, - {file = "ruff-0.4.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1f32cadf44c2020e75e0c56c3408ed1d32c024766bd41aedef92aa3ca28eef68"}, - {file = "ruff-0.4.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:22e306bf15e09af45ca812bc42fa59b628646fa7c26072555f278994890bc7ac"}, - {file = "ruff-0.4.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:82986bb77ad83a1719c90b9528a9dd663c9206f7c0ab69282af8223566a0c34e"}, - {file = "ruff-0.4.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:652e4ba553e421a6dc2a6d4868bc3b3881311702633eb3672f9f244ded8908cd"}, - {file = "ruff-0.4.2-py3-none-win32.whl", hash = "sha256:7891ee376770ac094da3ad40c116258a381b86c7352552788377c6eb16d784fe"}, - {file = "ruff-0.4.2-py3-none-win_amd64.whl", hash = "sha256:5ec481661fb2fd88a5d6cf1f83403d388ec90f9daaa36e40e2c003de66751798"}, - {file = "ruff-0.4.2-py3-none-win_arm64.whl", hash = "sha256:cbd1e87c71bca14792948c4ccb51ee61c3296e164019d2d484f3eaa2d360dfaf"}, - {file = "ruff-0.4.2.tar.gz", hash = "sha256:33bcc160aee2520664bc0859cfeaebc84bb7323becff3f303b8f1f2d81cb4edc"}, + {file = "ruff-0.4.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8f58e615dec58b1a6b291769b559e12fdffb53cc4187160a2fc83250eaf54e96"}, + {file = "ruff-0.4.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:84dd157474e16e3a82745d2afa1016c17d27cb5d52b12e3d45d418bcc6d49264"}, + {file = "ruff-0.4.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25f483ad9d50b00e7fd577f6d0305aa18494c6af139bce7319c68a17180087f4"}, + {file = "ruff-0.4.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:63fde3bf6f3ad4e990357af1d30e8ba2730860a954ea9282c95fc0846f5f64af"}, + {file = "ruff-0.4.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78e3ba4620dee27f76bbcad97067766026c918ba0f2d035c2fc25cbdd04d9c97"}, + {file = "ruff-0.4.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:441dab55c568e38d02bbda68a926a3d0b54f5510095c9de7f95e47a39e0168aa"}, + {file = "ruff-0.4.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1169e47e9c4136c997f08f9857ae889d614c5035d87d38fda9b44b4338909cdf"}, + {file = "ruff-0.4.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:755ac9ac2598a941512fc36a9070a13c88d72ff874a9781493eb237ab02d75df"}, + {file = "ruff-0.4.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f4b02a65985be2b34b170025a8b92449088ce61e33e69956ce4d316c0fe7cce0"}, + {file = "ruff-0.4.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:75a426506a183d9201e7e5664de3f6b414ad3850d7625764106f7b6d0486f0a1"}, + {file = "ruff-0.4.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:6e1b139b45e2911419044237d90b60e472f57285950e1492c757dfc88259bb06"}, + {file = "ruff-0.4.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a6f29a8221d2e3d85ff0c7b4371c0e37b39c87732c969b4d90f3dad2e721c5b1"}, + {file = "ruff-0.4.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:d6ef817124d72b54cc923f3444828ba24fa45c3164bc9e8f1813db2f3d3a8a11"}, + {file = "ruff-0.4.5-py3-none-win32.whl", hash = "sha256:aed8166c18b1a169a5d3ec28a49b43340949e400665555b51ee06f22813ef062"}, + {file = "ruff-0.4.5-py3-none-win_amd64.whl", hash = "sha256:b0b03c619d2b4350b4a27e34fd2ac64d0dabe1afbf43de57d0f9d8a05ecffa45"}, + {file = "ruff-0.4.5-py3-none-win_arm64.whl", hash = "sha256:9d15de3425f53161b3f5a5658d4522e4eee5ea002bf2ac7aa380743dd9ad5fba"}, + {file = "ruff-0.4.5.tar.gz", hash = "sha256:286eabd47e7d4d521d199cab84deca135557e6d1e0f0d01c29e757c3cb151b54"}, ] [[package]] From 16ab5b08c1e00979742fd7d9ad540a3be181f225 Mon Sep 17 00:00:00 2001 From: Thomas M Kehrenberg Date: Tue, 28 May 2024 13:33:30 +0200 Subject: [PATCH 2/2] Remove unnecessary quotes around type annotations --- ethicml/implementations/adv_debiasing_method.py | 4 ++-- ethicml/implementations/agarwal.py | 6 +++--- ethicml/implementations/beutel.py | 4 ++-- ethicml/implementations/dro_tabular.py | 4 ++-- ethicml/implementations/fair_dummies_romano.py | 4 ++-- ethicml/implementations/hgr_method.py | 4 ++-- ethicml/implementations/vfae.py | 4 ++-- ethicml/implementations/zemel.py | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ethicml/implementations/adv_debiasing_method.py b/ethicml/implementations/adv_debiasing_method.py index d3c1c31a..95865eea 100644 --- a/ethicml/implementations/adv_debiasing_method.py +++ b/ethicml/implementations/adv_debiasing_method.py @@ -55,8 +55,8 @@ def train_and_predict( def main() -> None: """Run the adversarial debiasing model as a standalone program.""" - in_algo_args: "InAlgoArgs" = json.loads(sys.argv[1]) - flags: "AdvDebArgs" = json.loads(sys.argv[2]) + in_algo_args: InAlgoArgs = json.loads(sys.argv[1]) + flags: AdvDebArgs = json.loads(sys.argv[2]) if in_algo_args["mode"] == "run": train = DataTuple.from_file(Path(in_algo_args["train"])) diff --git a/ethicml/implementations/agarwal.py b/ethicml/implementations/agarwal.py index 59a19491..c2175d52 100644 --- a/ethicml/implementations/agarwal.py +++ b/ethicml/implementations/agarwal.py @@ -59,7 +59,7 @@ def fit(train: DataTuple, args: "AgarwalArgs", seed: int = 888) -> "Exponentiate else: fairness_class = EqualizedOdds(difference_bound=args["eps"]) - model: "LinearModel | GradientBoostingClassifier" + model: LinearModel | GradientBoostingClassifier match classifier_type: case ClassifierType.svm: assert kernel_type is not None @@ -119,8 +119,8 @@ def working_dir(root: Path) -> Generator[None, None, None]: def main() -> None: """Run the Agarwal model as a standalone program.""" - in_algo_args: "InAlgoArgs" = json.loads(sys.argv[1]) - flags: "AgarwalArgs" = json.loads(sys.argv[2]) + in_algo_args: InAlgoArgs = json.loads(sys.argv[1]) + flags: AgarwalArgs = json.loads(sys.argv[2]) try: import cloudpickle # pyright: ignore diff --git a/ethicml/implementations/beutel.py b/ethicml/implementations/beutel.py index 63675441..6ee606cb 100644 --- a/ethicml/implementations/beutel.py +++ b/ethicml/implementations/beutel.py @@ -377,8 +377,8 @@ def _grad_reverse(features: Tensor, lambda_: float) -> Tensor: def main() -> None: """Load data from feather files, pass it to `train_and_transform` and then save the result.""" - pre_algo_args: "PreAlgoArgs" = json.loads(sys.argv[1]) - flags: "BeutelArgs" = json.loads(sys.argv[2]) + pre_algo_args: PreAlgoArgs = json.loads(sys.argv[1]) + flags: BeutelArgs = json.loads(sys.argv[2]) if pre_algo_args["mode"] == "run": train, test = load_data_from_flags(pre_algo_args) save_transformations( diff --git a/ethicml/implementations/dro_tabular.py b/ethicml/implementations/dro_tabular.py index eb85b24f..f85f034f 100644 --- a/ethicml/implementations/dro_tabular.py +++ b/ethicml/implementations/dro_tabular.py @@ -133,8 +133,8 @@ def train_and_predict( def main() -> None: """Run the FWD model as a standalone program on tabular data.""" - in_algo_args: "InAlgoArgs" = json.loads(sys.argv[1]) - flags: "DroArgs" = json.loads(sys.argv[2]) + in_algo_args: InAlgoArgs = json.loads(sys.argv[1]) + flags: DroArgs = json.loads(sys.argv[2]) data: DataTuple | TestTuple if in_algo_args["mode"] == "run": train, test = load_data_from_flags(in_algo_args) diff --git a/ethicml/implementations/fair_dummies_romano.py b/ethicml/implementations/fair_dummies_romano.py index 22cd6a7e..7636a39e 100644 --- a/ethicml/implementations/fair_dummies_romano.py +++ b/ethicml/implementations/fair_dummies_romano.py @@ -59,8 +59,8 @@ def train_and_predict( def main() -> None: """Run the Agarwal model as a standalone program.""" - in_algo_args: "InAlgoArgs" = json.loads(sys.argv[1]) - flags: "FairDummiesArgs" = json.loads(sys.argv[2]) + in_algo_args: InAlgoArgs = json.loads(sys.argv[1]) + flags: FairDummiesArgs = json.loads(sys.argv[2]) if in_algo_args["mode"] == "run": train = DataTuple.from_file(Path(in_algo_args["train"])) diff --git a/ethicml/implementations/hgr_method.py b/ethicml/implementations/hgr_method.py index 63075108..f9484562 100644 --- a/ethicml/implementations/hgr_method.py +++ b/ethicml/implementations/hgr_method.py @@ -61,8 +61,8 @@ def train_and_predict( def main() -> None: """Run the Agarwal model as a standalone program.""" - in_algo_args: "InAlgoArgs" = json.loads(sys.argv[1]) - flags: "HgrArgs" = json.loads(sys.argv[2]) + in_algo_args: InAlgoArgs = json.loads(sys.argv[1]) + flags: HgrArgs = json.loads(sys.argv[2]) if in_algo_args["mode"] == "run": train = DataTuple.from_file(Path(in_algo_args["train"])) diff --git a/ethicml/implementations/vfae.py b/ethicml/implementations/vfae.py index ce372747..3a6347cf 100644 --- a/ethicml/implementations/vfae.py +++ b/ethicml/implementations/vfae.py @@ -136,8 +136,8 @@ def train_model( def main() -> None: """Run model.""" - pre_algo_args: "PreAlgoArgs" = json.loads(sys.argv[1]) - flags: "VfaeArgs" = json.loads(sys.argv[2]) + pre_algo_args: PreAlgoArgs = json.loads(sys.argv[1]) + flags: VfaeArgs = json.loads(sys.argv[2]) if pre_algo_args["mode"] == "run": set_seed(pre_algo_args["seed"]) train, test = load_data_from_flags(pre_algo_args) diff --git a/ethicml/implementations/zemel.py b/ethicml/implementations/zemel.py index a8135b31..bda18f38 100644 --- a/ethicml/implementations/zemel.py +++ b/ethicml/implementations/zemel.py @@ -196,8 +196,8 @@ def main() -> None: Based on code from https://github.com/zjelveh/learning-fair-representations Which in turn, we've got from AIF360 """ - pre_algo_args: "PreAlgoArgs" = json.loads(sys.argv[1]) - flags: "ZemelArgs" = json.loads(sys.argv[2]) + pre_algo_args: PreAlgoArgs = json.loads(sys.argv[1]) + flags: ZemelArgs = json.loads(sys.argv[2]) if pre_algo_args["mode"] == "run": train, test = load_data_from_flags(pre_algo_args) save_transformations(