Skip to content

Commit

Permalink
Updating UVParameter.__eq__ not to use compare_value
Browse files Browse the repository at this point in the history
  • Loading branch information
kartographer authored and bhazelton committed Feb 9, 2025
1 parent 0ff5e15 commit dd8b192
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
11 changes: 0 additions & 11 deletions src/pyuvdata/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,17 +326,6 @@ def __eq__(self, other, *, silent=False):
if not (
isinstance(other, self.__class__) and isinstance(self, other.__class__)
):
# If the UVParameter value is of the same type, then compare that instead
if isinstance(other, self.value.__class__) and isinstance(
self.value, other.__class__
):
if not silent:
print(
f"{self.name} and other classes do not match, but "
f"{self.name}.value and other do -- comparing those instead."
)
return self.compare_value(other)

if not silent:
print(f"{self.name} parameter classes are different")
return False
Expand Down
5 changes: 2 additions & 3 deletions tests/uvdata/test_uvdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1558,9 +1558,8 @@ def test_select_antennas(casa_uvfits, invert, use_names, higher_dim, keep_meta):
uv_object.telescope.antenna_names = np.array(uv_object.telescope.antenna_names)
orig_telescope.antenna_names = np.array(orig_telescope.antenna_names)
for param in ["_antenna_names", "_antenna_positions"]:
assert (
getattr(uv_object.telescope, param)
== (getattr(orig_telescope, param[1:])[mask])
assert getattr(uv_object.telescope, param).compare_value(
getattr(orig_telescope, param[1:])[mask]
)
assert np.asarray(uv_object.telescope)

Expand Down

0 comments on commit dd8b192

Please sign in to comment.