build_test.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 # No trailing slash!
14 # Example:
15 source_dir = '/pnfs/nova/scratch/users/aback/prod4/HowToAna2019/2019-01-30/allxp_nue/FHC/FHCNeutronSyst_nueconcat_fakeNDData_2019-01-30/'
16 # TODO: job submission script should write output directory here to make a
17 # bespoke build script
18 # start python editing
19 # end python editing
20 
21 # Where to save the merged predictions to
22 build_dir = 'merged_predictions'
23 
24 
25 def build():
26  if not os.path.isdir(build_dir):
27  os.mkdir(build_dir)
28  compile()
29  print 'Done!'
30 
31 
32 def compile():
33  # Call merge_all to merge everything in order, for a given directory
34  merge_all(source_dir, build_dir)
35 
36 
37 def clean():
38  autoclean()
39 
40 
41 def rebuild():
42  clean()
43  build()
44 
45 
46 main() # built in fabricate function
def compile()
Definition: build_test.py:32
def build()
Definition: build_test.py:25
def clean()
Definition: build_test.py:37
def rebuild()
Definition: build_test.py:41
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