Functions | Variables
generic.tools.PathTools Namespace Reference

Functions

def ComparisonSubdirName (histogram_topdirs)
 
def DirectoryToURL (directory)
 
def FindValidationSubdirs (top_dir)
 

Variables

string DATASET_COMPARISON_DIRNAME = "dataset_comparisons"
 
string STAT_PAGE_NAME = "comparison_statistics"
 

Detailed Description

  PathTools.py:
   Tools for operating on paths.
  
   Original author: J. Wolcott <jwolcott@fnal.gov>
   (Refactored from code by M. Tamsett)
      Date: September 2016

Function Documentation

def generic.tools.PathTools.ComparisonSubdirName (   histogram_topdirs)
Centralize/standardize the construction of this name 

Definition at line 22 of file PathTools.py.

22 def ComparisonSubdirName(histogram_topdirs):
23  """ Centralize/standardize the construction of this name """
24  return "|".join(sorted(histogram_topdirs.iterkeys()))
25 
26 
def ComparisonSubdirName(histogram_topdirs)
Definition: PathTools.py:22
def generic.tools.PathTools.DirectoryToURL (   directory)
Consolidate the ugly hard-coded directory-to-URL map here 

Definition at line 27 of file PathTools.py.

27 def DirectoryToURL(directory):
28  """ Consolidate the ugly hard-coded directory-to-URL map here """
29  subs = {
30  "/nusoft/app/web/htdoc": "http://nusoft.fnal.gov",
31  }
32 
33  for token, sub in subs.iteritems():
34  if token in subs:
35  return directory.replace(token, sub)
36 
37  return directory
38 
def DirectoryToURL(directory)
Definition: PathTools.py:27
def generic.tools.PathTools.FindValidationSubdirs (   top_dir)

Definition at line 39 of file PathTools.py.

39 def FindValidationSubdirs(top_dir):
40  return [d for d in glob.glob(os.path.join(top_dir, "*")) if os.path.exists(os.path.join(top_dir, d, PlotRegistry.SERIALIZE_FILENAME))]
41 
def FindValidationSubdirs(top_dir)
Definition: PathTools.py:39

Variable Documentation

string generic.tools.PathTools.DATASET_COMPARISON_DIRNAME = "dataset_comparisons"

Definition at line 17 of file PathTools.py.

string generic.tools.PathTools.STAT_PAGE_NAME = "comparison_statistics"

Definition at line 20 of file PathTools.py.