@@ -68,53 +68,29 @@ describe('HparamsDataSource Test', () => {
68
68
httpMock
69
69
. expectOne ( '/experiment/eid/data/plugin/hparams/experiment' )
70
70
. flush ( createHparamsExperimentResponse ( ) ) ;
71
- expect ( returnValue ) . toHaveBeenCalledWith ( {
72
- hparams : [
73
- {
74
- description : 'describes hparams one' ,
75
- displayName : 'hparams one' ,
76
- name : 'hparams1' ,
77
- type : BackendHparamsValueType . DATA_TYPE_STRING ,
78
- domain : {
79
- type : DomainType . INTERVAL ,
80
- minValue : - 100 ,
81
- maxValue : 100 ,
82
- } ,
83
- } ,
84
- {
85
- description : 'describes hparams two' ,
86
- displayName : 'hparams two' ,
87
- name : 'hparams2' ,
88
- type : BackendHparamsValueType . DATA_TYPE_BOOL ,
89
- domain : {
90
- type : DomainType . DISCRETE ,
91
- values : [ 'foo' , 'bar' , 'baz' ] ,
92
- } ,
71
+ expect ( returnValue ) . toHaveBeenCalledWith ( [
72
+ {
73
+ description : 'describes hparams one' ,
74
+ displayName : 'hparams one' ,
75
+ name : 'hparams1' ,
76
+ type : BackendHparamsValueType . DATA_TYPE_STRING ,
77
+ domain : {
78
+ type : DomainType . INTERVAL ,
79
+ minValue : - 100 ,
80
+ maxValue : 100 ,
93
81
} ,
94
- ] ,
95
- metrics : [
96
- {
97
- name : {
98
- tag : 'metrics1' ,
99
- group : '' ,
100
- } ,
101
- tag : 'metrics1' ,
102
- displayName : 'Metrics One' ,
103
- description : 'describe metrics one' ,
104
- datasetType : DatasetType . DATASET_UNKNOWN ,
105
- } ,
106
- {
107
- name : {
108
- tag : 'metrics2' ,
109
- group : 'group' ,
110
- } ,
111
- tag : 'metrics2' ,
112
- displayName : 'Metrics Two' ,
113
- description : 'describe metrics two' ,
114
- datasetType : DatasetType . DATASET_TRAINING ,
82
+ } ,
83
+ {
84
+ description : 'describes hparams two' ,
85
+ displayName : 'hparams two' ,
86
+ name : 'hparams2' ,
87
+ type : BackendHparamsValueType . DATA_TYPE_BOOL ,
88
+ domain : {
89
+ type : DomainType . DISCRETE ,
90
+ values : [ 'foo' , 'bar' , 'baz' ] ,
115
91
} ,
116
- ] ,
117
- } ) ;
92
+ } ,
93
+ ] ) ;
118
94
} ) ;
119
95
120
96
it ( 'treats missing domains as discrete domains' , ( ) => {
@@ -123,41 +99,35 @@ describe('HparamsDataSource Test', () => {
123
99
httpMock
124
100
. expectOne ( '/experiment/eid/data/plugin/hparams/experiment' )
125
101
. flush ( createHparamsExperimentNoDomainResponse ( ) ) ;
126
- expect ( returnValue ) . toHaveBeenCalledWith (
127
- jasmine . objectContaining ( {
128
- hparams : [
129
- {
130
- description : 'describes hparams one' ,
131
- displayName : 'hparams one' ,
132
- name : 'hparams1' ,
133
- type : BackendHparamsValueType . DATA_TYPE_STRING ,
134
- domain : {
135
- type : DomainType . DISCRETE ,
136
- values : [ ] ,
137
- } ,
138
- } ,
139
- {
140
- description : 'describes hparams two' ,
141
- displayName : 'hparams two' ,
142
- name : 'hparams2' ,
143
- type : BackendHparamsValueType . DATA_TYPE_BOOL ,
144
- domain : {
145
- type : DomainType . DISCRETE ,
146
- values : [ 'foo' , 'bar' , 'baz' ] ,
147
- } ,
148
- } ,
149
- ] ,
150
- } )
151
- ) ;
102
+ expect ( returnValue ) . toHaveBeenCalledWith ( [
103
+ {
104
+ description : 'describes hparams one' ,
105
+ displayName : 'hparams one' ,
106
+ name : 'hparams1' ,
107
+ type : BackendHparamsValueType . DATA_TYPE_STRING ,
108
+ domain : {
109
+ type : DomainType . DISCRETE ,
110
+ values : [ ] ,
111
+ } ,
112
+ } ,
113
+ {
114
+ description : 'describes hparams two' ,
115
+ displayName : 'hparams two' ,
116
+ name : 'hparams2' ,
117
+ type : BackendHparamsValueType . DATA_TYPE_BOOL ,
118
+ domain : {
119
+ type : DomainType . DISCRETE ,
120
+ values : [ 'foo' , 'bar' , 'baz' ] ,
121
+ } ,
122
+ } ,
123
+ ] ) ;
152
124
} ) ;
153
125
} ) ;
154
126
155
127
describe ( 'fetchSessionGroups' , ( ) => {
156
128
it ( 'uses /experiment when a single experiment id is provided' , ( ) => {
157
129
const returnValue = jasmine . createSpy ( ) ;
158
- dataSource
159
- . fetchSessionGroups ( [ 'eid' ] , { hparams : [ ] , metrics : [ ] } )
160
- . subscribe ( returnValue ) ;
130
+ dataSource . fetchSessionGroups ( [ 'eid' ] , [ ] ) . subscribe ( returnValue ) ;
161
131
httpMock
162
132
. expectOne ( '/experiment/eid/data/plugin/hparams/session_groups' )
163
133
. flush ( createHparamsListSessionGroupResponse ( ) ) ;
@@ -167,7 +137,7 @@ describe('HparamsDataSource Test', () => {
167
137
it ( 'uses /compare when a multiple experiment ids are provided' , ( ) => {
168
138
const returnValue = jasmine . createSpy ( ) ;
169
139
dataSource
170
- . fetchSessionGroups ( [ 'eid1' , 'eid2' ] , { hparams : [ ] , metrics : [ ] } )
140
+ . fetchSessionGroups ( [ 'eid1' , 'eid2' ] , [ ] )
171
141
. subscribe ( returnValue ) ;
172
142
httpMock
173
143
. expectOne ( '/compare/0:eid1,1:eid2/data/plugin/hparams/session_groups' )
@@ -180,9 +150,7 @@ describe('HparamsDataSource Test', () => {
180
150
const callback = ( resp : SessionGroup [ ] ) => {
181
151
sessionGroups = resp ;
182
152
} ;
183
- dataSource
184
- . fetchSessionGroups ( [ 'eid' ] , { hparams : [ ] , metrics : [ ] } )
185
- . subscribe ( callback ) ;
153
+ dataSource . fetchSessionGroups ( [ 'eid' ] , [ ] ) . subscribe ( callback ) ;
186
154
httpMock
187
155
. expectOne ( '/experiment/eid/data/plugin/hparams/session_groups' )
188
156
. flush ( createHparamsListSessionGroupResponse ( ) ) ;
@@ -195,9 +163,7 @@ describe('HparamsDataSource Test', () => {
195
163
const callback = ( resp : SessionGroup [ ] ) => {
196
164
sessionGroups = resp ;
197
165
} ;
198
- dataSource
199
- . fetchSessionGroups ( [ 'eid1' , 'eid2' ] , { hparams : [ ] , metrics : [ ] } )
200
- . subscribe ( callback ) ;
166
+ dataSource . fetchSessionGroups ( [ 'eid1' , 'eid2' ] , [ ] ) . subscribe ( callback ) ;
201
167
202
168
const response = createHparamsListSessionGroupResponse ( ) ;
203
169
// This is the format expected in comparison view.
@@ -333,26 +299,7 @@ export function createHparamsExperimentResponse(): BackendHparamsExperimentRespo
333
299
domainDiscrete : [ 'foo' , 'bar' , 'baz' ] ,
334
300
} ,
335
301
] ,
336
- metricInfos : [
337
- {
338
- name : {
339
- group : '' ,
340
- tag : 'metrics1' ,
341
- } ,
342
- displayName : 'Metrics One' ,
343
- description : 'describe metrics one' ,
344
- datasetType : DatasetType . DATASET_UNKNOWN ,
345
- } ,
346
- {
347
- name : {
348
- group : 'group' ,
349
- tag : 'metrics2' ,
350
- } ,
351
- displayName : 'Metrics Two' ,
352
- description : 'describe metrics two' ,
353
- datasetType : DatasetType . DATASET_TRAINING ,
354
- } ,
355
- ] ,
302
+ metricInfos : [ ] ,
356
303
name : 'experiment name' ,
357
304
timeCreatedSecs : 1337 ,
358
305
user : 'user name' ,
@@ -377,26 +324,7 @@ export function createHparamsExperimentNoDomainResponse(): BackendHparamsExperim
377
324
domainDiscrete : [ 'foo' , 'bar' , 'baz' ] ,
378
325
} ,
379
326
] ,
380
- metricInfos : [
381
- {
382
- name : {
383
- group : '' ,
384
- tag : 'metrics1' ,
385
- } ,
386
- displayName : 'Metrics One' ,
387
- description : 'describe metrics one' ,
388
- datasetType : DatasetType . DATASET_UNKNOWN ,
389
- } ,
390
- {
391
- name : {
392
- group : 'group' ,
393
- tag : 'metrics2' ,
394
- } ,
395
- displayName : 'Metrics Two' ,
396
- description : 'describe metrics two' ,
397
- datasetType : DatasetType . DATASET_TRAINING ,
398
- } ,
399
- ] ,
327
+ metricInfos : [ ] ,
400
328
name : 'experiment name' ,
401
329
timeCreatedSecs : 1337 ,
402
330
user : 'user name' ,
0 commit comments