utils.py 文件源码

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

项目:MDT 作者: cbclab 项目源码 文件源码
def __call__(self):
        locations = LinearLocator.__call__(self)

        new_locations = []
        for location in locations:
            if np.absolute(location) < 0.01:
                new_locations.append(float("{:.1e}".format(location)))
            else:
                new_locations.append(np.round(location, 3))

        if np.isclose(new_locations[-1], self.max_val) or new_locations[-1] >= self.max_val:
            new_locations[-1] = self.max_val

        if new_locations[0] <= self.min_val:
            new_locations[0] = self.min_val

        return new_locations
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号