예제 #1
0
 def to_proto(self):
     proto = ProtoExperiment()
     proto.experiment_id = self.experiment_id
     proto.name = self.name
     proto.artifact_location = self.artifact_location
     proto.lifecycle_stage = self.lifecycle_stage
     return proto
예제 #2
0
def test_parse_legacy_experiment():
    in_json = {"experiment_id": 123, "name": "name", "unknown": "field"}
    message = ProtoExperiment()
    parse_dict(in_json, message)
    experiment = Experiment.from_proto(message)
    assert experiment.experiment_id == "123"
    assert experiment.name == 'name'
    assert experiment.artifact_location == ''
예제 #3
0
 def to_proto(self):
     experiment = ProtoExperiment()
     experiment.experiment_id = self.experiment_id
     experiment.name = self.name
     experiment.artifact_location = self.artifact_location
     experiment.lifecycle_stage = self.lifecycle_stage
     experiment.tags.extend(
         [ProtoExperimentTag(key=key, value=val) for key, val in self._tags.items()]
     )
     return experiment
예제 #4
0
 def to_proto(self):
     proto = ProtoExperiment()
     proto.experiment_id = self.experiment_id
     proto.name = self.name
     proto.artifact_location = self.artifact_location
     return proto