Commits

Anonymous committed c26d7a3

Reinstating include.block()

  • Participants
  • Parent commits 3b4d296

Comments (0)

Files changed (2)

 
 2010-02-24 Alvin Tan <clat@hep.ph.bham.ac.uk>
     * In FakeAthena.py, reinstating include.block() functionality albeit differently.
-    * Tag PyJobTransformsCore-00-08-25
+    * Tag PyJobTransformsCore-00-08-26
 
 2010-02-12 Alvin Tan <clat@hep.ph.bham.ac.uk>
     * -t/--test now used to apply the omission of checks (e.g. eventCount() )  

python/trfutil.py

             handlers.append( obj )
     return handlers
 
-def compressFileList( fileList ):
-    """
-    
-    row - filenames tokenised
-    ====
-    1: A0   B0   C0   D0   E0
-    2: A0   B0   C1   D0   E0
-    3: A0   B0   C2   D0   E0
-    4: A0   B0   C3   D0   E0
-    X: A0   B2   C6   D2   E2
-    5: A1   B0   C4   D0   E0
-    6: A1   B0   C4   D1   E0
-    7: A1   B1   C5   D1   E1
-    8: A1   B1   C5   D1   E1   F0
-    
-    Example #1                              Example #2
-    columns - pass #1                       columns - pass #1
-    =======                                 =======
-    1: [1,2,3,4],[5,6,7,8]                  [1,2,3,4,X],[5,6,7,8]
-    2: [1,2,3,4,5,6],[7,8]                  [1,2,3,4],[X],[5,6],[7,8]
-    3: [1],[2],[3],[4],[5,6],[7,8]          [1],[2],[3],[4],[X],[5,6],[7,8]
-    4: [1,2,3,4,5],[6,7,8]                  [1,2,3,4],[X],[5],[6,7,8]
-    5: [1,2,3,4,5,6],[7,8]                  [1,2,3,4],[X],[5,6],[7,8]
-    6: [_,_,_,_,_,_,_],[8]                  [_,_,_,_,_,_,_],[8]
-    
-                [1,2,3,4] --> A0, B0, [C0,C1,C2,C3] , D0, E0
-    
-    columns - pass #2                       columns - pass #2
-    =======                                 =======
-    1: [5,6,7,8]                            [X],[5,6,7,8]
-    2: [5,6],[7,8]                          [X],[5,6],[7,8]
-    3: [5,6],[7,8]                          [X],[5,6],[7,8]
-    4: [5],[6,7,8]                          [X],[5],[6,7,8]
-    5: [5,6],[7,8]                          [X],[5,6],[7,8]
-    6: [_,_,_],[8]                          [_,_,_,_],[8]
-    
-    [5,6] --> A1, B0, C4, [D0,D1], E0       [X] ---> A0, B2, C6, D2, E2
-    
-    columns - pass #3                       ...continue as in example #1 pass #2.
-    =======
-    1: [7,8]                
-    2: [7,8]
-    3: [7,8]
-    4: [7,8]
-    5: [7,8]
-    6: [_],[8]
-    
-    [7] --> A1, B1, C5, D1, E1
-    
-    columns - pass #4
-    1: [8]
-    2: [8]
-    3: [8]
-    4: [8]
-    5: [8]
-    6: [8]
-    
-    [8] --> A1, B1, C5, D1, E1, F0
-    
-    Final compressed filelist in PVN:
-    A0, B0, [C0,C1,C2,C3], D0, E0
-    A1, B0, C4, [D0,D1], E0
-    A1, B1, C5, D1, E1
-    A1, B1, C5, D1, E1, F0
-    """
-    # Work in progress
-    return
-    fileList.sort()
-    fileTokenList=[]
-    maxTokenLength = 0
-    # Tokenise
-    for fName in fileList:
-        token = ''
-        fNameInTokens = []
-        for _c in fName:
-            if token and _c in [ '/', '.' ]:
-                fNameInTokens.append( token )
-                token = ''
-            token += _c
-        _l = len( fNameInTokens )
-        if  _l > maxTokenLength:
-            maxTokenLength = _l
-        fileTokenList.append( fNameInTokens )
-    # Create the initial Column Similarity Table (CST)
-    CST = []
-    for pos in xrange( maxTokenLength ):
-        currentToken = ''
-        CSTentry = []
-        sameTokenRows = []
-        for fileTokens in fileTokenList
-            try:
-                if fileTokens[ pos ] != currentToken and sameTokenRows:
-                    CSTEentry.append( sameTokenRows )
-                    sameTokenRows = []
-            except IndexError:
-                if currentToken is not None and sameTokenRows:
-                    CSTEentry.append( sameTokenRows )
-                    sameTokenRows = []
-                sameTokenRows.append( None )
-            else:
-                sameTokenRows.append( pos )
-        if sameTokenRows: # deal wth last sameTokenRows that may not be added to CSTEntry
-            CSTEentry.append( sameTokenRows )
-        CST.append( CSTEntry )
-    #Iterate over CST and retrieve compressed format entries
-    done = False
-    changingColumn = []
-    minSameTokenRowSize = maxTokenLength # other than 1
-    while not done:
-        # each loop constitute a single pass and will create a single compressed format entry
-        col = 0
-        # Find minSameTokenRowSize
-        for CSTentry in CST:
-            try:
-                sameTokenRow = CSTEntry[0]
-            except IndexError:
-                # Should not happen
-                raise Exception
-            _l = len( sameTokenRow )
-            if _l == 1:
-                changingColumn.append( col )
-            elif _l < minSameTokenRowSize:
-                minSameTokenRowSize = _l
-            col += 1
-        # special case where all columns are changing
-        if len( changingColumn ) == len( CST ):
-            minSameTokenRowSize = 1 
-        # remove minSameTokenRowSize number of tokens from each CSTentry
-        # create compressed format
-#        for CSTentry in CST:
-#            for 
-
-            
-
 def expandStringToList(valIn):
     """Comma separated list of filenames. Each filename in the list can be coded
     with the following syntax: