Skip to content

Commit ac2e2c9

Browse files
committed
Move each @require block into a small package
1 parent 78c9b35 commit ac2e2c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+694
-524
lines changed

.github/workflows/Documentation.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Documentation
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags: '*'
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: julia-actions/setup-julia@latest
15+
with:
16+
version: '1'
17+
- name: Install dependencies
18+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
19+
- name: Build and deploy
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
22+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
23+
run: julia --project=docs/ docs/make.jl

.github/workflows/ci.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,20 @@ jobs:
1111
test:
1212
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
1313
runs-on: ${{ matrix.os }}
14+
continue-on-error: ${{ matrix.group == 'Downstream' }}
1415
strategy:
1516
fail-fast: false
1617
matrix:
18+
group:
19+
- ArrayInterfaceCore
20+
- ArrayInterfaceBandedMatrices
21+
- ArrayInterfaceBlockBandedMatrices
22+
- ArrayInterfaceCuArrays
23+
- ArrayInterfaceCUDA
24+
- ArrayInterfaceLabelledArrays
25+
- ArrayInterfaceOffsetArrays
26+
- ArrayInterfaceStaticArrays
27+
- ArrayInterfaceTracker
1728
version:
1829
- '1.6'
1930
- '1' # automatically expands to the latest stable 1.x release of Julia.
@@ -27,7 +38,6 @@ jobs:
2738
- uses: julia-actions/setup-julia@v1
2839
with:
2940
version: ${{ matrix.version }}
30-
arch: ${{ matrix.arch }}
3141
- uses: actions/cache@v1
3242
env:
3343
cache-name: cache-artifacts
@@ -38,29 +48,12 @@ jobs:
3848
${{ runner.os }}-test-${{ env.cache-name }}-
3949
${{ runner.os }}-test-
4050
${{ runner.os }}-
41-
- run: julia --project -e 'using Pkg; Pkg.develop([PackageSpec(path="ArrayInterfaceCore")])'
4251
- uses: julia-actions/julia-buildpkg@v1
4352
- uses: julia-actions/julia-runtest@v1
53+
env:
54+
GROUP: ${{ matrix.group }}
4455
- uses: julia-actions/julia-processcoverage@v1
45-
with:
46-
directiories: src,ArrayInterfaceCore/src
4756
- uses: codecov/codecov-action@v1
4857
with:
4958
file: lcov.info
50-
docs:
51-
name: Documentation
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v1
55-
- uses: julia-actions/setup-julia@latest
56-
with:
57-
version: '1.6'
58-
- run: julia --project -e 'using Pkg; Pkg.develop([PackageSpec(path=joinpath(pwd(), "ArrayInterfaceCore"))])'
59-
- run: julia --project=docs -e '
60-
using Pkg;
61-
Pkg.develop(PackageSpec(; path=pwd()));
62-
Pkg.instantiate();'
63-
- run: julia --project=docs docs/make.jl
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
59+

Project.toml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@ version = "5.0.8"
44

55
[deps]
66
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
7-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
8-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
9-
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
7+
ArrayInterfaceBandedMatrices = "2e50d22c-5be1-4042-81b1-c572ed69783d"
8+
ArrayInterfaceBlockBandedMatrices = "5331f1e9-51c7-46b0-a9b0-df4434785e0a"
9+
ArrayInterfaceCuArrays = "3437ff42-decc-4d23-83d9-97c36d08d837"
10+
ArrayInterfaceCUDA = "3e6d3b71-936e-4b08-8b74-7853fb4a8432"
11+
ArrayInterfaceLabelledArrays = "e8e6c4e0-6dc8-4c5e-8daa-74cfef068049"
12+
ArrayInterfaceOffsetArrays = "015c0d05-e682-4f19-8f0a-679ce4c54826"
13+
ArrayInterfaceStaticArrays = "b0d46f97-bff5-4637-a19a-dd75974142cd"
14+
ArrayInterfaceTracker = "a2b0951a-f94f-4742-8780-617792921f9b"
1015
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
1116

