gen_rst.py 文件源码

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

项目:multi-diffusion 作者: chemical-diffusion 项目源码 文件源码
def extract_thumbnail_number(text):
    """ Pull out the thumbnail image number specified in the docstring. """

    # check whether the user has specified a specific thumbnail image
    pattr = re.compile(
        r"^\s*#\s*sphinx_gallery_thumbnail_number\s*=\s*([0-9]+)\s*$",
        flags=re.MULTILINE)
    match = pattr.search(text)

    if match is None:
        # by default, use the first figure created
        thumbnail_number = 1
    else:
        thumbnail_number = int(match.groups()[0])

    return thumbnail_number
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号