Isentrope.py 文件源码

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

项目:F_UNCLE 作者: fraserphysics 项目源码 文件源码
def _get_knot_spacing(self):
        """Returns a list of knot locations based on the spline parameters

        If the option `spacing` is 'lin', uses linear spacing
                                   'log', uses log spacing

        Places 'spline_N' knots between 'spline_min' and 'spline_max'
        """

        space_key = self.get_option('spacing').lower()[:3]

        if space_key == 'log':
            vol = np.logspace(np.log10(self.get_option('spline_min')),
                              np.log10(self.get_option('spline_max')),
                              self.get_option('spline_N'))

        elif space_key == 'lin':
            vol = np.linspace(self.get_option('spline_min'),
                              self.get_option('spline_max'),
                              self.get_option('spline_N'))
        else:
            raise KeyError("{:} only `lin`ear and `log` spacing are"
                           "accepted".format(self.get_inform(1)))
        # end
        return vol
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号