1217
[compat]
1318
ArrayInterfaceCore = "0.1"
14-
Requires = "0.5, 1.0"
19+
ArrayInterfaceBandedMatrices = "0.1"
20+
ArrayInterfaceBlockBandedMatrices = "0.1"
21+
ArrayInterfaceCuArrays = "0.1"
22+
ArrayInterfaceCUDA = "0.1"
23+
ArrayInterfaceLabelledArrays = "0.1"
24+
ArrayInterfaceOffsetArrays = "0.1"
25+
ArrayInterfaceStaticArrays = "0.1"
26+
ArrayInterfaceTracker = "0.1"
1527
Static = "0.6"
16-
julia = "1.2"
28+
julia = "1.6"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name = "ArrayInterfaceBandedMatrices"
2+
uuid = "2e50d22c-5be1-4042-81b1-c572ed69783d"
3+
version = "0.1.0"
4+
5+
[deps]
6+
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
7+
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
8+
9+
[compat]
10+
ArrayInterfaceCore = "0.1"
11+
BandedMatrices = "0.17"
12+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module ArrayInterfaceBandedMatrices
2+
3+
using ArrayInterfaceCore
4+
using BandedMatrices
5+
6+
struct BandedMatrixIndex <: ArrayInterfaceCore.MatrixIndex
7+
count::Int
8+
rowsize::Int
9+
colsize::Int
10+
bandinds::Array{Int,1}
11+
bandsizes::Array{Int,1}
12+
isrow::Bool
13+
end
14+
15+
Base.firstindex(i::BandedMatrixIndex) = 1
16+
Base.lastindex(i::BandedMatrixIndex) = i.count
17+
Base.length(i::BandedMatrixIndex) = lastindex(i)
18+
Base.@propagate_inbounds function Base.getindex(ind::BandedMatrixIndex, i::Int)
19+
@boundscheck 1 <= i <= ind.count || throw(BoundsError(ind, i))
20+
_i = i
21+
p = 1
22+
while _i - ind.bandsizes[p] > 0
23+
_i -= ind.bandsizes[p]
24+
p += 1
25+
end
26+
bandind = ind.bandinds[p]
27+
startfromone = !xor(ind.isrow, (bandind > 0))
28+
if startfromone
29+
return _i
30+
else
31+
return _i + abs(bandind)
32+
end
33+
end
34+
35+
function _bandsize(bandind, rowsize, colsize)
36+
-(rowsize - 1) <= bandind <= colsize - 1 || throw(ErrorException("Invalid Bandind"))
37+
if (bandind * (colsize - rowsize) > 0) & (abs(bandind) <= abs(colsize - rowsize))
38+
return min(rowsize, colsize)
39+
elseif bandind * (colsize - rowsize) <= 0
40+
return min(rowsize, colsize) - abs(bandind)
41+
else
42+
return min(rowsize, colsize) - abs(bandind) + abs(colsize - rowsize)
43+
end
44+
end
45+
46+
function BandedMatrixIndex(rowsize, colsize, lowerbandwidth, upperbandwidth, isrow)
47+
upperbandwidth > -lowerbandwidth || throw(ErrorException("Invalid Bandwidths"))
48+
bandinds = upperbandwidth:-1:-lowerbandwidth
49+
bandsizes = [_bandsize(band, rowsize, colsize) for band in bandinds]
50+
BandedMatrixIndex(sum(bandsizes), rowsize, colsize, bandinds, bandsizes, isrow)
51+
end
52+
53+
function ArrayInterfaceCore.findstructralnz(x::BandedMatrices.BandedMatrix)
54+
l, u = BandedMatrices.bandwidths(x)
55+
rowsize, colsize = Base.size(x)
56+
rowind = BandedMatrixIndex(rowsize, colsize, l, u, true)
57+
colind = BandedMatrixIndex(rowsize, colsize, l, u, false)
58+
return (rowind, colind)
59+
end
60+
61+
ArrayInterfaceCore.has_sparsestruct(::Type{<:BandedMatrices.BandedMatrix}) = true
62+
ArrayInterfaceCore.isstructured(::Type{<:BandedMatrices.BandedMatrix}) = true
63+
ArrayInterfaceCore.fast_matrix_colors(::Type{<:BandedMatrices.BandedMatrix}) = true
64+
65+
function ArrayInterfaceCore.matrix_colors(A::BandedMatrices.BandedMatrix)
66+
l, u = BandedMatrices.bandwidths(A)
67+
width = u + l + 1
68+
return _cycle(1:width, Base.size(A, 2))
69+
end
70+
71+
end # module
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name = "ArrayInterfaceBlockBandedMatrices"
2+
uuid = "5331f1e9-51c7-46b0-a9b0-df4434785e0a"
3+
authors = ["Zachary P. Christensen <[email protected]>"]
4+
version = "0.1.0"
5+
6+
[deps]
7+
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
8+
BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0"
9+
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
10+
11+
[compat]
12+
ArrayInterfaceCore = "0.1"
13+
BlockBandedMatrices = "0.11"
14+
BlockArrays = "0.16"
15+

0 commit comments

Comments
 (0)