Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build(deps-dev): Bump ruff from 0.4.2 to 0.4.5 #1120

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ethicml/implementations/adv_debiasing_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))
Expand Down
6 changes: 3 additions & 3 deletions ethicml/implementations/agarwal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions ethicml/implementations/beutel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions ethicml/implementations/dro_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ethicml/implementations/fair_dummies_romano.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))
Expand Down
4 changes: 2 additions & 2 deletions ethicml/implementations/hgr_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))
Expand Down
4 changes: 2 additions & 2 deletions ethicml/implementations/vfae.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ethicml/implementations/zemel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
36 changes: 18 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading