def getSwarmModelParams(modelID):
 cjDAO = ClientJobsDAO.get()
 (jobID, description) = cjDAO.modelsGetFields(modelID, ['jobId', 'genDescription'])
 (baseDescription,) = cjDAO.jobGetFields(jobID, ['genBaseDescription'])
 descriptionDirectory = tempfile.mkdtemp()
 try:
  baseDescriptionFilePath = os.path.join(descriptionDirectory, 'base.py')
  with open(baseDescriptionFilePath, mode='wb') as f:
   f.write(baseDescription)
  descriptionFilePath = os.path.join(descriptionDirectory, 'description.py')
  with open(descriptionFilePath, mode='wb') as f:
   f.write(description)
  expIface = opfhelpers.getExperimentDescriptionInterfaceFromModule(opfhelpers.loadExperimentDescriptionScriptFromDir(descriptionDirectory))
  return json.dumps(dict(modelConfig=expIface.getModelDescription(), inferenceArgs=expIface.getModelControl().get('inferenceArgs', None)))
 finally:
  shutil.rmtree(descriptionDirectory, ignore_errors=True)

def getSwarmModelParams ( modelID ) : cjDAO = ClientJobsDAO . get ( ) ( jobID , description ) = cjDAO . modelsGetFields ( modelID , [ 'jobId' , 'genDescription' ] ) ( baseDescription , ) = cjDAO . jobGetFields ( jobID , [ 'genBaseDescription' ] ) descriptionDirectory = tempfile . mkdtemp ( ) try : baseDescriptionFilePath = os . path . join ( descriptionDirectory , 'base.py' ) with open ( baseDescriptionFilePath , mode = 'wb' ) as f : f . write ( baseDescription ) descriptionFilePath = os . path . join ( descriptionDirectory , 'description.py' ) with open ( descriptionFilePath , mode = 'wb' ) as f : f . write ( description ) expIface = opfhelpers . getExperimentDescriptionInterfaceFromModule ( opfhelpers . loadExperimentDescriptionScriptFromDir ( descriptionDirectory ) ) return json . dumps ( dict ( modelConfig = expIface . getModelDescription ( ) , inferenceArgs = expIface . getModelControl ( ) . get ( 'inferenceArgs' , None ) ) ) finally : shutil . rmtree ( descriptionDirectory , ignore_errors = True )
retrieve the engine-level model params from a swarm model args: modelid - engine-level model id of the swarm model returns: json-encoded string containing model params .