def create_job_outputs_path(persistence_outputs, job_name): persistence_outputs = stores.get_outputs_paths(persistence_outputs) values = job_name.split('.') path = create_job_path(job_name, persistence_outputs) path = os.path.join(path, values[-1]) if not os.path.isdir(path): create_path(path) return path
def get_experiment_outputs_path(persistence_outputs, experiment_name, original_name=None, cloning_strategy=None): persistence_outputs = stores.get_outputs_paths(persistence_outputs) values = experiment_name.split('.') if original_name is not None and cloning_strategy == CloningStrategy.RESUME: values = original_name.split('.') if len(values) == 3: values.insert(2, 'experiments') else: values.insert(2, 'groups') return os.path.join(persistence_outputs, '/'.join(values))
def get_project_outputs_path(persistence_outputs, project_name): persistence_outputs = stores.get_outputs_paths(persistence_outputs) return os.path.join(persistence_outputs, project_name.replace('.', '/'))
def get_experiment_group_outputs_path(persistence_outputs, experiment_group_name): persistence_outputs = stores.get_outputs_paths(persistence_outputs) values = experiment_group_name.split('.') values.insert(2, 'groups') return os.path.join(persistence_outputs, '/'.join(values))
def get_notebook_job_outputs_path(persistence_outputs, notebook_job): persistence_outputs = stores.get_outputs_paths(persistence_outputs) return os.path.join(persistence_outputs, notebook_job.replace('.', '/'))
def test_get_outputs_paths_works_as_expected(self): with self.assertRaises(VolumeNotFoundError): stores.get_outputs_paths('path1') assert stores.get_outputs_paths('outputs2') == '/outputs/2' assert stores.get_outputs_paths('outputs3') == 'gs://output-bucket'
def test_get_outputs_paths_raises_for_unrecognised_paths(self): with self.assertRaises(VolumeNotFoundError): stores.get_outputs_paths(['path1', 'path2'])