diff --git a/marginaleffects/comparisons.py b/marginaleffects/comparisons.py index e9afb98..d5b4890 100644 --- a/marginaleffects/comparisons.py +++ b/marginaleffects/comparisons.py @@ -276,7 +276,9 @@ def applyfun(x, by, wts=None): # maintain_order is extremely important by = [x for x in by if x in tmp.columns] - tmp = tmp.group_by(*by, maintain_order=True).map_groups(function=lambda x: applyfun(x, by=by, wts=wts)) + tmp = tmp.group_by(*by, maintain_order=True).map_groups( + function=lambda x: applyfun(x, by=by, wts=wts) + ) tmp = get_hypothesis(tmp, hypothesis=hypothesis) diff --git a/tests/images/jss/jss_01.png b/tests/images/jss/jss_01.png index 4ef61dd..6cbbc7e 100644 Binary files a/tests/images/jss/jss_01.png and b/tests/images/jss/jss_01.png differ diff --git a/tests/images/plot_comparisons/continous_01.png b/tests/images/plot_comparisons/continous_01.png deleted file mode 100644 index e4c628f..0000000 Binary files a/tests/images/plot_comparisons/continous_01.png and /dev/null differ diff --git a/tests/images/plot_comparisons/continous_02.png b/tests/images/plot_comparisons/continous_02.png deleted file mode 100644 index 872f12d..0000000 Binary files a/tests/images/plot_comparisons/continous_02.png and /dev/null differ diff --git a/tests/images/plot_comparisons/continuous_01.png b/tests/images/plot_comparisons/continuous_01.png new file mode 100644 index 0000000..1623fdb Binary files /dev/null and b/tests/images/plot_comparisons/continuous_01.png differ diff --git a/tests/images/plot_comparisons/continuous_02.png b/tests/images/plot_comparisons/continuous_02.png new file mode 100644 index 0000000..62c1da7 Binary files /dev/null and b/tests/images/plot_comparisons/continuous_02.png differ diff --git a/tests/images/plot_comparisons/continuous_03.png b/tests/images/plot_comparisons/continuous_03.png index 2f309de..5f6a86c 100644 Binary files a/tests/images/plot_comparisons/continuous_03.png and b/tests/images/plot_comparisons/continuous_03.png differ diff --git a/tests/images/plot_comparisons/discrete_01.png b/tests/images/plot_comparisons/discrete_01.png index 49a3a55..248f48a 100644 Binary files a/tests/images/plot_comparisons/discrete_01.png and b/tests/images/plot_comparisons/discrete_01.png differ diff --git a/tests/images/plot_comparisons/discrete_02.png b/tests/images/plot_comparisons/discrete_02.png index 9914a36..16c303f 100644 Binary files a/tests/images/plot_comparisons/discrete_02.png and b/tests/images/plot_comparisons/discrete_02.png differ diff --git a/tests/images/plot_comparisons/discrete_03.png b/tests/images/plot_comparisons/discrete_03.png index 7727298..5702dbe 100644 Binary files a/tests/images/plot_comparisons/discrete_03.png and b/tests/images/plot_comparisons/discrete_03.png differ diff --git a/tests/images/plot_predictions/by_01.png b/tests/images/plot_predictions/by_01.png index 0a0f0d7..00a0955 100644 Binary files a/tests/images/plot_predictions/by_01.png and b/tests/images/plot_predictions/by_01.png differ diff --git a/tests/images/plot_predictions/by_02.png b/tests/images/plot_predictions/by_02.png index 7bbfa61..1f5ab1b 100644 Binary files a/tests/images/plot_predictions/by_02.png and b/tests/images/plot_predictions/by_02.png differ diff --git a/tests/images/plot_predictions/condition_01.png b/tests/images/plot_predictions/condition_01.png index 53afbb0..de451fc 100644 Binary files a/tests/images/plot_predictions/condition_01.png and b/tests/images/plot_predictions/condition_01.png differ diff --git a/tests/images/plot_predictions/condition_02.png b/tests/images/plot_predictions/condition_02.png index 358f23d..eea8c04 100644 Binary files a/tests/images/plot_predictions/condition_02.png and b/tests/images/plot_predictions/condition_02.png differ diff --git a/tests/images/plot_predictions/issue_57_01.png b/tests/images/plot_predictions/issue_57_01.png index 4e541ac..5b065f6 100644 Binary files a/tests/images/plot_predictions/issue_57_01.png and b/tests/images/plot_predictions/issue_57_01.png differ diff --git a/tests/images/plot_predictions/issue_57_02.png b/tests/images/plot_predictions/issue_57_02.png index 8334c59..6054861 100644 Binary files a/tests/images/plot_predictions/issue_57_02.png and b/tests/images/plot_predictions/issue_57_02.png differ diff --git a/tests/images/plot_predictions/issue_57_03.png b/tests/images/plot_predictions/issue_57_03.png index 1fd2183..0beb2c5 100644 Binary files a/tests/images/plot_predictions/issue_57_03.png and b/tests/images/plot_predictions/issue_57_03.png differ diff --git a/tests/images/plot_predictions/issue_57_04.png b/tests/images/plot_predictions/issue_57_04.png index d27ff0d..42331f0 100644 Binary files a/tests/images/plot_predictions/issue_57_04.png and b/tests/images/plot_predictions/issue_57_04.png differ diff --git a/tests/images/plot_slopes/condition_01.png b/tests/images/plot_slopes/condition_01.png index 3c4a279..df65ddb 100644 Binary files a/tests/images/plot_slopes/condition_01.png and b/tests/images/plot_slopes/condition_01.png differ diff --git a/tests/images/plot_slopes/condition_02.png b/tests/images/plot_slopes/condition_02.png index 3549866..24109c8 100644 Binary files a/tests/images/plot_slopes/condition_02.png and b/tests/images/plot_slopes/condition_02.png differ diff --git a/tests/images/plot_slopes/condition_03.png b/tests/images/plot_slopes/condition_03.png index 79775dc..4449169 100644 Binary files a/tests/images/plot_slopes/condition_03.png and b/tests/images/plot_slopes/condition_03.png differ diff --git a/tests/images/plot_slopes/condition_04.png b/tests/images/plot_slopes/condition_04.png index feea2b1..1735650 100644 Binary files a/tests/images/plot_slopes/condition_04.png and b/tests/images/plot_slopes/condition_04.png differ diff --git a/tests/test_plot_comparisons.py b/tests/test_plot_comparisons.py index 9c7a566..154e655 100644 --- a/tests/test_plot_comparisons.py +++ b/tests/test_plot_comparisons.py @@ -27,12 +27,12 @@ def test_continuous(): variables="bill_length_mm", by="island", ) - assert assert_image(fig, "continous_01", "plot_comparisons") is None + assert assert_image(fig, "continuous_01", "plot_comparisons") is None fig = plot_comparisons( mod, variables="bill_length_mm", condition=["flipper_length_mm", "species"] ) - assert assert_image(fig, "continous_02", "plot_comparisons") is None + assert assert_image(fig, "continuous_02", "plot_comparisons") is None fig = plot_comparisons(mod, variables="bill_length_mm", condition="species") assert assert_image(fig, "continuous_03", "plot_comparisons") is None