We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traceback from a recent test with Numpy 1.20.0:
______________________ TestPlots.test_masked_array_limits ______________________ self = <desiutil.test.test_plots.TestPlots testMethod=test_masked_array_limits> def test_masked_array_limits(self): """Test MaskedArrayWithLimits """ from ..plots import MaskedArrayWithLimits data = np.arange(5.) mask = data < 3 > ma = MaskedArrayWithLimits(data, mask, vmin=1.0, vmax=4.0) py/desiutil/test/test_plots.py:46: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = <class 'desiutil.plots.MaskedArrayWithLimits'> args = (array([0., 1., 2., 3., 4.]), array([ True, True, True, False, False])) kwargs = {'vmax': 4.0, 'vmin': 1.0} def __new__(cls, *args, **kwargs): > obj = super(MaskedArrayWithLimits, cls).__new__(cls, *args, **kwargs) E TypeError: __new__() got an unexpected keyword argument 'vmin' py/desiutil/plots.py:157: TypeError
I suspect that the extra attributes could be added after the call to __new__().
__new__()
The text was updated successfully, but these errors were encountered:
After testing some testing, this seems to work:
try: obj = super(MaskedArrayWithLimits, cls).__new__(cls, *args, **kwargs) except TypeError: # Numpy >= 1.20.0 trimmed_kwargs = kwargs.copy() if 'vmin' in trimmed_kwargs: del trimmed_kwargs['vmin'] if 'vmax' in trimmed_kwargs: del trimmed_kwargs['vmax'] obj = super(MaskedArrayWithLimits, cls).__new__(cls, *args, **trimmed_kwargs)
Sorry, something went wrong.
weaverba137
Successfully merging a pull request may close this issue.
Traceback from a recent test with Numpy 1.20.0:
I suspect that the extra attributes could be added after the call to
__new__()
.The text was updated successfully, but these errors were encountered: