Bug in write_ds9 for CircleSkyRegion #41
Merged
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.
I've run into this bug in
write_ds9
forCircleSkyRegion
:Removing the
TODO
and[0]
indexing here fixes the issue:https://github.com/astropy/regions/blame/master/regions/io/write_ds9.py#L44
But with this change, the tests that read and write ds9 regions start failing:
https://github.com/astropy/regions/blob/master/regions/io/tests/test_ds9_language.py#L27
because after reading regions,
center.shape
is(1,)
, and notcenter.shape == ()
scalar like in my code example above.@keflavich @joleroi - I guess the ds9 reader has to be fixed to return scalar
center
SkyCoord?Does one of you have time to have a look and implement a fix?
(If I remember correctly we discussed whether regions with array parameters should be supported and
PyAstro16
, and I think agreed we only want to do simple scalar regions because vector regions are a nightmare to implement and of limited use, right?)