Skip to content

Commit

Permalink
Remove __eq__ from ButlerCollections and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Aug 16, 2024
1 parent 312cc2b commit d2a2e12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions python/lsst/daf/butler/_butler_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from abc import ABC, abstractmethod
from collections.abc import Iterable, Sequence, Set
from typing import Any, overload
from typing import overload

from pydantic import BaseModel

Expand Down Expand Up @@ -68,12 +68,6 @@ def __getitem__(self, index: int | slice) -> str | Sequence[str]:
def __len__(self) -> int:
return len(self.defaults)

def __eq__(self, other: Any) -> bool:
# Do not try to compare registry instances.
if not isinstance(other, type(self)):
return False
return self.defaults == other.defaults

@property
@abstractmethod
def defaults(self) -> Sequence[str]:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ def testPickle(self) -> None:
butlerOut = pickle.loads(pickle.dumps(butler))
self.assertIsInstance(butlerOut, Butler)
self.assertEqual(butlerOut._config, butler._config)
self.assertEqual(butlerOut.collections, butler.collections)
self.assertEqual(list(butlerOut.collections.defaults), list(butler.collections.defaults))
self.assertEqual(butlerOut.run, butler.run)

def testGetDatasetTypes(self) -> None:
Expand Down

0 comments on commit d2a2e12

Please sign in to comment.