hipspy / hips

Python library to handle HiPS
https://hips.readthedocs.io
13 stars 16 forks source link

Improve HiPS tile I/O #46

Closed cdeil closed 7 years ago

cdeil commented 7 years ago

I would like to propose this solution to address #42 : suppress the warnings from invalid FITS tiles.

Since this is a "known issue" (or "known feature" if you like) for the FITS tiles from CDS, and every user will get one of these warnings per tile they fetch or read on the console, and there's nothing they can / should do about it except to ignore it, I think it is appropriate to suppress these warnings.

I'm not an expert on Python warnings, but I think / hope that this will have little other effect than suppressing the warnings we want to suppress, and to keep other warnings / errors intact.

@tboch - Assigning to you for review.

@adl1995 - I've also cleaned up the I/O functions a bit to:

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.6%) to 86.145% when pulling 5651248d2238f893216e98318f511dc8acb88b4b on cdeil:fits-truncated into 7fccd4c50de7776d30450158c2314263f56a8fb7 on hipspy:master.

cdeil commented 7 years ago

@tboch - Can you comment on this PR (or merge it)?

@adl1995 wants to add support / tests for PNG tiles this week, and it's easiest if this PR (or parts of it) go in first.

cdeil commented 7 years ago

@adl1995 - Now that this PR is in, you could do #38 (i.e. fully support JPEG read / write, making raw_data a HipsTile data member of type BytesIO) or implement code and tests for PNG tiles.

Note that the current tile I/O tests combine fetch / read / write. Now that we have @requires_hips_extra I would suggest to use hips-extra for read / write and all tile tests, and to only have one small test for the fetching using @remote_data.