Skip to content

Commit

Permalink
Use property destructuring with Compat
Browse files Browse the repository at this point in the history
We have a transitive dependency on Compat anyway and this simplifies
exactly one line of code so might as well.
  • Loading branch information
ararslan committed Jul 9, 2022
1 parent fa54e40 commit fce52ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ uuid = "8a913413-2070-5976-9d4c-2b364fdc2f7f"
version = "0.2.2"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Expand All @@ -11,6 +12,7 @@ StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"

[compat]
CategoricalArrays = "0.9"
Compat = "3.43, 4"
DataFrames = "1"
Distributions = "0.20, 0.21, 0.22, 0.23, 0.24, 0.25"
Optim = "1"
Expand Down
3 changes: 2 additions & 1 deletion src/Survival.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module Survival

using Compat
using Distributions
using LinearAlgebra
using Optim
using StatsBase
using StatsModels
using Optim

export
EventTime,
Expand Down
3 changes: 1 addition & 2 deletions src/cox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ end

function _cox_fgh!(β, grad, hes, c::CoxAux{T}) where T
update_cox!(c, β, (hes !== nothing) | (grad !== nothing))
X, ξ, Xβ, θ, Xθ, ξθ, λ, fs, ls =
c.X, c.ξ, c.Xβ, c.θ, c.Xθ, c.ξθ, c.λ, c.fs, c.ls
@compat (; X, ξ, Xβ, θ, Xθ, ξθ, λ, fs, ls) = c
y = zero(T) / one(T)

if hes !== nothing
Expand Down

0 comments on commit fce52ed

Please sign in to comment.