astropy / pyregion

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

Cleanup in writer #109

Closed keflavich closed 7 years ago

keflavich commented 7 years ago

I think this is a 2-to-3 failure? I was getting issues like:

TypeError: unsupported operand type(s) for >>:
'builtin_function_or_method' and '_io.TextIOWrapper'

so I changed the print >> outf lines to outf.write

cdeil commented 7 years ago

This code can never have worked on Python 3, right? The fix is good. Do you have time to work out / add a regression test to make sure those lines have coverage?

keflavich commented 7 years ago

I think 2to3.py made it work in py3 before, but something (I have no idea what...) changed in the last ~year.

I don't have time to make such a test; I'd refactor all my code to use https://github.com/astropy/regions but I don't have the time so this patch was my best solution. Also, I don't think we have FITS mask generation in regions yet.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 63.13% when pulling 48bce06f6012f12712a1efc68104caa442771e11 on keflavich:py3_fixed_writer into 727b06c7288474c328d1741095f810bf2cab0fd4 on astropy:master.

keflavich commented 7 years ago

The failure is at least partly:

UnsatisfiableError: The following specifications were found to be in conflict:
  - numpy 1.12* -> python 2.7*
  - python 3.4*
Use "conda info <package>" to see the dependencies for each package.

which I think means we need to update astropy-helpers.

keflavich commented 7 years ago

And there are doc warnings: /home/travis/build/astropy/pyregion/docs/getting_started.rst:152: WARNING: py:obj reference target not found: matplotlib.artist.Artist

bsipocz commented 7 years ago

@keflavich - Could you rebase?

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 63.13% when pulling f755889748948400f17602cf50340d4bb8ed9571 on keflavich:py3_fixed_writer into 9586efd60bcb8fd6a24abbac4fa63dfa0e946f81 on astropy:master.

cdeil commented 7 years ago

@keflavich - Thank you!