MCPcopy
hub / github.com/hyperopt/hyperopt / __init__

Method __init__

hyperopt/mongoexp.py:683–700  ·  view source on GitHub ↗
(self, arg, exp_key=None, cmd=None, workdir=None, refresh=True)

Source from the content-addressed store, hash-verified

681 asynchronous = True
682
683 def __init__(self, arg, exp_key=None, cmd=None, workdir=None, refresh=True):
684 if not _has_mongo:
685 raise Exception(
686 "MongoTrials cannot import pymongo classes. Make sure that pymongo "
687 "is available in your environment. E.g., try running 'import pymongo'"
688 )
689
690 if isinstance(arg, MongoJobs):
691 self.handle = arg
692 else:
693 connection_string = arg
694 self.handle = MongoJobs.new_from_connection_str(connection_string)
695 self.handle.create_indexes()
696 self._exp_key = exp_key
697 self.cmd = cmd
698 self.workdir = workdir
699 if refresh:
700 self.refresh()
701
702 def view(self, exp_key=None, cmd=None, workdir=None, refresh=True):
703 rval = self.__class__(

Callers

nothing calls this directly

Calls 3

refreshMethod · 0.95
create_indexesMethod · 0.80

Tested by

no test coverage detected