Skip to content

Conversation

@mtfishman
Copy link
Member

@mtfishman mtfishman commented Jun 11, 2024

The primary changes are:

  1. Axes of BlockSparseArrays by default are now BlockedOneTo and GradedOneTo, i.e. hardcoded to start at 1 by the type system.
  2. GradedOneTo now properly has compile time element type LabelledInteger, which is allowed as of BlockArrays.jl v1 since BlockedOneTo/BlockedUnitRange can now have element types that are any subtype of Integer, and not just Int as before v1.

Currently, GradedOneTo and GradedUnitRange are just type aliases for BlockArrays.BlockedOneTo and BlockArrays.BlockedUnitRange with labelled integer elements and labelled blocks. In the future we might consider defining them as separate types, as well as defining an AbstractGradedUnitRange supertype for them. This PR defines AbstractGradedUnitRange, but it is just a type alias for BlockArrays.AbstractBlockedUnitRange with labelled integer element type. Repurposing the existing types in BlockArrays seems to work well so far and works even better with BlockArrays v1.

To-do:

  • Some operations like dimension fusion are dropping block labels, investigate and fix.
  • Some operations like adding block sparse arrays with graded axes to dense arrays are outputting BlockArrays.BlockedArray objects which drop the block labels, consider if this is the behavior we want. EDIT: I'll keep this behavior for now.
  • Fix conversion issue causing test failure in Julia 1.6.

@mtfishman mtfishman changed the title [GradedAxes] [BlockSparseArrays] Upgrade to BlockArrays.jl v1 [WIP] [GradedAxes] [BlockSparseArrays] Upgrade to BlockArrays.jl v1 Jun 12, 2024
@mtfishman mtfishman marked this pull request as draft June 12, 2024 00:33
@mtfishman mtfishman changed the title [WIP] [GradedAxes] [BlockSparseArrays] Upgrade to BlockArrays.jl v1 [GradedAxes] [BlockSparseArrays] Upgrade to BlockArrays.jl v1 Jun 13, 2024
@mtfishman mtfishman marked this pull request as ready for review June 13, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants