Changeset 27360


Ignore:
Timestamp:
11/08/22 10:56:14 (2 years ago)
Author:
jdquinn
Message:

BUG: Reverting test parsing changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/NightlyRun/runme.py

    r27355 r27360  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22#
    33# NOTE: Switch to,
     
    88#
    99import argparse
     10from glob import glob
    1011import os
    11 import re
     12from re import search, split
    1213from sys import float_info
    1314from traceback import format_exc
     
    8990    exception'; see also jenkins/jenkins.sh). These should be counted as
    9091    failures.
    91     - Figure out why the following changes allow for correct partitioning of
    92     test set, but cause an error with ADOL-C build (some test logs are parsed
    93     twice).
    9492    """
    9593
     
    118116    # }}}
    119117    #GET ids  {{{
    120     flist = [f for f in os.listdir('.') if re.match('test[0-9]+.py', f)] # File name must follow the format "test<integer>.py"
    121     list_ids = [int(re.search(r'\d+',f.split('.')[0]).group()) for f in flist] # Retrieve test IDs
    122     i1, i2 = parallelrange(rank, numprocs, len(list_ids))  # Get tests for this CPU only
     118    flist = glob('test*.py')  #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
     119    list_ids = [int(search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] # Keep test id only (skip 'test' and '.py')
     120
     121    i1, i2 = parallelrange(rank, numprocs, len(list_ids))  #Get tests for this cpu only
    123122    list_ids = list_ids[i1:i2 + 1]
    124123    if np.size(id) > 0 and id is not None:
     
    214213                for key in mdl.results.__dict__.keys():
    215214                    if 'Solution' in key:
    216                         solvetype = re.split('Solution', key)[0]
     215                        solvetype = split('Solution', key)[0]
    217216
    218217                #we save the results, scrap them and solve.
     
    225224                    try:
    226225                        #first look for indexing
    227                         if re.search(r'\d+$', fieldname):
    228                             index = int(re.search(r'\d+$', fieldname).group()) - 1
    229                             fieldname = fieldname[:re.search(r'\d+$', fieldname).start()]
     226                        if search(r'\d+$', fieldname):
     227                            index = int(search(r'\d+$', fieldname).group()) - 1
     228                            fieldname = fieldname[:search(r'\d+$', fieldname).start()]
    230229                        elif 'FirstStep' in fieldname:
    231230                            index = 0
    232                             fieldname = fieldname[:re.search('FirstStep', fieldname).start()]
     231                            fieldname = fieldname[:search('FirstStep', fieldname).start()]
    233232                        elif 'SecondStep' in fieldname:
    234233                            index = 1
    235                             fieldname = fieldname[:re.search('SecondStep', fieldname).start()]
     234                            fieldname = fieldname[:search('SecondStep', fieldname).start()]
    236235                        elif 'ThirdStep' in fieldname:
    237236                            index = 2
    238                             fieldname = fieldname[:re.search('ThirdStep', fieldname).start()]
     237                            fieldname = fieldname[:search('ThirdStep', fieldname).start()]
    239238                        else:
    240239                            index = 0
     
    271270                                    #probably severalmatches, we take the last one which should be the good one (Needs to be controled in the list above)
    272271                                    sufix = sufixes[np.squeeze(np.where([suf in fieldname for suf in sufixes]))[-1]]
    273                                 fieldname = fieldname[:re.search(sufix, fieldname).start()]
     272                                fieldname = fieldname[:search(sufix, fieldname).start()]
    274273                            elif fieldname.endswith("P") and index == 1:
    275274                                #we are looking for P2 but 2 as been considered as an index and so shifted by -1
Note: See TracChangeset for help on using the changeset viewer.