Skip to content

Commit 6ef359a

Browse files
authored
Merge branch 'master' into remove-codegen
2 parents 6eb4269 + d46b630 commit 6ef359a

File tree

11 files changed

+30
-29
lines changed

11 files changed

+30
-29
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ version = "0.11.2"
77
BSplineKit = "093aae92-e908-43d7-9660-e50ee39d5a0a"
88
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
99
FITSIO = "525bcba6-941b-5504-bd06-fd0dc1a4d2eb"
10-
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
1110
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
1211
UnitfulAstro = "6112ee07-acf9-5e0f-b108-d242c714bf9f"
1312

1413
[compat]
1514
BSplineKit = "0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19"
1615
DataDeps = "0.7"
1716
FITSIO = "0.13.0, 0.14, 0.15, 0.16.1, 0.17"
18-
Parameters = "0.12"
1917
Unitful = "0.17.0, 1"
2018
UnitfulAstro = "0.3.0, 0.4, 1"
2119
julia = "1.6"

src/DustExtinction.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module DustExtinction
33
import Unitful as U
44
using UnitfulAstro: UnitfulAstro
55
import DataDeps
6-
import Parameters
76
import FITSIO as FITS
87
import BSplineKit as BSK
98

@@ -40,8 +39,7 @@ The abstract supertype for dust extinction laws. See the extended help
4039
## Interface
4140
4241
Here's how to make a new extinction law, called `MyLaw`
43-
* Create your struct. We strongly recommend using `Parameters.jl` to facilitate
44-
creating keyword argument constructors if your model is parameterized, which
42+
* Create your struct. We strongly recommend using keyword arguments if your model is parameterized, which
4543
allows convenient usage with [`redden`](@ref) and [`deredden`](@ref).
4644
```julia
4745
struct MyLaw <: DustExtinction.ExtinctionLaw end

src/color_laws.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ for different coefficients used in the optical (3030.3 Å to 9090.9 Å).
1818
# See Also
1919
[`CCM89`](@ref)
2020
"""
21-
Parameters.@with_kw struct OD94 <: ExtinctionLaw
21+
Base.@kwdef struct OD94 <: ExtinctionLaw
2222
Rv::Float64 = 3.1
2323
end
2424

@@ -47,7 +47,7 @@ fit value for such galaxies was 4.05±0.80.
4747
# References
4848
[Calzetti et al. (2000)](https://ui.adsabs.harvard.edu/abs/2000ApJ...533..682C)
4949
"""
50-
Parameters.@with_kw struct CAL00 <: ExtinctionLaw
50+
Base.@kwdef struct CAL00 <: ExtinctionLaw
5151
Rv::Float64 = 4.05
5252
end
5353
function (law::CAL00)(wave::T) where T <: Real

src/color_laws/ccm89.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A typical value for the Milky Way is 3.1.
1818
# References
1919
[Clayton,Cardelli and Mathis (1989)](https://ui.adsabs.harvard.edu/abs/1989ApJ...345..245C)
2020
"""
21-
Parameters.@with_kw struct CCM89 <: ExtinctionLaw
21+
Base.@kwdef struct CCM89 <: ExtinctionLaw
2222
Rv::Float64 = 3.1
2323
end
2424

src/color_laws/fitzpatrick.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ A typical value for the Milky Way is 3.1.
7272
# References
7373
[Fitzpatrick (1999)](https://ui.adsabs.harvard.edu/abs/1999PASP..111...63F/)
7474
"""
75-
Parameters.@with_kw struct F99 <: ExtinctionLaw
75+
Base.@kwdef struct F99 <: ExtinctionLaw
7676
Rv::Float64 = 3.1
7777
end
7878

@@ -165,7 +165,7 @@ See also Fitzpatrick & Massa (2007, ApJ, 663, 320)
165165
# References
166166
[Fitzpatrick (2004)](https://ui.adsabs.harvard.edu/abs/2004ASPC..309...33F/)
167167
"""
168-
Parameters.@with_kw struct F04 <: ExtinctionLaw
168+
Base.@kwdef struct F04 <: ExtinctionLaw
169169
Rv::Float64 = 3.1
170170
end
171171

@@ -242,7 +242,7 @@ sample of stars observed spectroscopically in the optical with HST/STIS.
242242
# References
243243
[Fitzpatrick (2019)](https://ui.adsabs.harvard.edu/abs/2019ApJ...886..108F/)
244244
"""
245-
Parameters.@with_kw struct F19 <: ExtinctionLaw
245+
Base.@kwdef struct F19 <: ExtinctionLaw
246246
Rv::Float64 = 3.1
247247
end
248248

src/color_laws/gcc09.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This model was not derived for the optical or NIR.
99
# References
1010
[Gordon, Cartledge, & Clayton (2009)](https://ui.adsabs.harvard.edu/abs/2009ApJ...705.1320G/)
1111
"""
12-
Parameters.@with_kw struct GCC09 <: ExtinctionLaw
12+
Base.@kwdef struct GCC09 <: ExtinctionLaw
1313
Rv::Float64 = 3.1
1414
end
1515

src/color_laws/m14.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ equivalent to photometric R(V).
6565
# References
6666
[Maiz Apellaniz et al. (2014)](https://ui.adsabs.harvard.edu/abs/2014A%26A...564A..63M/)
6767
"""
68-
Parameters.@with_kw struct M14 <: ExtinctionLaw
68+
Base.@kwdef struct M14 <: ExtinctionLaw
6969
Rv::Float64 = 3.1
7070
end
7171

src/color_laws/vcg04.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This model was not derived for the optical or NIR.
99
# References
1010
[Valencic, Clayton, & Gordon (2004)](https://ui.adsabs.harvard.edu/abs/2004ApJ...616..912V/)
1111
"""
12-
Parameters.@with_kw struct VCG04 <: ExtinctionLaw
12+
Base.@kwdef struct VCG04 <: ExtinctionLaw
1313
Rv::Float64 = 3.1
1414
end
1515

src/fittable_laws.jl

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,20 @@ changing the expected behavior of reddening via the parameter ``A_V``.
4646
## References
4747
[Fitzpatrick & Massa (1990)](https://ui.adsabs.harvard.edu/abs/1990ApJS...72..163F)
4848
"""
49-
Parameters.@with_kw struct FM90{T<:Number} <: ExtinctionLaw @deftype T
50-
c1 = 0.10
51-
c2 = 0.70
52-
c3 = 3.23
53-
c4 = 0.41
54-
x0 = 4.60
55-
gamma = 0.99
56-
@assert x0 0 "`x0` must be ≥ 0, got $x0"
57-
@assert gamma 0 "`gamma` must be ≥ 0, got $gamma"
49+
Base.@kwdef struct FM90{T<:Number} <: ExtinctionLaw
50+
c1::T = 0.10
51+
c2::T = 0.70
52+
c3::T = 3.23
53+
c4::T = 0.41
54+
x0::T = 4.60
55+
gamma::T = 0.99
56+
function FM90(c1, c2, c3, c4, x0, gamma)
57+
x0 < 0 && error("`x0` must be ≥ 0, got ", x0)
58+
gamma < 0 && error("`gamma` must be ≥ 0, got ", gamma)
59+
params = promote(c1, c2, c3, c4, x0, gamma)
60+
return new{eltype(params)}(params...)
61+
end
5862
end
59-
60-
FM90(c1, c2, c3, c4, x0, gamma) = FM90(promote(c1, c2, c3, c4, x0, gamma)...)
6163
FM90(coeffs, x0=4.60, gamma=0.99) = FM90(coeffs..., x0, gamma)
6264

6365
bounds(::Type{<:FM90}) = (912, 3200)

src/mixture_laws.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ provide smooth interpolation as noted in Gordon et al. (2016, ApJ, 826, 104)
6767
# Reference
6868
[Gordon et al. (2003)](https://ui.adsabs.harvard.edu/abs/2003ApJ...594..279G/)
6969
"""
70-
Parameters.@with_kw struct G03_SMCBar <: ExtinctionLaw
70+
Base.@kwdef struct G03_SMCBar <: DustExtinction.ExtinctionLaw
7171
Rv::Float64 = 2.74
7272
obsdata_x = g03_obsdata_x
7373
obsdata_axav = g03_obsdata_axav
@@ -82,7 +82,7 @@ Gordon et al. (2003) LMCAve Average Extinction Curve.
8282
# Reference
8383
[Gordon et al. (2003)](https://ui.adsabs.harvard.edu/abs/2003ApJ...594..279G/)
8484
"""
85-
Parameters.@with_kw struct G03_LMCAve <: ExtinctionLaw
85+
Base.@kwdef struct G03_LMCAve <: DustExtinction.ExtinctionLaw
8686
Rv::Float64 = 3.41
8787
obsdata_x = g03lmc_obsdata_x
8888
obsdata_axav = g03lmc_obsdata_axav
@@ -170,9 +170,9 @@ A typical value for the Milky Way is 3.1.
170170
# References
171171
[Gordon et al. (2016)](https://ui.adsabs.harvard.edu/abs/2016ApJ...826..104G/)
172172
"""
173-
Parameters.@with_kw struct G16{T<:Number} <: ExtinctionLaw @deftype T
173+
Base.@kwdef struct G16{T<:Number} <: ExtinctionLaw
174174
Rv::Float64 = 3.1
175-
f_A = 1.0
175+
f_A::T = 1.0
176176
end
177177

178178
#G16(Rv, f_A) = G16(promote(Rv, f_A)...)

0 commit comments

Comments
 (0)