Classes | Functions | Variables
DefinitionData Namespace Reference

Classes

class  DefinitionData
 

Functions

def definitionPickleName (defname, useCache=False)
 
def dumpDefinitionData (defData, useCache=False)
 
def loadDefinitionData (defname)
 
def cacheDefinitionData (defname)
 

Variables

 sam = samweb_client.SAMWebClient(experiment='nova')
 
string defDataDir = "${NOVAPRODVALID_DATA}/definitions/current"
 
string defDataCache = "${NOVAPRODVALID_DATA}/definitions/cache"
 

Function Documentation

def DefinitionData.cacheDefinitionData (   defname)

Definition at line 40 of file DefinitionData.py.

References definitionPickleName().

40 def cacheDefinitionData(defname):
41  pklName = definitionPickleName(defname)
42  cacheName = definitionPickleName(defname,True)
43  if os.path.isfile(pklName):
44  shutil.copy(pklName,cacheName)
45  else:
46  print "ERROR couldn't find pkl file for", defname
47 
def definitionPickleName(defname, useCache=False)
def cacheDefinitionData(defname)
def DefinitionData.definitionPickleName (   defname,
  useCache = False 
)

Definition at line 13 of file DefinitionData.py.

Referenced by cacheDefinitionData(), dumpDefinitionData(), DefinitionData.DefinitionData.fetchData(), and loadDefinitionData().

13 def definitionPickleName(defname, useCache=False):
14  tmp=""
15  if useCache:
16  tmp=defDataCache + "/" + defname + ".pkl"
17  else:
18  tmp=defDataDir + "/" + defname + ".pkl"
19  return os.path.expandvars(tmp)
20 
def definitionPickleName(defname, useCache=False)
def DefinitionData.dumpDefinitionData (   defData,
  useCache = False 
)

Definition at line 21 of file DefinitionData.py.

References definitionPickleName(), and open().

Referenced by ChainData.ChainData.dump(), and ChainData.ChainData.fetchData().

21 def dumpDefinitionData(defData,useCache=False):
22 
23  fname = definitionPickleName(defData.name,useCache)
24  outFile = open(fname,'w')
25 
26  pickle.dump(defData,outFile)
27  outFile.close()
28 
def definitionPickleName(defname, useCache=False)
def dumpDefinitionData(defData, useCache=False)
procfile open("FD_BRL_v0.txt")
def DefinitionData.loadDefinitionData (   defname)

Definition at line 29 of file DefinitionData.py.

References definitionPickleName(), and open().

Referenced by ChainData.ChainData.loadData().

29 def loadDefinitionData(defname):
30 
31  fname = definitionPickleName(defname)
32  inFile = open(fname,'r')
33 
34  data=pickle.load(inFile)
35 
36  inFile.close()
37 
38  return data
39 
def definitionPickleName(defname, useCache=False)
def loadDefinitionData(defname)
procfile open("FD_BRL_v0.txt")

Variable Documentation

string DefinitionData.defDataCache = "${NOVAPRODVALID_DATA}/definitions/cache"

Definition at line 11 of file DefinitionData.py.

string DefinitionData.defDataDir = "${NOVAPRODVALID_DATA}/definitions/current"

Definition at line 10 of file DefinitionData.py.

DefinitionData.sam = samweb_client.SAMWebClient(experiment='nova')

Definition at line 9 of file DefinitionData.py.