Changeset 27781


Ignore:
Timestamp:
06/05/23 12:26:25 (22 months ago)
Author:
jdquinn
Message:

BUG: Allow runme to be called as function or script.

File:
1 edited

Legend:

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

    r27777 r27781  
    123123    i1, i2 = parallelrange(rank, numprocs, len(list_ids))  # Get tests for this CPU only
    124124    list_ids = list_ids[i1:i2 + 1]
    125     if np.size(id) > 0 and id is not None:
    126     #if len(id[0]) > 0 or len(id[1]) > 0:
    127         test_ids = set(GetIds(id)).intersection(set(list_ids))
    128         benchmark = None
     125    if id is not None:
     126        if np.size(id) > 0 or (len(id[0]) > 0 or len(id[1]) > 0):
     127            test_ids = set(GetIds(id)).intersection(set(list_ids))
     128            benchmark = None
     129        else:
     130            print(('runme error: \'id\' argument "{}" does not follow the required protocol. When calling runme as a function from Python runtime, use runme(<int>). If calling runme.py from command line, use runme.py <options>'.format(id)))
     131            exit()
    129132    else:
    130133        # If no tests are specifically provided, do them all
     
    135138    exclude_ids = GetIds(exclude)
    136139    test_ids = test_ids.difference(exclude_ids)
     140
    137141    # }}}
    138142    if procedure == 'runFromNC':
     
    175179    test_ids = list(test_ids)
    176180    test_ids.sort()
     181
    177182    # }}}
    178183
Note: See TracChangeset for help on using the changeset viewer.