Skip to content

Commit

Permalink
Relax Julia compat version and solve_residuals! method (#65)
Browse files Browse the repository at this point in the history
* Relax Julia compat version and `solve_residuals!` method

* Try to circumvent the requirement of Metal

* Add a comment

* Add a comment

* Bump version to 2.4.0
  • Loading branch information
junyuan-chen authored May 7, 2024
1 parent 474dea9 commit 5c2e4df
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:
fail-fast: false
matrix:
version:
- '1.9' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand All @@ -40,7 +40,7 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info

8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "FixedEffects"
uuid = "c8885935-8500-56a7-9867-7708b20db0eb"
version = "2.3.1"
version = "2.4.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -11,7 +11,7 @@ GroupedArrays = "6407cd72-fade-4a84-8a1e-56e431fc1533"
[compat]
StatsBase = "0.33, 0.34"
GroupedArrays = "0.3"
julia = "1.9"
julia = "1.6"

[extensions]
CUDAExt = "CUDA"
Expand All @@ -24,10 +24,10 @@ Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
[extras]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["CategoricalArrays", "CUDA", "Metal", "PooledArrays", "Test"]
test = ["CategoricalArrays", "CUDA", "Pkg", "PooledArrays", "Test"]

6 changes: 5 additions & 1 deletion src/AbstractFixedEffectSolver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ function solve_residuals!(r::AbstractVector{<:Real}, feM::AbstractFixedEffectSol
return r, iter, converged
end

function solve_residuals!(xs::AbstractVector{<: AbstractVector}, feM::AbstractFixedEffectSolver; progress_bar = true, kwargs...)
# A fallback method for collections of x
# The container for data columns does not have to be a vector
# This allows the use of iterators and tuples for xs in downstream packages
# See https://github.com/FixedEffects/FixedEffects.jl/pull/65
function solve_residuals!(xs, feM::AbstractFixedEffectSolver; progress_bar = true, kwargs...)
iterations = Int[]
convergeds = Bool[]
bar = MiniProgressBar(header = "Demean Variables:", color = Base.info_color(), percentage = false, max = length(xs))
Expand Down
10 changes: 9 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
tests = ["types.jl", "solve.jl"]
println("Running tests:")

using Test, StatsBase, CUDA, Metal, FixedEffects, PooledArrays, CategoricalArrays
# A work around for tests to run on older versions of Julia
using Pkg
if VERSION >= v"1.8"
Pkg.add("Metal")
using Metal
end

using Test, StatsBase, CUDA, FixedEffects, PooledArrays, CategoricalArrays

for test in tests
try
include(test)
Expand Down

2 comments on commit 5c2e4df

@matthieugomez
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/106351

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.4.0 -m "<description of version>" 5c2e4df4fb0cda41076a3b045b46e2f332debaad
git push origin v2.4.0

Please sign in to comment.