plotting.py 文件源码

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

项目:phoebe2 作者: phoebe-project 项目源码 文件源码
def lightning(ps, data, plot_inds, **kwargs):
    """
    """
    if not conf.devel:
        raise NotImplementedError("'mpld3' plotting backend not officially supported for this release.  Enable developer mode to test.")

    try:
        from lightning import Lightning
    except ImportError:
        raise ImportError("failed to import lightning: try 'sudo pip install lightning-python' or choose another plotting backend")
        _use_lgn = False
    else:
        _use_lgn = True
        # TODO: option to use server instead of local (for sharing links, etc)
        lgn = Lightning(local=True)

    logger.warning("lightning plotting backend is VERY EXPERIMENTAL (read: non-existant)")

    # it looks like all calls for a single figure need to be made at once by giving lists
    # TODO: look into streaming option to stream fits as fitting or as sampling???

    series = np.random.randn(5, 50)

    viz = lgn.line(series)

    # TODO: return and accept viz and then write a .show() function?
    viz.save_html('_lgn.html', overwrite=True)

    return None, []
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号