@@ -68,53 +68,29 @@ describe('HparamsDataSource Test', () => {
6868 httpMock
6969 . expectOne ( '/experiment/eid/data/plugin/hparams/experiment' )
7070 . 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 ,
9381 } ,
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' ] ,
11591 } ,
116- ] ,
117- } ) ;
92+ } ,
93+ ] ) ;
11894 } ) ;
11995
12096 it ( 'treats missing domains as discrete domains' , ( ) => {
@@ -123,41 +99,35 @@ describe('HparamsDataSource Test', () => {
12399 httpMock
124100 . expectOne ( '/experiment/eid/data/plugin/hparams/experiment' )
125101 . 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+ ] ) ;
152124 } ) ;
153125 } ) ;
154126
155127 describe ( 'fetchSessionGroups' , ( ) => {
156128 it ( 'uses /experiment when a single experiment id is provided' , ( ) => {
157129 const returnValue = jasmine . createSpy ( ) ;
158- dataSource
159- . fetchSessionGroups ( [ 'eid' ] , { hparams : [ ] , metrics : [ ] } )
160- . subscribe ( returnValue ) ;
130+ dataSource . fetchSessionGroups ( [ 'eid' ] , [ ] ) . subscribe ( returnValue ) ;
161131 httpMock
162132 . expectOne ( '/experiment/eid/data/plugin/hparams/session_groups' )
163133 . flush ( createHparamsListSessionGroupResponse ( ) ) ;
@@ -167,7 +137,7 @@ describe('HparamsDataSource Test', () => {
167137 it ( 'uses /compare when a multiple experiment ids are provided' , ( ) => {
168138 const returnValue = jasmine . createSpy ( ) ;
169139 dataSource
170- . fetchSessionGroups ( [ 'eid1' , 'eid2' ] , { hparams : [ ] , metrics : [ ] } )
140+ . fetchSessionGroups ( [ 'eid1' , 'eid2' ] , [ ] )
171141 . subscribe ( returnValue ) ;
172142 httpMock
173143 . expectOne ( '/compare/0:eid1,1:eid2/data/plugin/hparams/session_groups' )
@@ -180,9 +150,7 @@ describe('HparamsDataSource Test', () => {
180150 const callback = ( resp : SessionGroup [ ] ) => {
181151 sessionGroups = resp ;
182152 } ;
183- dataSource
184- . fetchSessionGroups ( [ 'eid' ] , { hparams : [ ] , metrics : [ ] } )
185- . subscribe ( callback ) ;
153+ dataSource . fetchSessionGroups ( [ 'eid' ] , [ ] ) . subscribe ( callback ) ;
186154 httpMock
187155 . expectOne ( '/experiment/eid/data/plugin/hparams/session_groups' )
188156 . flush ( createHparamsListSessionGroupResponse ( ) ) ;
@@ -195,9 +163,7 @@ describe('HparamsDataSource Test', () => {
195163 const callback = ( resp : SessionGroup [ ] ) => {
196164 sessionGroups = resp ;
197165 } ;
198- dataSource
199- . fetchSessionGroups ( [ 'eid1' , 'eid2' ] , { hparams : [ ] , metrics : [ ] } )
200- . subscribe ( callback ) ;
166+ dataSource . fetchSessionGroups ( [ 'eid1' , 'eid2' ] , [ ] ) . subscribe ( callback ) ;
201167
202168 const response = createHparamsListSessionGroupResponse ( ) ;
203169 // This is the format expected in comparison view.
@@ -333,26 +299,7 @@ export function createHparamsExperimentResponse(): BackendHparamsExperimentRespo
333299 domainDiscrete : [ 'foo' , 'bar' , 'baz' ] ,
334300 } ,
335301 ] ,
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 : [ ] ,
356303 name : 'experiment name' ,
357304 timeCreatedSecs : 1337 ,
358305 user : 'user name' ,
@@ -377,26 +324,7 @@ export function createHparamsExperimentNoDomainResponse(): BackendHparamsExperim
377324 domainDiscrete : [ 'foo' , 'bar' , 'baz' ] ,
378325 } ,
379326 ] ,
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 : [ ] ,
400328 name : 'experiment name' ,
401329 timeCreatedSecs : 1337 ,
402330 user : 'user name' ,
0 commit comments