14538c6714f45c0dbd6c95ff351c272c9cf85701,ggplot/stats/stat_hline.py,stat_hline,_calculate,#stat_hline#Any#,11

Before Change


        // yintercept may be one of:
        //   - aesthetic to geom_hline or
        //   - parameter setting to stat_hline
        yintercept = pinfo.pop("yintercept", self.params["yintercept"])

        // TODO: Enable this when the parameters are passed correctly
        // and uncomment test case
        // if hasattr(xintercept, "__call__"):
        //     if "y" not in pinfo:
        //         raise Exception(
        //             "To compute the intercept, y aesthetic is needed")
        //     yintercept = yintercept(pinfo["y"])

        pinfo["yintercept"] = yintercept
        return pinfo

After Change


        //             "To compute the intercept, y aesthetic is needed")
        //     yintercept = yintercept(pinfo["y"])

        yintercept = make_iterable(yintercept)
        new_data = pd.DataFrame({"yintercept": yintercept})
        // Copy the other aesthetics into the new dataframe
        n = len(yintercept)
        for ae in data:
            new_data[ae] = make_iterable_ntimes(data[ae].iloc[0], n)
        return new_data
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 18

Instances


Project Name: has2k1/plotnine
Commit Name: 14538c6714f45c0dbd6c95ff351c272c9cf85701
Time: 2014-04-29
Author: has2k1@gmail.com
File Name: ggplot/stats/stat_hline.py
Class Name: stat_hline
Method Name: _calculate


Project Name: has2k1/plotnine
Commit Name: 14538c6714f45c0dbd6c95ff351c272c9cf85701
Time: 2014-04-29
Author: has2k1@gmail.com
File Name: ggplot/stats/stat_abline.py
Class Name: stat_abline
Method Name: _calculate


Project Name: has2k1/plotnine
Commit Name: 14538c6714f45c0dbd6c95ff351c272c9cf85701
Time: 2014-04-29
Author: has2k1@gmail.com
File Name: ggplot/stats/stat_vline.py
Class Name: stat_vline
Method Name: _calculate