Commits
Wataru Kawasaki authored eee6dce7ca6
5432 5432 | f.write('1,1,,' + clipniter + ',3.,false,,,,,cspline,,1,[]') |
5433 5433 | |
5434 5434 | def run_test(self, blfunc): |
5435 5435 | bools = [False, True] |
5436 5436 | lst = [(outbl, doclip) for outbl in bools for doclip in bools] |
5437 5437 | for outbl, doclip in lst: |
5438 5438 | self._exec_sdbaseline(blfunc, outbl, doclip) |
5439 5439 | |
5440 5440 | # if clipping is turned on, output of sdbaseline must be identical |
5441 5441 | # regardless of whether blformat is empty or not |
5442 - | self.assertTrue(np.array_equal(self._result(False, True), self._result(True, True)), |
5442 + | self.assertTrue(np.allclose(self._result(False, True), self._result(True, True)), |
5443 5443 | msg='unexpected result; result differs with different blformat.') |
5444 5444 | # with iterative clipping, output of sdbaseline must be different from that |
5445 5445 | # without clipping, regardless of whether blformat is empty or not |
5446 5446 | for blout in bools: |
5447 - | self.assertFalse(np.array_equal(self._result(blout, True), self._result(blout, False)), |
5447 + | self.assertFalse(np.allclose(self._result(blout, True), self._result(blout, False)), |
5448 5448 | msg='unexpected result; clipping is not working.') |
5449 5449 | |
5450 5450 | def setUp(self): |
5451 5451 | remove_files_dirs(self.infile) |
5452 5452 | shutil.copytree(os.path.join(self.datapath, self.infile), self.infile) |
5453 5453 | self._setup_input_data() |
5454 5454 | default(sdbaseline) |
5455 5455 | |
5456 5456 | def tearDown(self): |
5457 5457 | remove_files_dirs(self.infile) |