JuliaAstro / FITSIO.jl

Flexible Image Transport System (FITS) file support for Julia
http://juliaastro.org/FITSIO.jl/
MIT License
55 stars 29 forks source link

Issue deprecation warning for read(::TableHDU, ::String) with no keyword #106

Closed giordano closed 5 years ago

giordano commented 5 years ago

Use a try-catch block to issue the warnings. Ref. #98.

This is done only for read because it's the user-visible function. I don't see how we can issue the warning only once if it's also inside fits_get_colnum.

I'd also like to add a couple of tests to make sure that the warning is emitted in the correct case, but I can't make @test_warn and @test_nowarn work. If anyone has a clue about how to do this, please share!

giordano commented 5 years ago

I'd also like to add a couple of tests to make sure that the warning is emitted in the correct case, but I can't make @test_warn and @test_nowarn work

It's not only me: https://discourse.julialang.org/t/test-warn-doesnt-work-with-warn-in-0-7/9001 I'm using @test_logs but only in Julia >= 0.7, it doesn't seem to be available in Compat.jl

kbarbary commented 5 years ago

Expertly done! Nice job.

giordano commented 5 years ago

Indeed I'm getting some experience with deprecation warnings :sweat_smile: