Commits

Takeshi Nakazato authored f88e45032af
CAS-13713 renaming variables

NAOJ code review Refs #2430

casatasks/tests/tasks/test_task_sdatmcor.py

Modified
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

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut