You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Element class subclasses dataclass which comes inbuilt with various helper functions like __repr__, etc. However, comparisons between Elements will fail as the Element class has attributes that are numpy arrays which have ambiguous equality results unless using something like np.array_equal or similar.
This enhancement will extend the inbuilt __eq__ method provided by dataclass and ensure that numpy arrays are handled correctly.
Justification for the Enhancement
Due to the numpy arrays, it's currently not possible to do the following:
element_1 == element_2
By more intelligently handling the numpy arrays the above will be possible, it will simplify code testing, improve readability and be more pythonic.
Impact of Changes
Will simplify test suite and long term improve readability.
The text was updated successfully, but these errors were encountered:
Description of the Enhancement
The
Element
class subclassesdataclass
which comes inbuilt with various helper functions like__repr__
, etc. However, comparisons betweenElements
will fail as theElement
class has attributes that are numpy arrays which have ambiguous equality results unless using something likenp.array_equal
or similar.This enhancement will extend the inbuilt
__eq__
method provided bydataclass
and ensure that numpy arrays are handled correctly.Justification for the Enhancement
Due to the numpy arrays, it's currently not possible to do the following:
By more intelligently handling the numpy arrays the above will be possible, it will simplify code testing, improve readability and be more pythonic.
Impact of Changes
Will simplify test suite and long term improve readability.
The text was updated successfully, but these errors were encountered: