added a sanity check to prevent passing both client and url to MongoObserver.
see
@@ -53,7 +53,7 @@ class MongoObserver(RunObserver):
VERSION = 'MongoObserver-0.7.0'
@staticmethod
- def create(url='localhost', db_name='sacred', collection='runs',
+ def create(url=None, db_name='sacred', collection='runs',
overwrite=None, priority=DEFAULT_MONGO_PRIORITY,
client=None, **kwargs):
import pymongo
@@ -61,6 +61,7 @@ class MongoObserver(RunObserver):
if client is not None:
assert isinstance(client, pymongo.MongoClient)
+ assert url is None, 'Cannot pass both a client and an url.'
else:
client = pymongo.MongoClient(url, **kwargs)
database = client[db_name]
