ranaroussi / quantstats

Consider removing the commented out code block PY-W0069
Anti-pattern
Major
11 occurrences in this check
Consider removing the commented out code block
1014    colors = _FLATUI_COLORS
1015    if grayscale:
1016        colors = ["#f9f9f9", "#dddddd", "#bbbbbb", "#999999", "#808080"]
1017    # colors, ls, alpha = _get_colors(grayscale)1018
1019    port = _pd.DataFrame(returns.fillna(0))
1020    port.columns = ["Daily"]
Consider removing the commented out code block
 966        ax.yaxis.set_label_coords(-0.1, 0.5)
 967
 968    ax.yaxis.set_major_formatter(_FuncFormatter(format_pct_axis))
 969    # ax.yaxis.set_major_formatter(_plt.FuncFormatter( 970    #     lambda x, loc: "{:,}%".format(int(x*100))))
 971
 972    fig.autofmt_xdate()
Consider removing the commented out code block
 578
 579    ax.yaxis.set_label_coords(-0.1, 0.5)
 580
 581    # fig.autofmt_xdate() 582
 583    try:
 584        _plt.subplots_adjust(hspace=0, bottom=0, top=1)
Consider removing the commented out code block
 554            color="red",
 555        )
 556
 557    # _plt.setp(x.get_legend().get_texts(), fontsize=11) 558    ax.xaxis.set_major_formatter(
 559        _plt.FuncFormatter(lambda x, loc: "{:,}%".format(int(x * 100)))
 560    )
Consider removing the commented out code block
 530                .reset_index()
 531                .rename(columns={"level_1": "", 0: "Returns"})
 532            )
 533            # _sns.kdeplot(data=combined_returns, color='black', ax=ax) 534            x = _sns.histplot(
 535                data=combined_returns,
 536                x="Returns",
Consider removing the commented out code block
 420    show=True,
 421):
 422
 423    # colors = ['#348dc1', '#003366', 'red'] 424    # if grayscale:
 425    #     colors = ['silver', 'gray', 'black']
 426
Consider removing the commented out code block
 363
 364    if percent:
 365        ax.yaxis.set_major_formatter(_FuncFormatter(format_pct_axis))
 366        # ax.yaxis.set_major_formatter(_plt.FuncFormatter( 367        #     lambda x, loc: "{:,}%".format(int(x*100))))
 368
 369    ax.set_xlabel("")
Consider removing the commented out code block
 356    ax.axhline(0, ls="-", lw=1, color="gray", zorder=1)
 357    ax.axhline(0, ls="--", lw=1, color="white" if grayscale else "black", zorder=2)
 358
 359    # if isinstance(benchmark, _pd.Series) or hline is not None: 360    ax.legend(fontsize=11)
 361
 362    _plt.yscale("symlog" if log_scale else "linear")
Consider removing the commented out code block
 328    if isinstance(returns, _pd.Series):
 329        ax.plot(returns, lw=lw, label=returns.name, color=colors[1], alpha=alpha)
 330    elif isinstance(returns, _pd.DataFrame):
 331        # color_dict = {col: colors[i+1] for i, col in enumerate(returns.columns)} 332        for i, col in enumerate(returns.columns):
 333            ax.plot(returns[col], lw=lw, label=col, alpha=alpha, color=colors[i + 1])
 334
Consider removing the commented out code block
 196
 197    ax.axhline(0, ls="--", lw=1, color="#000000", zorder=2)
 198
 199    # if isinstance(benchmark, _pd.Series) or hline: 200    ax.legend(fontsize=11)
 201
 202    _plt.yscale("symlog" if log_scale else "linear")
Consider removing the commented out code block
 176        ax.set_xticklabels(df.index)
 177        years = sorted(list(set(df.index)))
 178
 179    # ax.fmt_xdata = _mdates.DateFormatter('%Y-%m-%d') 180    # years = sorted(list(set(df.index.year)))
 181    if len(years) > 10:
 182        mod = int(len(years) / 10)