Ejemplo n.º 1
0
def create_job_outputs_path(persistence_outputs, job_name):
    persistence_outputs = 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
Ejemplo n.º 2
0
def get_experiment_outputs_path(persistence_outputs,
                                experiment_name,
                                original_name=None,
                                cloning_strategy=None):
    persistence_outputs = 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))
Ejemplo n.º 3
0
    def test_get_outputs_paths_works_as_expected(self):
        with self.assertRaises(VolumeNotFoundError):
            get_outputs_paths('path1')

        assert get_outputs_paths('outputs2') == '/outputs/2'
        assert get_outputs_paths('outputs3') == 'gs://output-bucket'
Ejemplo n.º 4
0
 def test_get_outputs_paths_raises_for_unrecognised_paths(self):
     with self.assertRaises(VolumeNotFoundError):
         get_outputs_paths(['path1', 'path2'])
Ejemplo n.º 5
0
def get_job_outputs_path(persistence_outputs, job_name):
    persistence_outputs = get_outputs_paths(persistence_outputs)
    return os.path.join(persistence_outputs, job_name.replace('.', '/'))
Ejemplo n.º 6
0
def get_experiment_group_outputs_path(persistence_outputs, experiment_group_name):
    persistence_outputs = get_outputs_paths(persistence_outputs)
    values = experiment_group_name.split('.')
    values.insert(2, 'groups')
    return os.path.join(persistence_outputs, '/'.join(values))
Ejemplo n.º 7
0
def get_notebook_job_outputs_path(persistence_outputs, notebook_job):
    persistence_outputs = get_outputs_paths(persistence_outputs)
    return os.path.join(persistence_outputs, notebook_job.replace('.', '/'))