Skip to content

Commit

Permalink
Merge 8faf5f0 into 854bf59
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldemarmiesse committed Jul 22, 2019
2 parents 854bf59 + 8faf5f0 commit bd9cdd1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
3 changes: 0 additions & 3 deletions sacred/observers/file_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,6 @@ def __eq__(self, other):
return self.basedir == other.basedir
return False

def __ne__(self, other):
return not self.__eq__(other)


class FileStorageOption(CommandLineOption):
"""Add a file-storage observer to the experiment."""
Expand Down
3 changes: 0 additions & 3 deletions sacred/observers/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ def __eq__(self, other):
return self.runs == other.runs
return False

def __ne__(self, other):
return not self.__eq__(other)


class MongoDbOption(CommandLineOption):
"""Add a MongoDB Observer to the experiment."""
Expand Down
3 changes: 0 additions & 3 deletions sacred/observers/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,3 @@ def __getattr__(self, item):

def __eq__(self, other):
return self._covered_observer == other

def __ne__(self, other):
return not self._covered_observer == other
3 changes: 0 additions & 3 deletions sacred/observers/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ def __eq__(self, other):
self.session == other.session)
return False

def __ne__(self, other):
return not self.__eq__(other)


# ######################## Commandline Option ############################### #

Expand Down
3 changes: 0 additions & 3 deletions sacred/observers/tinydb_hashfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ def __eq__(self, other):
return self.runs.all() == other.runs.all()
return False

def __ne__(self, other):
return not self.__eq__(other)


class TinyDbOption(CommandLineOption):
"""Add a TinyDB Observer to the experiment."""
Expand Down
8 changes: 8 additions & 0 deletions tests/test_observers/test_file_storage_observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,11 @@ def test_log_metrics(dir_obs, sample_run, logged_metrics):
accuracy = metrics["training.accuracy"]
assert accuracy["steps"] == [10, 20, 30]
assert accuracy["values"] == [100, 200, 300]


def test_observer_equality(tmpdir):
observer_1 = FileStorageObserver.create(tmpdir / 'a')
observer_2 = FileStorageObserver.create(tmpdir / 'b')
observer_3 = FileStorageObserver.create(tmpdir / 'a')
assert observer_1 == observer_3
assert observer_1 != observer_2

0 comments on commit bd9cdd1

Please sign in to comment.