-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
COO constructor behavior #151
Comments
I'm +1 on all counts. What I propose (the constructor doesn't support this unless otherwise stated):
cc @mrocklin if you're +1 on this, I can put together a PR. |
Happy either way. Explicit methods are probably nicer on maintainers, all-in-one constructors are probably nicer for users. Numpy and Pandas mostly went with the all-in-one constructors approach. It has pros and cons. |
Numpy has a clear definition of what One thing we can do, however, is better document the currently supported arguments, separate them out into the functions I laid out above so that the constructor can just dispatch to |
The COO constructor currently accepts many inputs. While this flexibility is nice, it isn't fully documented yet and we might want to modify it further. Here are a couple of points to start the discussion
COO
convert dense numpy arrays or should we forceCOO.from_numpy(...)
to be called separately?If we added a
dtype
option to the constructor I think this would be even more ambiguous.I suppose my confusion here stems from the assumption that calling
s = COO(coords, dtype=...)
without specifyingdata
would initializeself.data
withnp.empty(dtype=dtype)
{(i, j, k): x, (i, j, k): y, ...}
or[((i, j, k), value), (i, j, k), value), ...]
are also accepted but don't seem to be documented? Should these be accepted to the constructor or should we provide class method for it (e.g.COO.from_dict(...)
)The text was updated successfully, but these errors were encountered: