Example #1
0
def update_all_notebooks(skip_nbs=None):
    logging.debug('update_all_notebooks start')
    nbdir = get_notebook_dir()
    from wzdat.nbdependresolv import DependencyTree
    dt = DependencyTree(nbdir, skip_nbs)
    rv = dt.resolve(True)
    logging.debug('update_all_notebooks done')
    return rv
Example #2
0
def test_notebook_depresolv(fxsoldir):
    nbdir = get_notebook_dir()
    from wzdat.nbdependresolv import DependencyTree
    skip_nbs = [os.path.join(nbdir, 'test-notebook6.ipynb')]
    dt = DependencyTree(nbdir, skip_nbs)
    nb3 = dt.get_notebook_by_fname('test-notebook3')
    nb4 = dt.get_notebook_by_fname('test-notebook4')
    nb5 = dt.get_notebook_by_fname('test-notebook5')
    assert nb4.is_depend(nb3)
    assert nb5.is_depend(nb3)
    assert nb5.is_depend(nb4)
    resolved, _ = dt.resolve(True)
    sched_nbs = set([snb for snb, scd in iter_scheduled_notebook(nbdir)])
    resolved_nbs = set([nb.path for nb in resolved])
    assert len(sched_nbs & resolved_nbs) == 0

    # test hdf dependency
    assert nb3.manifest.output.hdf.checksum() ==\
        nb4.manifest.depends.hdf.checksum()
    assert nb3.manifest.output.hdf.checksum() ==\
        nb5.manifest.depends.hdf[0].checksum()
    assert nb4.manifest.output.hdf.checksum() ==\
        nb5.manifest.depends.hdf[1].checksum()