diff --git a/src/nitypes/bintime/_datetime.py b/src/nitypes/bintime/_datetime.py index 18d46512..00ca8e03 100644 --- a/src/nitypes/bintime/_datetime.py +++ b/src/nitypes/bintime/_datetime.py @@ -431,14 +431,14 @@ def __le__(self, value: DateTime | _OtherDateTime, /) -> bool: else: return NotImplemented - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if isinstance(value, self.__class__): - return self._offset == value._offset - elif isinstance(value, ht.datetime): - return self._to_hightime_datetime() == value - elif isinstance(value, dt.datetime): - return self == self.__class__(value) + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if isinstance(other, self.__class__): + return self._offset == other._offset + elif isinstance(other, ht.datetime): + return self._to_hightime_datetime() == other + elif isinstance(other, dt.datetime): + return self == self.__class__(other) else: return NotImplemented diff --git a/src/nitypes/bintime/_timedelta.py b/src/nitypes/bintime/_timedelta.py index 4d41acb4..e7c35f16 100644 --- a/src/nitypes/bintime/_timedelta.py +++ b/src/nitypes/bintime/_timedelta.py @@ -499,14 +499,14 @@ def __le__(self, value: TimeDelta | _OtherTimeDelta, /) -> bool: else: return NotImplemented - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if isinstance(value, self.__class__): - return self._ticks == value._ticks - elif isinstance(value, ht.timedelta): - return self._to_hightime_timedelta() == value - elif isinstance(value, dt.timedelta): - return self == self.__class__(value) + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if isinstance(other, self.__class__): + return self._ticks == other._ticks + elif isinstance(other, ht.timedelta): + return self._to_hightime_timedelta() == other + elif isinstance(other, dt.timedelta): + return self == self.__class__(other) else: return NotImplemented diff --git a/src/nitypes/vector.py b/src/nitypes/vector.py index ff719c4d..5159876e 100644 --- a/src/nitypes/vector.py +++ b/src/nitypes/vector.py @@ -201,11 +201,11 @@ def insert(self, index: int, value: TScalar) -> None: raise self._create_value_mismatch_exception(value) self._values.insert(index, value) - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if not isinstance(value, self.__class__): + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if not isinstance(other, self.__class__): return NotImplemented - return self._values == value._values and self.units == value.units + return self._values == other._values and self.units == other.units def __reduce__(self) -> tuple[Any, ...]: """Return object state for pickling.""" diff --git a/src/nitypes/waveform/_digital/_signal.py b/src/nitypes/waveform/_digital/_signal.py index 79b7ee28..cd7d4575 100644 --- a/src/nitypes/waveform/_digital/_signal.py +++ b/src/nitypes/waveform/_digital/_signal.py @@ -82,12 +82,12 @@ def name(self) -> str: def name(self, value: str) -> None: self._owner._set_line_name(self._column_index, value) - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if not isinstance(value, self.__class__): + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if not isinstance(other, self.__class__): return NotImplemented # Do not compare the index or name. - return np.array_equal(self.data, value.data) + return np.array_equal(self.data, other.data) def __reduce__(self) -> tuple[Any, ...]: """Return object state for pickling.""" diff --git a/src/nitypes/waveform/_digital/_waveform.py b/src/nitypes/waveform/_digital/_waveform.py index 7d542148..ec016b5e 100644 --- a/src/nitypes/waveform/_digital/_waveform.py +++ b/src/nitypes/waveform/_digital/_waveform.py @@ -1362,15 +1362,15 @@ def _reverse_index(self, index: int) -> int: assert 0 <= index < self.signal_count return self.signal_count - 1 - index - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if not isinstance(value, self.__class__): + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if not isinstance(other, self.__class__): return NotImplemented return ( - self.dtype == value.dtype - and np.array_equal(self.data, value.data) - and self._extended_properties == value._extended_properties - and self._timing == value._timing + self.dtype == other.dtype + and np.array_equal(self.data, other.data) + and self._extended_properties == other._extended_properties + and self._timing == other._timing ) def __reduce__(self) -> tuple[Any, ...]: diff --git a/src/nitypes/waveform/_numeric.py b/src/nitypes/waveform/_numeric.py index a8ccb828..be741e31 100644 --- a/src/nitypes/waveform/_numeric.py +++ b/src/nitypes/waveform/_numeric.py @@ -734,16 +734,16 @@ def _load_array( self._start_index = start_index self._sample_count = sample_count - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if not isinstance(value, self.__class__): + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if not isinstance(other, self.__class__): return NotImplemented return ( - self.dtype == value.dtype - and np.array_equal(self.raw_data, value.raw_data) - and self._extended_properties == value._extended_properties - and self._timing == value._timing - and self._scale_mode == value._scale_mode + self.dtype == other.dtype + and np.array_equal(self.raw_data, other.raw_data) + and self._extended_properties == other._extended_properties + and self._timing == other._timing + and self._scale_mode == other._scale_mode ) def __reduce__(self) -> tuple[Any, ...]: diff --git a/src/nitypes/waveform/_scaling/_linear.py b/src/nitypes/waveform/_scaling/_linear.py index e8e01be8..0f148da7 100644 --- a/src/nitypes/waveform/_scaling/_linear.py +++ b/src/nitypes/waveform/_scaling/_linear.py @@ -50,11 +50,11 @@ def _transform_data(self, data: npt.NDArray[_ScalarType]) -> npt.NDArray[_Scalar # npt.NDArray[np.float32] with a float promotes dtype to Any or np.float64 return data * self._gain + self._offset # type: ignore[operator,no-any-return] - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if not isinstance(value, self.__class__): + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if not isinstance(other, self.__class__): return NotImplemented - return self._gain == value._gain and self._offset == value._offset + return self._gain == other._gain and self._offset == other._offset def __repr__( self, diff --git a/src/nitypes/waveform/_scaling/_none.py b/src/nitypes/waveform/_scaling/_none.py index 8c9d4149..a606d33d 100644 --- a/src/nitypes/waveform/_scaling/_none.py +++ b/src/nitypes/waveform/_scaling/_none.py @@ -21,9 +21,9 @@ class NoneScaleMode(ScaleMode): def _transform_data(self, data: npt.NDArray[_ScalarType]) -> npt.NDArray[_ScalarType]: return data - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if not isinstance(value, self.__class__): + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if not isinstance(other, self.__class__): return NotImplemented return True diff --git a/src/nitypes/waveform/_spectrum.py b/src/nitypes/waveform/_spectrum.py index fec2ea86..85b86ac8 100644 --- a/src/nitypes/waveform/_spectrum.py +++ b/src/nitypes/waveform/_spectrum.py @@ -742,16 +742,16 @@ def _load_array( self._start_index = start_index self._sample_count = sample_count - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if not isinstance(value, self.__class__): + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if not isinstance(other, self.__class__): return NotImplemented return ( - self.dtype == value.dtype - and np.array_equal(self.data, value.data) - and self.start_frequency == value.start_frequency - and self.frequency_increment == value.frequency_increment - and self._extended_properties == value._extended_properties + self.dtype == other.dtype + and np.array_equal(self.data, other.data) + and self.start_frequency == other.start_frequency + and self.frequency_increment == other.frequency_increment + and self._extended_properties == other._extended_properties ) def __reduce__(self) -> tuple[Any, ...]: diff --git a/src/nitypes/waveform/_timing/_timing.py b/src/nitypes/waveform/_timing/_timing.py index 718aa423..1f87417a 100644 --- a/src/nitypes/waveform/_timing/_timing.py +++ b/src/nitypes/waveform/_timing/_timing.py @@ -320,16 +320,16 @@ def _convert( ), ) - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if not isinstance(value, self.__class__): + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if not isinstance(other, self.__class__): return NotImplemented return ( - self._timestamp == value._timestamp - and self._time_offset == value._time_offset - and self._sample_interval == value._sample_interval - and self._sample_interval_mode == value._sample_interval_mode - and self._timestamps == value._timestamps + self._timestamp == other._timestamp + and self._time_offset == other._time_offset + and self._sample_interval == other._sample_interval + and self._sample_interval_mode == other._sample_interval_mode + and self._timestamps == other._timestamps ) def __reduce__(self) -> tuple[Any, ...]: diff --git a/src/nitypes/xy_data.py b/src/nitypes/xy_data.py index 375b4882..e5f14b36 100644 --- a/src/nitypes/xy_data.py +++ b/src/nitypes/xy_data.py @@ -346,15 +346,15 @@ def extended_properties(self) -> ExtendedPropertyDictionary: """ return self._extended_properties - def __eq__(self, value: object, /) -> bool: - """Return self==value.""" - if not isinstance(value, self.__class__): + def __eq__(self, other: object, /) -> bool: + """Return self == other.""" + if not isinstance(other, self.__class__): return NotImplemented return ( - np.array_equal(self.x_data, value.x_data) - and np.array_equal(self.y_data, value.y_data) - and self.x_units == value.x_units - and self.y_units == value.y_units + np.array_equal(self.x_data, other.x_data) + and np.array_equal(self.y_data, other.y_data) + and self.x_units == other.x_units + and self.y_units == other.y_units ) def __reduce__(self) -> tuple[Any, ...]: