Repository navigation
Angle.to_string() returns a 0-d array with dtype=object - #1374
Merged
Merged
Conversation
Member
|
I've run into this before and I'm +1 on changing this to return a unicode object. |
Contributor
|
I commented on this already here: #1006 (comment) Practically speaking, what is the downside here. Arrays of objects is, unfortunately, the "standard" way to represent variable length strings in Numpy, and Numpy provides no good way to do otherwise. |
Member
Author
|
When I ask for something as a string, then I expect string operations to work: What would be the downside of a final check for |
Contributor
|
I see. That makes sense. It seems that in the case of an array (not scalar), this requirement already holds, so there's nothing to do there: |
mdboom
added a commit
that referenced
this pull request
Sep 3, 2013
Angle.to_string() returns a 0-d array with dtype=object
taldcroft
added a commit
to taldcroft/astropy
that referenced
this pull request
Sep 3, 2013
taldcroft
added a commit
that referenced
this pull request
Sep 3, 2013
Fix angle doc examples after #1374
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not sure if this is intended:
I would have expected a plain string (or unicode obj) here.
In the case where the
Angleis representing an array of angles, I would expectto_string()to return a numpy array withdtype='S..'.