aa584476eddf17497e469efd565d63cf69d0ec23,pandas/tests/io/formats/test_style.py,TestStyler,test_bar_align_mid_all_neg,#TestStyler#,713

Before Change



        result = df.style.bar(align="mid", color=["//d65f5f", "/Ǜfba7d"])._compute().ctx

        expected = {
            (0, 0): [
                "width: 10em",
                " height: 80%",
                "background: linear-gradient(90deg,"
                "//d65f5f 100.0%, transparent 100.0%)",
            ],
            (1, 0): [
                "width: 10em",
                " height: 80%",
                "background: linear-gradient(90deg, "
                "transparent 40.0%, "
                "//d65f5f 40.0%, //d65f5f 100.0%, "
                "transparent 100.0%)",
            ],
            (2, 0): [
                "width: 10em",
                " height: 80%",
                "background: linear-gradient(90deg, "
                "transparent 70.0%, "
                "//d65f5f 70.0%, //d65f5f 100.0%, "
                "transparent 100.0%)",
            ],
            (3, 0): [
                "width: 10em",
                " height: 80%",
                "background: linear-gradient(90deg, "
                "transparent 80.0%, "
                "//d65f5f 80.0%, //d65f5f 100.0%, "
                "transparent 100.0%)",
            ],
        }
        assert result == expected

    def test_bar_align_zero_pos_and_neg(self):
        // See https://github.com/pandas-dev/pandas/pull/14757

After Change



        result = df.style.bar(align="mid", color=["//d65f5f", "/Ǜfba7d"])._compute().ctx

        expected = {
            (0, 0): bar_grad(
                "//d65f5f 100.0%",
                " transparent 100.0%",
            ),
            (1, 0): bar_grad(
                " transparent 40.0%",
                " //d65f5f 40.0%",
                " //d65f5f 100.0%",
                " transparent 100.0%",
            ),
            (2, 0): bar_grad(
                " transparent 70.0%",
                " //d65f5f 70.0%",
                " //d65f5f 100.0%",
                " transparent 100.0%",
            ),
            (3, 0): bar_grad(
                " transparent 80.0%",
                " //d65f5f 80.0%",
                " //d65f5f 100.0%",
                " transparent 100.0%",
            ),
        }
        assert result == expected

    def test_bar_align_zero_pos_and_neg(self):
        // See https://github.com/pandas-dev/pandas/pull/14757
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 10

Instances


Project Name: pandas-dev/pandas
Commit Name: aa584476eddf17497e469efd565d63cf69d0ec23
Time: 2021-02-18
Author: 24256554+attack68@users.noreply.github.com
File Name: pandas/tests/io/formats/test_style.py
Class Name: TestStyler
Method Name: test_bar_align_mid_all_neg


Project Name: pandas-dev/pandas
Commit Name: aa584476eddf17497e469efd565d63cf69d0ec23
Time: 2021-02-18
Author: 24256554+attack68@users.noreply.github.com
File Name: pandas/tests/io/formats/test_style.py
Class Name: TestStyler
Method Name: test_bar_align_zero_pos_and_neg


Project Name: pandas-dev/pandas
Commit Name: aa584476eddf17497e469efd565d63cf69d0ec23
Time: 2021-02-18
Author: 24256554+attack68@users.noreply.github.com
File Name: pandas/tests/io/formats/test_style.py
Class Name: TestStyler
Method Name: test_bar_align_mid_vmin_vmax_wide


Project Name: pandas-dev/pandas
Commit Name: aa584476eddf17497e469efd565d63cf69d0ec23
Time: 2021-02-18
Author: 24256554+attack68@users.noreply.github.com
File Name: pandas/tests/io/formats/test_style.py
Class Name: TestStyler
Method Name: test_bar_align_mid_vmin


Project Name: pandas-dev/pandas
Commit Name: aa584476eddf17497e469efd565d63cf69d0ec23
Time: 2021-02-18
Author: 24256554+attack68@users.noreply.github.com
File Name: pandas/tests/io/formats/test_style.py
Class Name: TestStyler
Method Name: test_bar_align_zero_axis_none