(self, arg, exp_key=None, cmd=None, workdir=None, refresh=True)
| 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__( |
nothing calls this directly
no test coverage detected