@@ -254,27 +254,16 @@ def check(self):
254254 validators .validate_data (self .metadata , 'enginemetadata.json' , 'input' , 'POST' , optional = True )
255255
256256 ###
257- # Remove when switch to dmv2 is complete across all gears
258- c_metadata = self .metadata .get (self .container_type , {}) # pragma: no cover
259- if self .context .get ('job_id' ) and c_metadata and not c_metadata .get ('files' , []): # pragma: no cover
260- job = Job .get (self .context .get ('job_id' ))
261- input_names = [{'name' : v .name } for v in job .inputs .itervalues ()]
262-
263- measurement = self .metadata .get (self .container_type , {}).pop ('measurement' , None )
264- info = self .metadata .get (self .container_type ,{}).pop ('metadata' , None )
265- modality = self .metadata .get (self .container_type , {}).pop ('instrument' , None )
266- if measurement or info or modality :
267- files_ = self .metadata [self .container_type ].get ('files' , [])
268- files_ += input_names
269- for f in files_ :
270- if measurement :
271- f ['measurements' ] = [measurement ]
272- if info :
273- f ['info' ] = info
274- if modality :
275- f ['modality' ] = modality
276-
277- self .metadata [self .container_type ]['files' ] = files_
257+ # Shuttle `measurements` key into `classification` on files
258+ ###
259+
260+ if self .metadata .get (self .container_type , {}): # pragma: no cover
261+
262+ for f in self .metadata [self .container_type ].get ('files' , []):
263+
264+ if 'measurements' in f :
265+ m = f .pop ('measurements' )
266+ f ['classification' ] = {'Custom' : m }
278267 ###
279268
280269
0 commit comments