-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Possible problem with ragged-array as object deprecation #15041
New issue
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
Comments
The long range intent is to require an explicit EDIT: Although automatic promotion, as here, is something that needs consideration. |
The deeper problem is that even with
I am not sure what is correct. NumPy has chosen 2, but this is fragile, see the reverting of PR gh-13913 in gh-14341, and the reverting of gh-14800 in gh-14839 for moving forward with the What is the use case in astropy, pandas, or other places for such ragged arrays? Is it a replacement for masked arrays? |
This is affecting 85 tests in pandas's npdev build (https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=22337). A bunch of these I can fix by manually adding
LMK if this needs to go in a separate issue, dont want to hijack the thread. |
I created an issue. |
@mattip - before anything else, for astropy the problems are easy to fix (and have been). Your point about the ambiguity is well taken. I guess the question is whether in the example I gave, it is worth implicitly doing Possibly the best answer is to do nothing until a better case comes along! |
We have floated ideas of things such as |
I think users who want this should create an empty array of the correct shape and assign to it:
|
This is also causing ~40 test failures in Matplotlib. Will provide details soon(ish). |
@tacaswell is this thie old ragged array warning, or the new fix of empty array like handling? The |
What happened with this issues? It the current state acceptable for downstream (i.e. to remain identical for the 1.19 branch?) and all of the necessary fixups were done by now? The initial issue by Marten seems like we can fix it by just using |
Earlier, I wrote
Since no better cases for auto-converting seem to have come along, I think it makes sense to close this issue - for now, it avoids us building in some special-casing that might later be regretted. |
Thanks Marten. I was also wondering about the current state in matplotlib, @tacaswell I will close this though, please do reopen a new issue for the impact on other projects! |
Matplotlib is still broken, but @QuLogic is making progress on fixing it. |
@tacaswell good to hear, we are planning to branch 1.19 very soon, which means a release is within sight, so if this is disruptive if you do not have a release before that, then we can see what to do. Right now this is a VisibleDeprecationWarning, to inform users, but if users might face it becase of matplotlib internals, maybe a normal DeprecationWarning is better. |
That is matplotlib/matplotlib#17289, for reference. There's only one last thing to fix there. |
#14794 deprecated auto-creation of object arrays for ragged lists (hurray!!), which, perhaps not surprisingly is causing some test failures in astropy. We can address all those without problem (two out of three just need being more careful with the test), but I wasn't entirely sure whether a deprecation warning should be expected for the following:
In this case, arguably the intent is unambiguous: since one array is an object array, the list might as well be interpreted as an object array.
But it also seems fine to just be strict, so no problem if this is not fixed.
The text was updated successfully, but these errors were encountered: