Skip to content

Commit

Permalink
Require Julia v1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
junyuan-chen committed Apr 10, 2024
1 parent 4bb22f5 commit bf61587
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
os: ubuntu-latest
arch: x64
- package: DiffinDiffsBase
version: '1.6'
version: '1.9'
os: ubuntu-latest
arch: x64
- package: InteractionWeightedDIDs
version: '1.6'
version: '1.9'
os: ubuntu-latest
arch: x64
steps:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DiffinDiffsBase = "0.4"
Documenter = "0.27"
InteractionWeightedDIDs = "0.3"
Reexport = "0.2, 1"
julia = "1.6"
julia = "1.9"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Expand Down
1 change: 0 additions & 1 deletion lib/DiffinDiffsBase/src/DiffinDiffsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export RotatingTimeValue,

TermSet,
termset,
eachterm,
TreatmentTerm,
treat,

Expand Down
8 changes: 0 additions & 8 deletions lib/DiffinDiffsBase/src/terms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ Base.emptymutable(::TermSet, ::Type{<:AbstractTerm}) = termset()

const Terms{N} = NTuple{N, AbstractTerm} where N

"""
eachterm(t)
Return an iterable collection of terms in `t`.
"""
eachterm(@nospecialize(t::AbstractTerm)) = (t,)
eachterm(@nospecialize(t::Terms)) = t

==(@nospecialize(a::Terms), @nospecialize(b::Terms)) =
length(a)==length(b) && all(t->t in b, a)
==(@nospecialize(a::InteractionTerm), @nospecialize(b::InteractionTerm)) =
Expand Down
2 changes: 1 addition & 1 deletion lib/InteractionWeightedDIDs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ StatsFuns = "0.9, 1"
StatsModels = "0.6, 0.7"
Tables = "1"
Vcov = "0.8"
julia = "1.6"
julia = "1.9"

[extras]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
1 change: 0 additions & 1 deletion lib/InteractionWeightedDIDs/src/InteractionWeightedDIDs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ using DataAPI: refarray
using FixedEffectModels: FixedEffectTerm, fe, fesymbol, _multiply,
basis!, invsym!, isnested, nunique
using FixedEffects
using FixedEffects: MiniProgressBar
using LinearAlgebra: Symmetric, diag, mul!
using Reexport
using StatsBase: AbstractWeights, CovarianceEstimator, UnitWeights, PValue, TestStat, NoQuote
Expand Down
18 changes: 2 additions & 16 deletions lib/InteractionWeightedDIDs/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,14 @@ end

# A work around for the type restrictions in FixedEffects.jl
function _solve_residuals!(xs::Base.ValueIterator, feM::AbstractFixedEffectSolver;

Check warning on line 44 in lib/InteractionWeightedDIDs/src/utils.jl

View check run for this annotation

Codecov / codecov/patch

lib/InteractionWeightedDIDs/src/utils.jl#L44

Added line #L44 was not covered by tests
progress_bar = true, kwargs...)
progress_bar=false, kwargs...)
iterations = Int[]
convergeds = Bool[]
bar = MiniProgressBar(header = "Demean Variables:", color = Base.info_color(), percentage = false, max = length(xs))
for (j, x) in enumerate(xs)
v0 = time()
for x in xs
_, iteration, converged = solve_residuals!(x, feM; kwargs...)
v1 = time()
# remove progress_bar if estimated time lower than 2sec
if progress_bar && (j == 1) && ((v1 - v0) * length(xs) <= 2)
progress_bar = false
end
if progress_bar
bar.current = j
showprogress(stdout, bar)
end
push!(iterations, iteration)
push!(convergeds, converged)
end
if progress_bar
end_progress(stdout, bar)
end
return xs, iterations, convergeds

Check warning on line 53 in lib/InteractionWeightedDIDs/src/utils.jl

View check run for this annotation

Codecov / codecov/patch

lib/InteractionWeightedDIDs/src/utils.jl#L46-L53

Added lines #L46 - L53 were not covered by tests
end

Expand Down

0 comments on commit bf61587

Please sign in to comment.