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
{{ message }}
Repository navigation
DOC: Document ma.filled behavior with non-scalar fill_value #4363
@eric-wieser Hello!
So as I understood, the doc should be this way:
fill_value : {None, array_like}, optional
If array_like, the resulting ndarray must be broadcastable
over `a`. Arrays with non-scalar fill values are deprecated. The default is None.
Also, there should be Deprecation Warning raised like:
warnings.warn(
"Arrays with non-scalar fill values are deprecated. Use "
"Arrays with scalar values instead".format(self.__name__),
DeprecationWarning, stacklevel=2)
I think we should compromise on allowing filled(...) to take a broadcasting value, and writing tests for it (it's easy to get right), but deprecating using an non-scalar fill value for fill_value (because getting that right is hard).
Ok, I will edit the docstring and add deprecation warning. I have several questions:
Is it necessary to add examples in docstrings?
And should I write a test? If yes, could you tell a specific file that contains tests in this method (to see the examples).
It is nice but not required to add examples in the docstrings. Some of them already have examples. If you do modify docstrings, make sure to run python runtests.py --refguide-check in addition to python runtests.py to make sure they pass tests.
You should always add tests for changed behaviour. Deprecation tests go into /numpy/ma/tests/test_deprecations.py, regulare masked array tests go in other files in that directory.
Activity
ay11111111111 commentedon Mar 31, 2019
HI! I am an Outreachy applicant and I guess, this is the only unassigned issue :) Can I solve it?
mattip commentedon Mar 31, 2019
@yesass yes, and please xref your pull request by putting
#4363in the comments so others will know you have started working on this.Fixes issue numpy#4363: updated docstrings
ay11111111111 commentedon Apr 2, 2019
@mattip Hi! Can you check it out? #13241
eric-wieser commentedon Apr 2, 2019
Lifting a comment from #10504:
ay11111111111 commentedon Apr 2, 2019
@eric-wieser Hello!
So as I understood, the doc should be this way:
Also, there should be Deprecation Warning raised like:
eric-wieser commentedon Apr 2, 2019
I think we should compromise on allowing
filled(...)to take a broadcasting value, and writing tests for it (it's easy to get right), but deprecating using an non-scalar fill value forfill_value(because getting that right is hard).mattip commentedon Apr 2, 2019
The deprecation warning should have a comment before it:
# 2019-04-02, 1.17.0, gh-4363ay11111111111 commentedon Apr 2, 2019
Ok, I will edit the docstring and add deprecation warning. I have several questions:
Is it necessary to add examples in docstrings?
And should I write a test? If yes, could you tell a specific file that contains tests in this method (to see the examples).
mattip commentedon Apr 2, 2019
It is nice but not required to add examples in the docstrings. Some of them already have examples. If you do modify docstrings, make sure to run
python runtests.py --refguide-checkin addition topython runtests.pyto make sure they pass tests.You should always add tests for changed behaviour. Deprecation tests go into
/numpy/ma/tests/test_deprecations.py, regulare masked array tests go in other files in that directory.