Public Member Functions | Public Attributes | List of all members
Controller.Controller Class Reference

Public Member Functions

def __init__ (self, config_file, verbose=False)
 
def make_output_directory (self, output_directory, overwrite=False)
 
def write (self)
 

Public Attributes

 verbose
 
 config
 
 name
 
 version
 
 release
 
 user
 
 components
 
 output_dir
 
 creation_time
 
 file_name
 

Detailed Description

Definition at line 7 of file Controller.py.

Constructor & Destructor Documentation

def Controller.Controller.__init__ (   self,
  config_file,
  verbose = False 
)

Definition at line 9 of file Controller.py.

9  def __init__(self, config_file, verbose=False):
10  self.verbose = verbose
11  self.config = config_parser(config_file)
12  self.name = self.config["name"]
13  self.version = self.config["version"]
14  self.release = self.config["release"]
15  self.user = os.environ["NOVAANAVALID_USERNAME"]
16 
17  optional_attributes = ["description"]
18  for attr in optional_attributes:
19  if attr in self.config.keys():
20  setattr(self, attr, self.config[attr])
21  else:
22  setattr(self, attr, False)
23 
24  self.components = []
25  for component_config in self.config["components"]:
26  self.components.append(Component.Component(component_config, release=self.release, verbose=self.verbose, user=self.user))
27  self.output_dir = False
28  self.creation_time = datetime.datetime.now()
29 
def __init__(self, config_file, verbose=False)
Definition: Controller.py:9

Member Function Documentation

def Controller.Controller.make_output_directory (   self,
  output_directory,
  overwrite = False 
)

Definition at line 30 of file Controller.py.

References caf::SRCVNFeatures.components, Controller.Controller.components, flat::FlatCVNFeatures.components, hdf5::HDF5CVNFeatures< Tidx >.components, caf::Proxy< caf::SRCVNFeatures >.components, Controller.Controller.config, SimpleModel.config, LSTME::FillLSTME.config, SliceLID::FillSliceLID.config, exit(), Controller.Controller.output_dir, Controller.Controller.verbose, Component.Component.verbose, samweb_client.http_client_requests.RequestsHTTPClient.verbose, samweb_client.http_client.SAMWebHTTPClient.verbose, evg::MCTruthToDk2NuHackItr.verbose, and samweb_client.client.SAMWebClient.verbose.

30  def make_output_directory(self, output_directory, overwrite=False):
31  self.output_dir = "%s/%s/v%s"%(output_directory, self.config["name"], self.config["version"])
32  if self.verbose: print "cntrl: output directory will be: %s"%self.output_dir
33  if (not overwrite) and os.path.exists(self.output_dir):
34  print "cntrl: output directory:"
35  print self.output_dir
36  print "cntrl: already exists, aborting\n"
37  exit(1)
38  os.system("mkdir -p %s"%self.output_dir)
39  for component in self.components:
40  component.output_dir = "%s/%s/v%s"%(self.output_dir, component.name, component.version)
41  if component.dataset: component.output_dir += "/%s"%component.dataset
42  os.system("mkdir -p %s"%component.output_dir)
43  if component.sam:
44  os.system("mkdir -p %s/hadd_hist"%component.output_dir)
45  os.system("mkdir -p %s/logs"%component.output_dir)
46 
def make_output_directory(self, output_directory, overwrite=False)
Definition: Controller.py:30
exit(0)
def Controller.Controller.write (   self)

Definition at line 47 of file Controller.py.

References Controller.Controller.output_dir.

47  def write(self):
48  if (not self.output_dir):
49  print "cntrl: Output directory has not been set, so cannot write"
50  return False
51  self.file_name = self.output_dir+"/controller.pkl"
52  print "cntrl: Saving as: %s"%self.file_name
53  cPickle.dump(self,open(self.file_name,"w"))
procfile open("FD_BRL_v0.txt")

Member Data Documentation

Controller.Controller.components

Definition at line 24 of file Controller.py.

Referenced by Controller.Controller.make_output_directory().

Controller.Controller.config

Definition at line 11 of file Controller.py.

Referenced by Controller.Controller.make_output_directory().

Controller.Controller.creation_time

Definition at line 28 of file Controller.py.

Controller.Controller.file_name

Definition at line 51 of file Controller.py.

Controller.Controller.release

Definition at line 14 of file Controller.py.

Referenced by MetadataUtils.metaDataMgr.getOutputFileName().

Controller.Controller.user

Definition at line 15 of file Controller.py.

Referenced by ProjMan.Consumer.establish().

Controller.Controller.version

Definition at line 13 of file Controller.py.


The documentation for this class was generated from the following file: