Skip to content

Commit be188a0

Browse files
ruff fixes
1 parent d4ad7e7 commit be188a0

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

tests/qoi/test_gp_brute_force_system.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -865,34 +865,34 @@ def sample_group(group, n=subsample_size): # type: ignore # noqa: ANN001, PGH0
865865
)
866866
all_statistics.append(statistics)
867867

868-
df = pd.json_normalize(all_statistics, max_level=1) # type: ignore # noqa: PD901, PGH003
869-
df.head() # type: ignore # noqa: PGH003
868+
statistics_df = pd.json_normalize(all_statistics, max_level=1) # type: ignore # noqa: PGH003
869+
statistics_df.head() # type: ignore # noqa: PGH003
870870

871871
# %% Get the statistic for each group.
872872
# fmt: off
873873
# do the statistics for the different tests
874874
# Ground truth
875-
print("best_guess_z: ",df["ground_truth.best_guess_z"].abs().max())
875+
print("best_guess_z: ",statistics_df["ground_truth.best_guess_z"].abs().max())
876876

877877
# %%
878878
# qoi_no_gp
879-
print("best_guess_z: ",df["qoi_no_gp.best_guess_z"].abs().max())
879+
print("best_guess_z: ",statistics_df["qoi_no_gp.best_guess_z"].abs().max())
880880

881-
print("best_guess_std\n",(df["qoi_no_gp.best_guess_std"] / df["ground_truth.best_guess_std"]).agg(["min","max"]))
882-
print("var_mean\n",(df["qoi_no_gp.var_mean"] / df["ground_truth.var_mean"]).agg(["min","max"]))
883-
print("var_std\n",(df["qoi_no_gp.var_std"] / df["ground_truth.var_std"]).agg(["min","max"]))
881+
print("best_guess_std\n",(statistics_df["qoi_no_gp.best_guess_std"] / statistics_df["ground_truth.best_guess_std"]).agg(["min","max"]))# noqa: E501
882+
print("var_mean\n",(statistics_df["qoi_no_gp.var_mean"] / statistics_df["ground_truth.var_mean"]).agg(["min","max"]))# noqa: E501
883+
print("var_std\n",(statistics_df["qoi_no_gp.var_std"] / statistics_df["ground_truth.var_std"]).agg(["min","max"]))
884884

885885

886886
# %% qoi_gp_deterministic
887-
print("best_guess_z: ", df["qoi_gp_deterministic.best_guess_z"].abs().max())
887+
print("best_guess_z: ", statistics_df["qoi_gp_deterministic.best_guess_z"].abs().max())
888888

889889

890890
# %% qoi_gp_low_uncertainty
891-
print("best_guess_z: ", df["qoi_gp_low_uncertainty.best_guess_z"].abs().max())
891+
print("best_guess_z: ", statistics_df["qoi_gp_low_uncertainty.best_guess_z"].abs().max())
892892

893-
print("best_guess_std\n",(df["qoi_gp_low_uncertainty.best_guess_std"] / df["ground_truth.best_guess_std"]).agg(["min","max"])) # noqa: E501
894-
print("var_mean\n",(df["qoi_gp_low_uncertainty.var_mean"] / df["ground_truth.var_mean"]).agg(["min","max"]))
895-
print("var_std\n",(df["qoi_gp_low_uncertainty.var_std"] / df["ground_truth.var_std"]).agg(["min","max"]))
893+
print("best_guess_std\n",(statistics_df["qoi_gp_low_uncertainty.best_guess_std"] / statistics_df["ground_truth.best_guess_std"]).agg(["min","max"])) # noqa: E501
894+
print("var_mean\n",(statistics_df["qoi_gp_low_uncertainty.var_mean"] / statistics_df["ground_truth.var_mean"]).agg(["min","max"]))# noqa: E501
895+
print("var_std\n",(statistics_df["qoi_gp_low_uncertainty.var_std"] / statistics_df["ground_truth.var_std"]).agg(["min","max"]))# noqa: E501
896896

897897
# fmt:on
898898
# %%

tests/qoi/test_marginal_cdf_extrapolation_system.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,8 @@ def sample_group(group, n=subsample_size): # type: ignore # noqa: ANN001, PGH0
931931
)
932932
all_statistics.append(statistics)
933933

934-
df = pd.json_normalize(all_statistics, max_level=1) # type: ignore # noqa: PD901, PGH003
935-
df.head() # type: ignore # noqa: PGH003
934+
statistics_df = pd.json_normalize(all_statistics, max_level=1) # type: ignore # noqa:PGH003
935+
statistics_df.head() # type: ignore # noqa: PGH003
936936

937937
# %%
938938
"""What we want to check after confirming visual inspection.
@@ -956,21 +956,21 @@ def sample_group(group, n=subsample_size): # type: ignore # noqa: ANN001, PGH0
956956
"""
957957
# %% Get the statistic for each group.
958958
# Ground truth
959-
print("best_guess_z: ", df["ground_truth.best_guess_z"].abs().max())
959+
print("best_guess_z: ", statistics_df["ground_truth.best_guess_z"].abs().max())
960960

961961
# %%
962962
# qoi_no_gp
963-
print("best_guess_z: ", df["qoi_no_gp.best_guess_z"].abs().max())
964-
print("best_guess_std\n", (df["qoi_no_gp.best_guess_std"]).agg(["min", "max"]))
963+
print("best_guess_z: ", statistics_df["qoi_no_gp.best_guess_z"].abs().max())
964+
print("best_guess_std\n", (statistics_df["qoi_no_gp.best_guess_std"]).agg(["min", "max"]))
965965

966-
print("var_mean\n", (df["qoi_no_gp.var_mean"]).agg(["min", "max"]))
967-
print("var_std\n", (df["qoi_no_gp.var_std"]).agg(["min", "max"]))
966+
print("var_mean\n", (statistics_df["qoi_no_gp.var_mean"]).agg(["min", "max"]))
967+
print("var_std\n", (statistics_df["qoi_no_gp.var_std"]).agg(["min", "max"]))
968968

969969
# %% qoi_gp_deterministic
970-
print("best_guess_z: ", df["qoi_gp_deterministic.best_guess_z"].abs().max())
970+
print("best_guess_z: ", statistics_df["qoi_gp_deterministic.best_guess_z"].abs().max())
971971

972972
# %% qoi_gp_low_uncertainty
973-
print("best_guess_z: ", df["qoi_gp_low_uncertainty.best_guess_z"].abs().max())
973+
print("best_guess_z: ", statistics_df["qoi_gp_low_uncertainty.best_guess_z"].abs().max())
974974

975-
print("best_guess_std\n", (df["qoi_gp_low_uncertainty.best_guess_std"]).agg(["min", "max"]))
976-
print("var_mean\n", (df["qoi_gp_low_uncertainty.var_mean"]).agg(["min", "max"]))
975+
print("best_guess_std\n", (statistics_df["qoi_gp_low_uncertainty.best_guess_std"]).agg(["min", "max"]))
976+
print("var_mean\n", (statistics_df["qoi_gp_low_uncertainty.var_mean"]).agg(["min", "max"]))

0 commit comments

Comments
 (0)