build_template.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 """Example build script using fabricate and hadd_cafana
3 
4 Calls functions from the build_tools module which run hadd_cafana commands
5 through fabricate, in the correct order.
6 """
7 import os
8 from fabricate import *
9 from build_tools import oname, merge_all
10 
11 
12 # Insert build directory here
13 # Example:
14 # source_dir = '/pnfs/nova/scratch/users/aback/prod4/HowToAna2019/2019-01-30/allxp_nue/FHC/FHCNeutronSyst_nueconcat_fakeNDData_2019-01-30/'
15 # TODO: job submission script should write output directory here to make a
16 # bespoke build script
17 # start python editing
18 # end python editing
19 
20 # Where to save the merged predictions to
21 build_dir = 'merged_predictions/'
22 
23 
24 def build():
25  if not os.path.isdir(build_dir):
26  os.mkdir(build_dir)
27  compile()
28  print 'Done!'
29 
30 
31 def compile():
32  # Call merge_all to merge everything in order, for a given directory
33  merge_all(source_dir, build_dir)
34 
35 
36 def clean():
37  autoclean()
38 
39 
40 def rebuild():
41  clean()
42  build()
43 
44 
45 main() # built in fabricate function
def autoclean()
Definition: fabricate.py:1442
def merge_all(source_dir, build_dir)
Definition: build_tools.py:29
def main(globals_dict=None, build_dir=None, extra_options=None, builder=None, default=None, jobs=1, command_line=None, kwargs)
Definition: fabricate.py:1514