Skip to content

Commit

Permalink
Updated gofmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
gyliu513 committed May 22, 2019
1 parent 6cb0df8 commit be51751
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 73 deletions.
4 changes: 2 additions & 2 deletions cmd/manager/v1alpha1/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ func TestGetStudies(t *testing.T) {
s := &server{}
dbIf = mockDB
sc := []*api.StudyConfig{
&api.StudyConfig{
{
Name: "test1",
Owner: "admin",
OptimizationType: 1,
ObjectiveValueName: "obj_name1",
},
&api.StudyConfig{
{
Name: "test2",
Owner: "admin",
OptimizationType: 1,
Expand Down
80 changes: 40 additions & 40 deletions cmd/manager/v1alpha2/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ func TestGetExperimentList(t *testing.T) {
req := &api_pb.GetExperimentListRequest{}

testExpList := []*api_pb.ExperimentSummary{
&api_pb.ExperimentSummary{
{
ExperimentName: "test1",
Status: &api_pb.ExperimentStatus{
Condition: api_pb.ExperimentStatus_CREATED,
StartTime: "2019-02-03T04:05:06+09:00",
CompletionTime: "",
},
},
&api_pb.ExperimentSummary{
{
ExperimentName: "test2",
Status: &api_pb.ExperimentStatus{
Condition: api_pb.ExperimentStatus_SUCCEEDED,
Expand Down Expand Up @@ -177,11 +177,11 @@ func TestUpdateAlgorithmExtraSettings(t *testing.T) {
req := &api_pb.UpdateAlgorithmExtraSettingsRequest{
ExperimentName: "test1",
ExtraAlgorithmSettings: []*api_pb.AlgorithmSetting{
&api_pb.AlgorithmSetting{
{
Name: "set1",
Value: "10",
},
&api_pb.AlgorithmSetting{
{
Name: "set2",
Value: "0.5",
},
Expand All @@ -205,11 +205,11 @@ func TestGetAlgorithmExtraSettings(t *testing.T) {
ExperimentName: "test1",
}
extraAlgoSets := []*api_pb.AlgorithmSetting{
&api_pb.AlgorithmSetting{
{
Name: "set1",
Value: "10",
},
&api_pb.AlgorithmSetting{
{
Name: "set2",
Value: "0.5",
},
Expand Down Expand Up @@ -239,11 +239,11 @@ func TestRegisterTrial(t *testing.T) {
RunSpec: "",
ParameterAssignments: &api_pb.TrialSpec_ParameterAssignments{
Assignments: []*api_pb.ParameterAssignment{
&api_pb.ParameterAssignment{
{
Name: "param1",
Value: "10",
},
&api_pb.ParameterAssignment{
{
Name: "param2",
Value: "0.1",
},
Expand All @@ -256,19 +256,19 @@ func TestRegisterTrial(t *testing.T) {
CompletionTime: "",
Observation: &api_pb.Observation{
Metrics: []*api_pb.Metric{
&api_pb.Metric{
{
Name: "f1_score",
Value: "88.95",
},
&api_pb.Metric{
{
Name: "loss",
Value: "0.5",
},
&api_pb.Metric{
{
Name: "precision",
Value: "88.7",
},
&api_pb.Metric{
{
Name: "recall",
Value: "89.2",
},
Expand Down Expand Up @@ -313,18 +313,18 @@ func TestGetTrialList(t *testing.T) {
Filter: "trial",
}
trialList := []*api_pb.Trial{
&api_pb.Trial{
{
Name: "test1-trial1",
Spec: &api_pb.TrialSpec{
ExperimentName: "test1",
RunSpec: "",
ParameterAssignments: &api_pb.TrialSpec_ParameterAssignments{
Assignments: []*api_pb.ParameterAssignment{
&api_pb.ParameterAssignment{
{
Name: "param1",
Value: "10",
},
&api_pb.ParameterAssignment{
{
Name: "param2",
Value: "0.1",
},
Expand All @@ -337,38 +337,38 @@ func TestGetTrialList(t *testing.T) {
CompletionTime: "",
Observation: &api_pb.Observation{
Metrics: []*api_pb.Metric{
&api_pb.Metric{
{
Name: "f1_score",
Value: "88.95",
},
&api_pb.Metric{
{
Name: "loss",
Value: "0.5",
},
&api_pb.Metric{
{
Name: "precision",
Value: "88.7",
},
&api_pb.Metric{
{
Name: "recall",
Value: "89.2",
},
},
},
},
},
&api_pb.Trial{
{
Name: "test1-trial2",
Spec: &api_pb.TrialSpec{
ExperimentName: "test1",
RunSpec: "",
ParameterAssignments: &api_pb.TrialSpec_ParameterAssignments{
Assignments: []*api_pb.ParameterAssignment{
&api_pb.ParameterAssignment{
{
Name: "param1",
Value: "20",
},
&api_pb.ParameterAssignment{
{
Name: "param2",
Value: "0.5",
},
Expand Down Expand Up @@ -413,11 +413,11 @@ func TestGetTrial(t *testing.T) {
RunSpec: "",
ParameterAssignments: &api_pb.TrialSpec_ParameterAssignments{
Assignments: []*api_pb.ParameterAssignment{
&api_pb.ParameterAssignment{
{
Name: "param1",
Value: "10",
},
&api_pb.ParameterAssignment{
{
Name: "param2",
Value: "0.1",
},
Expand All @@ -430,19 +430,19 @@ func TestGetTrial(t *testing.T) {
CompletionTime: "",
Observation: &api_pb.Observation{
Metrics: []*api_pb.Metric{
&api_pb.Metric{
{
Name: "f1_score",
Value: "88.95",
},
&api_pb.Metric{
{
Name: "loss",
Value: "0.5",
},
&api_pb.Metric{
{
Name: "precision",
Value: "88.7",
},
&api_pb.Metric{
{
Name: "recall",
Value: "89.2",
},
Expand Down Expand Up @@ -475,19 +475,19 @@ func TestUpdateTrialStatus(t *testing.T) {
CompletionTime: "2019-02-03T05:05:06+09:00",
Observation: &api_pb.Observation{
Metrics: []*api_pb.Metric{
&api_pb.Metric{
{
Name: "f1_score",
Value: "88.95",
},
&api_pb.Metric{
{
Name: "loss",
Value: "0.5",
},
&api_pb.Metric{
{
Name: "precision",
Value: "88.7",
},
&api_pb.Metric{
{
Name: "recall",
Value: "89.2",
},
Expand All @@ -513,28 +513,28 @@ func TestReportObservationLog(t *testing.T) {
TrialName: "test1-trial1",
ObservationLog: &api_pb.ObservationLog{
MetricLogs: []*api_pb.MetricLog{
&api_pb.MetricLog{
{
TimeStamp: "2019-02-03T04:05:06+09:00",
Metric: &api_pb.Metric{
Name: "f1_score",
Value: "88.95",
},
},
&api_pb.MetricLog{
{
TimeStamp: "2019-02-03T04:05:06+09:00",
Metric: &api_pb.Metric{
Name: "loss",
Value: "0.5",
},
},
&api_pb.MetricLog{
{
TimeStamp: "2019-02-03T04:05:06+09:00",
Metric: &api_pb.Metric{
Name: "precision",
Value: "88.7",
},
},
&api_pb.MetricLog{
{
TimeStamp: "2019-02-03T04:05:06+09:00",
Metric: &api_pb.Metric{
Name: "recall",
Expand Down Expand Up @@ -566,28 +566,28 @@ func TestGetObservationLog(t *testing.T) {

obs := &api_pb.ObservationLog{
MetricLogs: []*api_pb.MetricLog{
&api_pb.MetricLog{
{
TimeStamp: "2019-02-03T04:05:06+09:00",
Metric: &api_pb.Metric{
Name: "f1_score",
Value: "88.95",
},
},
&api_pb.MetricLog{
{
TimeStamp: "2019-02-03T04:05:06+09:00",
Metric: &api_pb.Metric{
Name: "loss",
Value: "0.5",
},
},
&api_pb.MetricLog{
{
TimeStamp: "2019-02-03T04:05:06+09:00",
Metric: &api_pb.Metric{
Name: "precision",
Value: "88.7",
},
},
&api_pb.MetricLog{
{
TimeStamp: "2019-02-03T04:05:06+09:00",
Metric: &api_pb.Metric{
Name: "recall",
Expand Down
6 changes: 3 additions & 3 deletions pkg/common/v1alpha2/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import (

func GetSupportedJobList() []schema.GroupVersionKind {
supportedJobList := []schema.GroupVersionKind{
schema.GroupVersionKind{
{
Group: "batch",
Version: "v1",
Kind: "Job",
},
schema.GroupVersionKind{
{
Group: "kubeflow.org",
Version: "v1beta2",
Kind: "TFJob",
},
schema.GroupVersionKind{
{
Group: "kubeflow.org",
Version: "v1beta2",
Kind: "PyTorchJob",
Expand Down
14 changes: 7 additions & 7 deletions pkg/common/v1alpha2/katib_manager_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ func GetSuggestions(request *api_pb.GetSuggestionsRequest) (*api_pb.GetSuggestio

func PreCheckRegisterExperiment(request *api_pb.RegisterExperimentRequest) (*api_pb.PreCheckRegisterExperimentReply, error) {
ctx := context.Background()
kcc, err := getKatibManagerClientAndConn()
if err != nil {
return nil, err
}
defer closeKatibManagerConnection(kcc)
kc := kcc.KatibManagerClient
return kc.PreCheckRegisterExperiment(ctx, request)
kcc, err := getKatibManagerClientAndConn()
if err != nil {
return nil, err
}
defer closeKatibManagerConnection(kcc)
kc := kcc.KatibManagerClient
return kc.PreCheckRegisterExperiment(ctx, request)
}

func GetObservationLog(request *api_pb.GetObservationLogRequest) (*api_pb.GetObservationLogReply, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/v1alpha1/studyjob/studyjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ func (r *ReconcileStudyJobController) getAndRunSuggestion(instance *katibv1alpha
katibv1alpha1.TrialSet{
TrialID: t.TrialId,
WorkerList: []katibv1alpha1.WorkerCondition{
katibv1alpha1.WorkerCondition{
{
WorkerID: wid,
Kind: wkind.Kind,
Condition: katibv1alpha1.ConditionCreated,
Expand Down
2 changes: 1 addition & 1 deletion pkg/db/v1alpha1/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func TestCreateStudyIdGeneration(t *testing.T) {
}
t.Logf("id gen %d %s %v\n", i, id, err)
}
for id, _ := range encountered {
for id := range encountered {
err := mysqlInterface.DeleteStudy(id)
if err != nil {
t.Errorf("DeleteStudy error %v", err)
Expand Down
Loading

0 comments on commit be51751

Please sign in to comment.