Public Member Functions | Public Attributes | Private Attributes | List of all members
PandAna.core.core.interactive_loader Class Reference

Public Member Functions

def __init__ (self, files)
 
def keys (self, contain=None)
 
def __getitem__ (self, key)
 

Public Attributes

 gone
 
 interactive
 

Private Attributes

 _files
 
 _tables
 

Detailed Description

Definition at line 619 of file core.py.

Constructor & Destructor Documentation

def PandAna.core.core.interactive_loader.__init__ (   self,
  files 
)

Definition at line 620 of file core.py.

620  def __init__(self, files):
621  if type(files) is not list:
622  files = [files]
623  self._files = files
624  self._tables = {}
625  self.gone = False
626  self.interactive = True
627  self._tables = {'indices':0}
628 

Member Function Documentation

def PandAna.core.core.interactive_loader.__getitem__ (   self,
  key 
)

Definition at line 643 of file core.py.

References PandAna.core.core.loader._files, PandAna.core.core.associate._files, PandAna.core.core.interactive_loader._files, PandAna.core.core.spectrum._tables, PandAna.core.core.loader._tables, PandAna.core.core.interactive_loader._tables, and parse_dependency_file_t.list.

643  def __getitem__(self, key):
644  if not key in self._tables:
645  dflist=[]
646  for fname in self._files:
647  f = h5py.File(fname,'r')
648  group = f.get(key)
649  values = {}
650  for k in group.keys():
651  dataset = group.get(k)[()]
652  if dataset.shape[1] == 1:
653  dataset = dataset.flatten()
654  else:
655  dataset = list(dataset)
656  values[k] = dataset
657  dflist.append(pd.DataFrame(values))
658  f.close()
659  df = pd.concat(dflist)
660  if not (key.startswith('spill') or key.startswith('neutrino')):
661  df.set_index(KL, inplace=True)
662  self._tables[key] = df
663  return self._tables[key]
664 
665 
666 """
667 This function is passed a complete cut
668 and returns a function that loops through all
669 of the cuts functions that return boolean series
670 without modification to tables
671 """
def PandAna.core.core.interactive_loader.keys (   self,
  contain = None 
)

Definition at line 629 of file core.py.

References PandAna.core.core.loader._files, PandAna.core.core.associate._files, PandAna.core.core.interactive_loader._files, and print.

629  def keys(self, contain=None):
630  f = self._files[0]
631  h5 = h5py.File(f, 'r')
632  keys = h5.keys()
633  for k in keys:
634  if contain:
635  if contain in k:
636  print(k)
637  else:
638  print(k)
639  h5.close()
640 
641  return keys
642 
bool print
def keys(self, contain=None)
Definition: core.py:629

Member Data Documentation

PandAna.core.core.interactive_loader._files
private
PandAna.core.core.interactive_loader._tables
private

Definition at line 624 of file core.py.

Referenced by PandAna.core.core.interactive_loader.__getitem__().

PandAna.core.core.interactive_loader.gone

Definition at line 625 of file core.py.

PandAna.core.core.interactive_loader.interactive

Definition at line 626 of file core.py.


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