Changeset 24214 for issm/trunk-jpl/test/NightlyRun/GetIds.py
- Timestamp:
- 10/11/19 00:27:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/GetIds.py
r23793 r24214 1 #! / usr/bin/env python1 #! / usr / bin / env python 2 2 from IdToName import * 3 3 from IdFromString import * … … 9 9 GetIds - output ids from a given array of IDs and test names 10 10 11 the test names can be any string or sub -string present11 the test names can be any string or sub - string present 12 12 in the test's name (first line of corresponding file) 13 13 … … 18 18 ids = GetIds('Dakota') 19 19 ids = GetIds([101, 102...]) 20 ids = GetIds([\'Dakota\', \'Slr\'...])21 ids = GetIds([[101, 102...], [\'Dakota\',\'Slr\'...]])20 ids = GetIds([\'Dakota\', \'Slr\'...]) 21 ids = GetIds([[101, 102...], [\'Dakota\', \'Slr\'...]]) 22 22 """ 23 23 … … 30 30 # fail silently 31 31 return [] 32 #raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' +ids_names+'" were found. Note that name checking is case sensitive. Test names are in the first line of a given test eg: "Square" would include test101.py: "SquareShelfConstrainedStressSSA2d"')32 #raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive. Test names are in the first line of a given test eg: "Square" would include test101.py: "SquareShelfConstrainedStressSSA2d"') 33 33 34 34 if type(ids_names) == int: … … 37 37 # fail silently 38 38 return [] 39 #raise RuntimeError('runme.py: GetIds.py: No tests with ids matching "' +ids_names+'" were found. Check that there is a test file named "test'+str(ids_names)+'.py"')39 #raise RuntimeError('runme.py: GetIds.py: No tests with ids matching "' + ids_names + '" were found. Check that there is a test file named "test' + str(ids_names) + '.py"') 40 40 41 # many inputs of either ids or test names41 # many inputs of either ids or test names 42 42 if type(ids_names) == list and len(ids_names) > 0: 43 43 # is everything a string or int? … … 49 49 raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.') 50 50 51 # many inputs of both ids and test names52 # ids_names[0] -> ids_names by id53 # ids_names[1] -> ids_names by test name51 # many inputs of both ids and test names 52 # ids_names[0] - > ids_names by id 53 # ids_names[1] - > ids_names by test name 54 54 if type(ids_names) == list and len(ids_names) == 2: 55 55 if type(ids_names[0]) == list and len(ids_names[0]) > 0 and type(ids_names[0][0]) == int: … … 60 60 raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.') 61 61 62 # no recognizable ids or id formats62 # no recognizable ids or id formats 63 63 if np.size(ids) == 0 and not np.all(np.equal(ids_names, None)): 64 raise RuntimeError('runme.py: GetIds.py: include and exclude options (- i/--id; -in/--include_name; -e/--exclude; -en/--exclude_name) options must follow GetIds usage format:\n' + GetIds.__doc__)64 raise RuntimeError('runme.py: GetIds.py: include and exclude options (- i / - - id; - in / - - include_name; - e / - - exclude; - en / - - exclude_name) options must follow GetIds usage format:\n' + GetIds.__doc__) 65 65 66 66 return np.array(ids).astype(int)
Note:
See TracChangeset
for help on using the changeset viewer.