Skip to content

Commit 763554d

Browse files
Merge pull request #269 from JuliaArrays/breaking_release
Make the next release a breaking change and update documentation
2 parents 21a56f3 + d5b5c02 commit 763554d

File tree

6 files changed

+86
-32
lines changed

6 files changed

+86
-32
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ArrayInterface"
22
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
3-
version = "5.1.0"
3+
version = "6.0.0"
44

55
[deps]
66
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ development.
4444

4545
## Breaking Release Notes
4646

47+
6.0: ArrayInterface.jl completely removed all usage of Requires.jl and conditional dependencies
48+
due to compile time impact. All of the Requires.jl support changed to subpackages within the
49+
repository which are registered in the General registry. These subpackages are required by
50+
any packages which seek to use the additional functionality.
51+
4752
2.0: Changed the default of `ismutable(array::AbstractArray) = true`. We previously defaulted to
4853
`Base.@pure ismutable(array::AbstractArray) = typeof(array).mutable`, but there are a lot of cases
4954
where this tends to not work out in a way one would expect. For example, if you put a normal array

docs/make.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
using ArrayInterface
2+
3+
function dev_subpkg(subpkg)
4+
subpkg_path = joinpath(dirname(@__DIR__), "lib", subpkg)
5+
Pkg.develop(PackageSpec(path=subpkg_path))
6+
end
7+
dev_subpkg("ArrayInterfaceCore")
8+
9+
using ArrayInterfaceCore
210
using Documenter
311

412
makedocs(;
5-
modules=[ArrayInterface],
13+
modules=[ArrayInterface, ArrayInterfaceCore],
614
sitename="ArrayInterface",
715
pages=[
816
"Home" => "index.md",
917
"API" => "api.md"
10-
],
18+
]
1119
)
1220

1321
deploydocs(;
14-
repo="github.com/JuliaArrays/ArrayInterface.jl",
22+
repo="github.com/JuliaArrays/ArrayInterface.jl"
1523
)
1624

docs/src/api.md

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,58 @@
11
# API
22

3-
## Traits
3+
## ArrayInterfaceCore.jl
4+
5+
### Traits
6+
7+
```@docs
8+
ArrayInterfaceCore.can_avx
9+
ArrayInterfaceCore.can_change_size
10+
ArrayInterfaceCore.can_setindex
11+
ArrayInterfaceCore.fast_matrix_colors
12+
ArrayInterfaceCore.fast_scalar_indexing
13+
ArrayInterfaceCore.ismutable
14+
ArrayInterfaceCore.isstructured
15+
ArrayInterfaceCore.has_sparsestruct
16+
```
17+
18+
### Functions
19+
20+
```@docs
21+
ArrayInterfaceCore.allowed_getindex
22+
ArrayInterfaceCore.allowed_setindex!
23+
ArrayInterfaceCore.aos_to_soa
24+
ArrayInterfaceCore.buffer
25+
ArrayInterfaceCore.findstructralnz
26+
ArrayInterfaceCore.lu_instance
27+
ArrayInterfaceCore.matrix_colors
28+
ArrayInterfaceCore.issingular
29+
ArrayInterfaceCoreCore.parent_type
30+
ArrayInterfaceCore.restructure
31+
ArrayInterfaceCore.safevec
32+
ArrayInterfaceCore.zeromatrix
33+
```
34+
35+
### Types
36+
37+
```@docs
38+
ArrayInterfaceCore.ArrayIndex
39+
```
40+
41+
## ArrayInterface.jl
42+
43+
### Traits
444

545
```@docs
6-
ArrayInterface.can_avx
7-
ArrayInterface.can_change_size
8-
ArrayInterface.can_setindex
946
ArrayInterface.contiguous_axis
1047
ArrayInterface.contiguous_axis_indicator
1148
ArrayInterface.contiguous_batch_size
1249
ArrayInterface.defines_strides
1350
ArrayInterface.device
1451
ArrayInterface.dimnames
15-
ArrayInterface.fast_matrix_colors
16-
ArrayInterface.fast_scalar_indexing
1752
ArrayInterface.has_dimnames
1853
ArrayInterface.has_parent
19-
ArrayInterface.has_sparsestruct
2054
ArrayInterface.is_column_major
2155
ArrayInterface.is_lazy_conjugate
22-
ArrayInterface.ismutable
23-
ArrayInterface.issingular
24-
ArrayInterface.isstructured
2556
ArrayInterface.is_splat_index
2657
ArrayInterface.known_dimnames
2758
ArrayInterface.known_first
@@ -35,31 +66,21 @@ ArrayInterface.known_strides
3566
ArrayInterface.ndims_index
3667
```
3768

