Пример #1
0
 def test_find_file(self):
     root_dir = find_project_root()
     subject = PathManager([root_dir])
     with self.assertRaises(FileNotFoundError):
         subject.find_file('arvet/config')
     self.assertEqual(root_dir / 'arvet' / 'config' / 'path_manager.py',
                      subject.find_file('arvet/config/path_manager.py'))
     with self.assertRaises(FileNotFoundError):
         subject.find_file('notafile')
Пример #2
0
 def resolve_paths(self, path_manager: PathManager):
     """
     Use the path manager to find the required files on disk.
     Will raise various exceptions if the file is not available.
     You MUST call this before calling start_trial (run_task will handle that).
     :param path_manager: The PathManager, for locating files.
     :return:
     """
     if self.vocabulary_file is None or len(self.vocabulary_file) <= 0:
         raise ValueError("No vocabulary available for ORB-SLAM {0}, did you build one?".format(self.pk))
     self._temp_folder = path_manager.get_temp_folder()
     self._actual_vocab_file = path_manager.find_file(self.vocabulary_file)