def stage_vis(m: Manager, ref_df: DRef): def _config(): name = mklens(ref_df).name.val + '-vis' df = mklens(ref_df).out_df.refpath out_plot = [promise, 'plot.png'] title = mklens(ref_df).ref_data.name.val version = 3 return locals() def _make(b: Build): build_setoutpaths(b, 1) df = pd.read_csv(mklens(b).df.syspath) vis_bars(df, plot_fpath=mklens(b).out_plot.syspath, async_plot=None, plot_title=mklens(b).title.val) return mkdrv(m, mkconfig(_config()), match_latest(), build_wrapper(_make))
def stage_hello(m: Manager) -> DRef: def _config() -> Config: name: str = 'hello-bin' src: RefPath = [hello_src, f'hello-{hello_version}'] return locals() def _make(b: Build) -> None: o: Path = build_outpath(b) with TemporaryDirectory() as tmp: copytree(mklens(b).src.syspath, join(tmp, 'src')) dirrw(Path(join(tmp, 'src'))) cwd = getcwd() try: chdir(join(tmp, 'src')) system('./configure --prefix=/usr') system('make') system(f'make install DESTDIR={o}') finally: chdir(cwd) return mkdrv(m, mkconfig(_config()), match_latest(), build_wrapper(_make))
def mnist_match(): return match_latest()
def summary_stage(m:Manager)->DRef: return mkdrv(m, config=summary_config(evolution_stage(m)), matcher=match_latest(), realizer=build_wrapper(summary_realize))
def evolution_stage(m:Manager)->DRef: return mkdrv(m, config=evolution_config(), matcher=match_latest(n=10), realizer=build_wrapper(evolution_realize))