MCPcopy Index your code
hub / github.com/hyperopt/hyperopt / trial_attachments

Method trial_attachments

hyperopt/base.py:310–332  ·  view source on GitHub ↗

Support syntax for load: self.trial_attachments(doc)[name] # -- does this work syntactically? # (In any event a 2-stage store will work) Support syntax for store: self.trial_attachments(doc)[name] = value

(self, trial)

Source from the content-addressed store, hash-verified

308 return "ATTACH::{}::{}".format(trial["tid"], name)
309
310 def trial_attachments(self, trial):
311 """
312 Support syntax for load: self.trial_attachments(doc)[name]
313 # -- does this work syntactically?
314 # (In any event a 2-stage store will work)
315 Support syntax for store: self.trial_attachments(doc)[name] = value
316 """
317
318 # don't offer more here than in MongoCtrl
319 class Attachments:
320 def __contains__(_self, name):
321 return self.aname(trial, name) in self.attachments
322
323 def __getitem__(_self, name):
324 return self.attachments[self.aname(trial, name)]
325
326 def __setitem__(_self, name, value):
327 self.attachments[self.aname(trial, name)] = value
328
329 def __delitem__(_self, name):
330 del self.attachments[self.aname(trial, name)]
331
332 return Attachments()
333
334 def __iter__(self):
335 try:

Callers 2

main_plot_1D_attachmentFunction · 0.45
attachmentsMethod · 0.45

Calls 1

AttachmentsClass · 0.70

Tested by

no test coverage detected