astropy / pyregion

ds9 region parser for python
https://pyregion.readthedocs.io
MIT License
39 stars 40 forks source link

fix parsing error for a space before angular distance #78

Closed leejjoon closed 8 years ago

leejjoon commented 8 years ago

This is to fix a parser raising an error when there is a space before the AngularDistance (e.g., 1"). This should solve #73.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 50.662% when pulling 1877ab08d2a7dbfe89a00167c7356ca0a4a96da1 on leejjoon:fix_arcsec_space into ceeb1a926f1937c714f54823c6121b1d47b7cb3c on astropy:master.

cdeil commented 8 years ago

@astrofrog or @leejjoon (whoever has access) - Could you please go to https://coveralls.io/github/astropy/pyregion/settings and disable "leave comments on pull requests"? (it's annoying and not very helpful for coveralls to leave comments on pull requests all the time)

cdeil commented 8 years ago

I can confirm that this fixes the test case given in #73 :

>>> import pyregion
>>> reg = pyregion.parse('J2000; circle 188.5557102 12.0314056 1" # color=red')[0]
>>> reg.__dict__
{'params': [Number(188.5557102), Number(12.0314056), Ang(1")], 'coord_format': 'j2000', 'comment': 'color=red', 'continued': None, 'coord_list': [188.5557102, 12.0314056, 0.0002777777777777778], 'name': 'circle', 'exclude': False, 'attr': ([], {'color': 'red'})}

@leejjoon - Do you have time to add a regression test for this before we merge? (If no, I can do it later today.)

leejjoon commented 8 years ago

I will add a test soon.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.05%) to 50.608% when pulling e4ba9c842531a2551f686c0d8ffb62a20c22ca04 on leejjoon:fix_arcsec_space into ceeb1a926f1937c714f54823c6121b1d47b7cb3c on astropy:master.

cdeil commented 8 years ago

I've added a commit to fix the test for Python 3 (7a06ec3) and merged this PR locally.