Skip to content

Commit

Permalink
refactor: convert dict constructor to dict literal
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman authored and Simon Brugman committed Jun 23, 2021
1 parent dee8a21 commit a5c4cae
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion tests/popmon/alerting/test_apply_tl_bounds.py
Expand Up @@ -193,7 +193,7 @@ def test_apply_static_traffic_light_bounds():


def test_rolling_window_funcs():
datastore = dict(to_profile={"asc_numbers": get_test_data()})
datastore = {"to_profile": {"asc_numbers": get_test_data()}}

m = ApplyFunc(
apply_to_key="to_profile", features=["asc_numbers"], metrics=["a", "b"]
Expand Down
4 changes: 2 additions & 2 deletions tests/popmon/alerting/test_integration.py
Expand Up @@ -79,7 +79,7 @@ def test_traffic_light_summary():

tls = ApplyFunc(
apply_to_key="output_data",
apply_funcs=[dict(func=traffic_light_summary, axis=1, suffix="")],
apply_funcs=[{"func": traffic_light_summary, "axis": 1, "suffix": ""}],
assign_to_key="alerts",
)

Expand Down Expand Up @@ -124,7 +124,7 @@ def test_traffic_light_summary_combination():

tls = ApplyFunc(
apply_to_key="output_data",
apply_funcs=[dict(func=traffic_light_summary, axis=1, suffix="")],
apply_funcs=[{"func": traffic_light_summary, "axis": 1, "suffix": ""}],
assign_to_key="alerts",
)

Expand Down
28 changes: 14 additions & 14 deletions tests/popmon/analysis/comparison/test_hist_comparer.py
Expand Up @@ -39,26 +39,26 @@ def test_hist_compare():
ApplyFunc(
apply_to_key="output_hist",
apply_funcs=[
dict(
func=expanding_hist,
shift=1,
suffix="sum",
entire=True,
hist_name="histogram",
)
{
"func": expanding_hist,
"shift": 1,
"suffix": "sum",
"entire": True,
"hist_name": "histogram",
}
],
),
ApplyFunc(
apply_to_key="output_hist",
assign_to_key="comparison",
apply_funcs=[
dict(
func=hist_compare,
hist_name1="histogram",
hist_name2="histogram_sum",
suffix="",
axis=1,
)
{
"func": hist_compare,
"hist_name1": "histogram",
"hist_name2": "histogram_sum",
"suffix": "",
"axis": 1,
}
],
),
]
Expand Down
96 changes: 48 additions & 48 deletions tests/popmon/analysis/test_functions.py
Expand Up @@ -63,13 +63,13 @@ def test_expanding_hist():
ApplyFunc(
apply_to_key="output_hist",
apply_funcs=[
dict(
func=expanding_hist,
shift=1,
suffix="sum",
entire=True,
hist_name="histogram",
)
{
"func": expanding_hist,
"shift": 1,
"suffix": "sum",
"entire": True,
"hist_name": "histogram",
}
],
),
]
Expand Down Expand Up @@ -222,14 +222,14 @@ def test_rolling_hist():
ApplyFunc(
apply_to_key="output_hist",
apply_funcs=[
dict(
func=rolling_hist,
window=5,
shift=1,
suffix="sum",
entire=True,
hist_name="histogram",
)
{
"func": rolling_hist,
"window": 5,
"shift": 1,
"suffix": "sum",
"entire": True,
"hist_name": "histogram",
}
],
),
]
Expand Down Expand Up @@ -333,7 +333,7 @@ def test_normalized_hist_mean_cov():
ApplyFunc(
apply_to_key="output_hist",
assign_to_key="output_hist",
apply_funcs=[dict(func=normalized_hist_mean_cov, suffix="")],
apply_funcs=[{"func": normalized_hist_mean_cov, "suffix": ""}],
),
]
)
Expand Down Expand Up @@ -394,14 +394,14 @@ def test_roll_norm_hist_mean_cov():
ApplyFunc(
apply_to_key="output_hist",
apply_funcs=[
dict(
func=roll_norm_hist_mean_cov,
hist_name="histogram",
window=5,
shift=1,
suffix="",
entire=True,
)
{
"func": roll_norm_hist_mean_cov,
"hist_name": "histogram",
"window": 5,
"shift": 1,
"suffix": "",
"entire": True,
}
],
),
]
Expand Down Expand Up @@ -514,13 +514,13 @@ def test_expand_norm_hist_mean_cov():
ApplyFunc(
apply_to_key="output_hist",
apply_funcs=[
dict(
func=expand_norm_hist_mean_cov,
hist_name="histogram",
shift=1,
suffix="",
entire=True,
)
{
"func": expand_norm_hist_mean_cov,
"hist_name": "histogram",
"shift": 1,
"suffix": "",
"entire": True,
}
],
),
]
Expand Down Expand Up @@ -636,19 +636,19 @@ def test_chi_squared1():
ApplyFunc(
apply_to_key="output_hist",
apply_funcs=[
dict(
func=roll_norm_hist_mean_cov,
hist_name="histogram",
window=5,
shift=1,
suffix="",
entire=True,
)
{
"func": roll_norm_hist_mean_cov,
"hist_name": "histogram",
"window": 5,
"shift": 1,
"suffix": "",
"entire": True,
}
],
),
ApplyFunc(
apply_to_key="output_hist",
apply_funcs=[dict(func=relative_chi_squared, suffix="", axis=1)],
apply_funcs=[{"func": relative_chi_squared, "suffix": "", "axis": 1}],
),
]
)
Expand Down Expand Up @@ -698,18 +698,18 @@ def test_chi_squared2():
ApplyFunc(
apply_to_key="output_hist",
apply_funcs=[
dict(
func=expand_norm_hist_mean_cov,
hist_name="histogram",
shift=1,
suffix="",
entire=True,
)
{
"func": expand_norm_hist_mean_cov,
"hist_name": "histogram",
"shift": 1,
"suffix": "",
"entire": True,
}
],
),
ApplyFunc(
apply_to_key="output_hist",
apply_funcs=[dict(func=relative_chi_squared, suffix="", axis=1)],
apply_funcs=[{"func": relative_chi_squared, "suffix": "", "axis": 1}],
),
]
)
Expand Down

0 comments on commit a5c4cae

Please sign in to comment.