3 from site_cons.site_init import link_wtk_graph, link_pyfit
6 FIGURES = ['order-dep']
8 # Get the passed in environment.
11 data_dir = env.Dir('data')
12 data_files = [f for f in env.Glob(os.path.join(str(data_dir), 'order.avg-*'))
13 if 'fit' not in str(f)]
14 order_dep_py = File('order_dep.py')
16 pyfit = link_pyfit(env)
20 N = int(str(f).rsplit('-', 1)[-1])
23 [f, pyfit, order_dep_py],
24 "python %s -m order_dep:atheory -f 'atheory(i=x, N=%d, Kwlc=A)' -p 1 -x -1 -y 0 -v $SOURCE > $TARGET"
25 % (pyfit[0].get_abspath(), N))
26 fit_dat = env.Command(
29 "sed -n 's/^[A-Z]: -//p' $SOURCE > $TARGET")
30 # Note the minus --^ which ensures a Kwlc solution >= 0.
31 fit_files.append(fit_dat)
33 order_dep_data = data_files + fit_files
35 wtk_graph = link_wtk_graph(env)
38 asyfile = '%s.asy' % fig # static .asy file
39 pyfig = fig.replace('-', '_')
40 data = '%s_data' % (pyfig)
42 if data in globals(): # generated data dependencies
43 asydata = globals()[data]
44 env.Asymptote([asyfile, wtk_graph] + asydata)
46 # Pass back the modified environment.