Ejemplo n.º 1
0
    def test_creation_and_hydration(self):
        exp_id = random_int()
        name = "exp_%d_%d" % (random_int(), random_int())
        location = random_file(".json")

        exp = Experiment(exp_id, name, location)
        self._check(exp, exp_id, name, location)

        as_dict = {
            "experiment_id": exp_id,
            "name": name,
            "artifact_location": location
        }
        self.assertEqual(dict(exp), as_dict)

        proto = exp.to_proto()
        exp2 = Experiment.from_proto(proto)
        self._check(exp2, exp_id, name, location)

        exp3 = Experiment.from_dictionary(as_dict)
        self._check(exp3, exp_id, name, location)
Ejemplo n.º 2
0
 def _get_experiment(experiment_dir_path):
     meta = read_yaml(experiment_dir_path, FileStore.META_DATA_FILE_NAME)
     return Experiment.from_dictionary(meta)