38-
## Functions
69+
### Functions
3970

4071
```@docs
41-
ArrayInterface.allowed_getindex
42-
ArrayInterface.allowed_setindex!
43-
ArrayInterface.aos_to_soa
4472
ArrayInterface.axes
4573
ArrayInterface.axes_types
4674
ArrayInterface.broadcast_axis
47-
ArrayInterface.buffer
4875
ArrayInterface.deleteat
4976
ArrayInterface.dense_dims
50-
ArrayInterface.findstructralnz
5177
ArrayInterface.from_parent_dims
5278
ArrayInterface.getindex
5379
ArrayInterface.indices
5480
ArrayInterface.insert
5581
ArrayInterface.lazy_axes
56-
ArrayInterface.lu_instance
57-
ArrayInterface.matrix_colors
5882
ArrayInterface.offset1
5983
ArrayInterface.offsets
60-
ArrayInterface.parent_type
61-
ArrayInterface.restructure
62-
ArrayInterface.safevec
6384
ArrayInterface.setindex!
6485
ArrayInterface.size
6586
ArrayInterface.strides
@@ -70,13 +91,11 @@ ArrayInterface.to_index
7091
ArrayInterface.to_indices
7192
ArrayInterface.to_parent_dims
7293
ArrayInterface.unsafe_reconstruct
73-
ArrayInterface.zeromatrix
7494
```
7595

76-
## Types
96+
### Types
7797

7898
```@docs
79-
ArrayInterface.ArrayIndex
8099
ArrayInterface.BroadcastAxis
81100
ArrayInterface.LazyAxis
82101
ArrayInterface.OptionallyStaticStepRange

docs/src/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@ CurrentModule = ArrayInterface
66

77
Designs for new Base array interface primitives, used widely through scientific machine learning (SciML) and other organizations
88

9+
## ArrayInterfaceCore
10+
11+
ArrayInterfaceCore is a smaller set of the ArrayInterface setup which defines the subset which has no compile time impact.
12+
This for example includes simple functions like `ArrayInterfaceCore.zeromatrix` which have simple few dispatch definitions
13+
and no dependency on other libraries such as Static.jl. Notably, Static.jl currently has issues with invalidations
14+
(https://github.com/SciML/Static.jl/issues/52), and thus anything with static outputs are in the domain of ArrayInterface.jl
15+
proprer.
16+
17+
## Subpackages
18+
19+
In order to remove the runtime impact of Requires.jl, ArrayInterface.jl uses a subpackaging system for defining interface support
20+
for potential dependencies. These packages are:
21+
22+
- ArrayInterfaceBandedMatrices.jl
23+
- ArrayInterfaceBlockBandedMatrices.jl
24+
- ArrayInterfaceCUDA.jl
25+
- ArrayInterfaceOffsetArrays.jl
26+
- ArrayInterfaceTracker.jl
27+
28+
In order for ArrayInterface traits to be properly defined on these types, it is required that the downstream package depends on
29+
and imports the correct subpackages.
30+
931
## Inheriting Array Traits
1032

1133
Creating an array type with unique behavior in Julia is often accomplished by creating a lazy wrapper around previously defined array types (e.g. [composition by inheritance](https://en.wikipedia.org/wiki/Composition_over_inheritance)).

src/ArrayInterface.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ module ArrayInterface
22

33
using ArrayInterfaceCore
44
import ArrayInterfaceCore: allowed_getindex, allowed_setindex!, aos_to_soa, buffer,
5-
has_parent, parent_type, fast_matrix_colors, findstructralnz, has_sparsestruct,
6-
issingular, is_lazy_conjugate, isstructured, matrix_colors, restructure, lu_instance,
7-
safevec, unsafe_reconstruct, zeromatrix, ColoringAlgorithm, merge_tuple_type,
5+
parent_type, fast_matrix_colors, findstructralnz, has_sparsestruct,
6+
issingular, isstructured, matrix_colors, restructure, lu_instance,
7+
safevec, zeromatrix, ColoringAlgorithm, merge_tuple_type,
88
fast_scalar_indexing, parameterless_type, _is_reshaped
99

1010
# ArrayIndex subtypes and methods
1111
import ArrayInterfaceCore: ArrayIndex, MatrixIndex, VectorIndex, BidiagonalIndex, TridiagonalIndex
1212
# managing immutables
13-
import ArrayInterfaceCore: ismutable, can_change_size, can_setindex, deleteat, insert
13+
import ArrayInterfaceCore: ismutable, can_change_size, can_setindex
1414
# constants
1515
import ArrayInterfaceCore: MatAdjTrans, VecAdjTrans, UpTri, LoTri
1616
# device pieces

0 commit comments

Comments
 (0)