Skip to content

Commit

Permalink
Merge pull request #625 from finch-tensor/wma/rename-levels
Browse files Browse the repository at this point in the history
update level names
  • Loading branch information
willow-ahrens authored Oct 23, 2024
2 parents 7833e06 + 550241c commit 4795478
Show file tree
Hide file tree
Showing 166 changed files with 1,462 additions and 1,664 deletions.
16 changes: 8 additions & 8 deletions docs/src/guides/tensor_formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ some general descriptions.
|----------------------|----------|-----------------------|:------------------:|:------------:|:------------------------:|:------------------:|:--------------:|:------:|
| Dense | Core | Dense |||||||
| SparseTree | Core | Sparse |||||| ⚙️ |
| SparseRLETree | Core | Sparse Runs |||||| ⚙️ |
| SparseRunListTree | Core | Sparse Runs |||||| ⚙️ |
| Element | Core | Leaf |||||||
| Pattern | Core | Leaf |||||||
| SparseList | Advanced | Sparse |||||||
| SparseRLE | Advanced | Sparse Runs |||||||
| SparseVBL | Advanced | Sparse Blocks |||||||
| SparseRunList | Advanced | Sparse Runs |||||||
| SparseBlockList | Advanced | Sparse Blocks |||||||
| SparsePoint | Advanced | Single Sparse |||||||
| SparseInterval | Advanced | Single Sparse Run |||||||
| SparseBand | Advanced | Single Sparse Block |||||| ⚙️ |
| DenseRLE | Advanced | Dense Runs |||||| ⚙️ |
| RunList | Advanced | Dense Runs |||||| ⚙️ |
| SparseBytemap | Advanced | Sparse |||||||
| SparseDict | Advanced | Sparse |||||| ✅️ |
| AtomicLevel | Modifier | No Data |||||| ⚙️ |
Expand Down Expand Up @@ -158,7 +158,7 @@ Finch levels can be used to construct a variety of popular sparse formats. A few
| DCSC (Hypersparse) Matrix | `Tensor(SparseList(SparseList(Element(0.0))), args...)` |
| COO Matrix | `Tensor(SparseCOO{2}(Element(0.0)), args...)` |
| COO 3-Tensor | `Tensor(SparseCOO{3}(Element(0.0)), args...)` |
| Run-Length-Encoded Image | `Tensor(Dense(DenseRLE(Element(0.0))), args...)` |
| Run-Length-Encoded Image | `Tensor(Dense(RunList(Element(0.0))), args...)` |

# Tensor Constructors

Expand All @@ -184,9 +184,9 @@ PatternLevel
## Advanced Levels
```@docs
SparseListLevel
DenseRLELevel
SparseRLELevel
SparseVBLLevel
RunListLevel
SparseRunListLevel
SparseBlockListLevel
SparseBandLevel
SparsePointLevel
SparseIntervalLevel
Expand Down
13 changes: 10 additions & 3 deletions src/Finch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ using Preferences
export @finch, @finch_program, @finch_code, @finch_kernel, value

export Tensor
export SparseRLE, SparseRLELevel
export DenseRLE, DenseRLELevel
export SparseRunList, SparseRunListLevel
export RunList, RunListLevel
export SparseInterval, SparseIntervalLevel
export Sparse, SparseLevel
export SparseList, SparseListLevel
Expand All @@ -33,7 +33,7 @@ export SparsePoint, SparsePointLevel
export SparseBand, SparseBandLevel
export SparseCOO, SparseCOOLevel
export SparseByteMap, SparseByteMapLevel
export SparseVBL, SparseVBLLevel
export SparseBlockList, SparseBlockListLevel
export Dense, DenseLevel
export Element, ElementLevel
export Separate, SeparateLevel
Expand Down Expand Up @@ -187,6 +187,13 @@ include("interface/einsum.jl")
@deprecate dropdefaults dropfills
@deprecate dropdefaults! dropfills!

@deprecate SparseRLE SparseRunList
@deprecate SparseRLELevel SparseRunListLevel
@deprecate DenseRLE RunList
@deprecate DenseRLELevel RunListLevel
@deprecate SparseVBL SparseBlockList
@deprecate SparseVBLLevel SparseBlockListLevel

@static if !isdefined(Base, :get_extension)
function __init__()
@require SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" include("../ext/SparseArraysExt.jl")
Expand Down
4 changes: 2 additions & 2 deletions src/interface/traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ rep_construct(fbr, protos) = Tensor(construct_level_rep(fbr, protos...))

construct_level_rep(fbr::SparseData, proto::Union{Nothing, typeof(walk), typeof(extrude)}, protos...) = SparseDict(construct_level_rep(fbr.lvl, protos...))
construct_level_rep(fbr::SparseData, proto::Union{typeof(laminate)}, protos...) = SparseDict(construct_level_rep(fbr.lvl, protos...))
construct_level_rep(fbr::RepeatData, proto::Union{Nothing, typeof(walk), typeof(extrude)}, protos...) = SparseRLE(construct_level_rep(fbr.lvl, protos...))
construct_level_rep(fbr::RepeatData, proto::Union{Nothing, typeof(walk), typeof(extrude)}, protos...) = SparseRunList(construct_level_rep(fbr.lvl, protos...))
construct_level_rep(fbr::RepeatData, proto::Union{typeof(laminate)}, protos...) = SparseDict(construct_level_rep(fbr.lvl, protos...))
construct_level_rep(fbr::DenseData, proto, protos...) = Dense(construct_level_rep(fbr.lvl, protos...))
construct_level_rep(fbr::ExtrudeData, proto, protos...) = Dense(construct_level_rep(fbr.lvl, protos...), 1)
Expand All @@ -426,7 +426,7 @@ fiber_ctr(fbr, protos) = :(Tensor($(level_ctr(fbr, protos...))))

level_ctr(fbr::SparseData, proto::Union{Nothing, typeof(walk), typeof(extrude)}, protos...) = :(SparseDict($(level_ctr(fbr.lvl, protos...))))
level_ctr(fbr::SparseData, proto::Union{typeof(laminate)}, protos...) = :(SparseDict($(level_ctr(fbr.lvl, protos...))))
level_ctr(fbr::RepeatData, proto::Union{Nothing, typeof(walk), typeof(extrude)}, protos...) = :(SparseRLE($(level_ctr(fbr.lvl, protos...))))
level_ctr(fbr::RepeatData, proto::Union{Nothing, typeof(walk), typeof(extrude)}, protos...) = :(SparseRunList($(level_ctr(fbr.lvl, protos...))))
level_ctr(fbr::RepeatData, proto::Union{typeof(laminate)}, protos...) = :(SparseDict($(level_ctr(fbr.lvl, protos...))))
level_ctr(fbr::DenseData, proto, protos...) = :(Dense($(level_ctr(fbr.lvl, protos...))))
level_ctr(fbr::ExtrudeData, proto, protos...) = :(Dense($(level_ctr(fbr.lvl, protos...)), 1))
Expand Down
Loading

0 comments on commit 4795478

Please sign in to comment.