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

Fix v0.4 deprecation warnings #23

Closed kbarbary closed 9 years ago

kbarbary commented 9 years ago

This depends on #22. I'll rebase this once we merge that PR. The first two commits are in #22; only the last commit here, 2dc0f5f, is new. Just look at that.

kbarbary commented 9 years ago

There seem to be no comments on this or #22, so I'm going to go ahead and just merge both here.

nirinA commented 9 years ago

sorry for the late comment. there are also depreciation warning in hdutype.jl with parseint and parsefloat?

kbarbary commented 9 years ago

I didn't see warnings on Julia master built last week, but maybe I missed them. Will have another look.

nirinA commented 9 years ago

with:

julia> versioninfo()
Julia Version 0.4.0-dev+3889
Commit 271bc23* (2015-03-18 20:37 UTC)
Platform Info:
  System: Linux (x86_64-slackware-linux)
  CPU: Intel(R) Celeron(R) CPU G1610 @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

i get:

julia> readheader(sed[1])
WARNING: parseint(s) is deprecated, use parse(Int,s) instead.
 in depwarn at ./deprecated.jl:40
 in parseint at deprecated.jl:29
 in parse_header_val at /home/nirina/.julia/v0.4/FITSIO/src/hdutypes.jl:153
 in readheader at /home/nirina/.julia/v0.4/FITSIO/src/hdutypes.jl:203
WARNING: parsefloat(s::AbstractString) is deprecated, use parse(Float64,s) instead.
 in depwarn at ./deprecated.jl:40
 in parsefloat at deprecated.jl:29
 in parse_header_val at /home/nirina/.julia/v0.4/FITSIO/src/hdutypes.jl:156
 in readheader at /home/nirina/.julia/v0.4/FITSIO/src/hdutypes.jl:203
kbarbary commented 9 years ago

Ah, I must have missed it. The new syntax was just added to Compat 4 days ago: https://github.com/JuliaLang/Compat.jl/commit/cafb9f0befc34654709506f5cf00cc6fa8b77328

We should just be able to change these to @Compat parse(T, s) and require Compat>=v"0.3.4"

I can do it or if you want to do a quick PR, that would be great.

nirinA commented 9 years ago

i may not have the time to work on it, and the other issue on WCSLIB i just submitted, until next week, so please do!

kbarbary commented 9 years ago

Fixed in aad77c1.