report.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:maggma 作者: materialsproject 项目源码 文件源码
def sort_rows(self, rows, section):
        """
        Sort the rows, as appropriate for the section.

        Args:
         rows(list): List of tuples (all same length, same values in each position)
            section(str): Name of section, should match const in Differ class
        """
        #print("@@ SORT ROWS:\n{}".format(rows))
        # Section-specific determination of sort key
        if section.lower() == Differ.CHANGED.lower():
            sort_key = Differ.CHANGED_DELTA
        else:
            sort_key = None
        if sort_key is not None:
            rows.sort(key=itemgetter(sort_key))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号