Commits
509 509 | def test_custom_atm_params_non_conform_list_input(self): |
510 510 | """Test customized ATM parameters: non-conform layerboundaries and layertemperature.""" |
511 511 | with self.assertRaises(Exception): |
512 512 | sdatmcor( |
513 513 | infile=self.infile, outfile=self.outfile, datacolumn='data', |
514 514 | atmdetail=True, |
515 515 | layerboundaries='800m,1.5km', layertemperature='250K,200K,190K' |
516 516 | ) |
517 517 | |
518 518 | def __extract_num_threads_from_logfile(self, logfile): |
519 - | with open(logfile, 'r') as f: |
519 + | with open(logfile, 'r') as file: |
520 520 | pattern = re.compile(r'.*Setting numThreads_ to ([0-9]+)') |
521 - | matches_iterator = map(lambda line: pattern.search(line), f) |
521 + | matches_iterator = map(lambda line: pattern.search(line), file) |
522 522 | last_match = functools.reduce( |
523 - | lambda previous_match, current_match: |
524 - | current_match if current_match else previous_match, |
523 + | lambda last_match_, current_match: |
524 + | current_match if current_match else last_match_, |
525 525 | matches_iterator |
526 526 | ) |
527 527 | |
528 528 | self.assertIsNotNone( |
529 529 | last_match, |
530 530 | msg=f'No match found for pattern "{pattern.pattern}" in "{casalog.logfile()}"' |
531 531 | ) |
532 532 | num_threads_log = int(last_match.group(1)) |
533 533 | |
534 534 | return num_threads_log |