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
Dealing with nested lists of quantities #7341
Comments
This works but it is not super elegant either. >>> u.Quantity(list(map(u.Quantity, [[lonmin,lonmax],[latmin,latmax]])))
<Quantity [[ 1., 3.],
[-1., 1.]] deg> |
It might work to rework the whole is-this-a-list-of-Quantity check currently in the initializer and instead replace a failure in the
|
Looking over old issues: this one should now be solved, if one uses
So, closing! |
The original syntax is still not supported, though, right? Can the quantity initializer not use |
Yes, perhaps instead of our custom code that goes through the list it could just call |
p.s. |
I often end up with individual quantities that I want to stitch together into arrays. For example:
However, if I have nested lists, we get
ValueError: setting an array element with a sequence.
shows upIs there a better approach than just looping over each individual value? I don't like the approach of:
because it's tedious and inflexible.
The text was updated successfully, but these errors were encountered: