Skip to content

Commit 3ba5eca

Browse files
authored
Delete sub_axis (#106)
1 parent beaa889 commit 3ba5eca

File tree

2 files changed

+1
-60
lines changed

2 files changed

+1
-60
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.4.4"
4+
version = "0.4.5"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/BlockArraysExtensions/BlockArraysExtensions.jl

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -192,65 +192,6 @@ function Base.getindex(
192192
return blocks(a)[Int(Block(I))]
193193
end
194194

195-
# Outputs a `BlockUnitRange`.
196-
function sub_axis(a::AbstractUnitRange, indices)
197-
return error("Not implemented")
198-
end
199-
200-
# TODO: Use `GradedUnitRanges.blockedunitrange_getindices`.
201-
# Outputs a `BlockUnitRange`.
202-
function sub_axis(a::AbstractUnitRange, indices::AbstractUnitRange)
203-
return only(axes(blockedunitrange_getindices(a, indices)))
204-
end
205-
206-
# TODO: Use `GradedUnitRanges.blockedunitrange_getindices`.
207-
# Outputs a `BlockUnitRange`.
208-
function sub_axis(a::AbstractUnitRange, indices::BlockSlice{<:BlockRange{1}})
209-
return sub_axis(a, indices.block)
210-
end
211-
212-
# TODO: Use `GradedUnitRanges.blockedunitrange_getindices`.
213-
# Outputs a `BlockUnitRange`.
214-
function sub_axis(a::AbstractUnitRange, indices::BlockSlice{<:Block{1}})
215-
return sub_axis(a, Block(indices))
216-
end
217-
218-
# TODO: Use `GradedUnitRanges.blockedunitrange_getindices`.
219-
# Outputs a `BlockUnitRange`.
220-
function sub_axis(a::AbstractUnitRange, indices::BlockSlice{<:BlockIndexRange{1}})
221-
return sub_axis(a, indices.block)
222-
end
223-
224-
function sub_axis(a::AbstractUnitRange, indices::BlockIndices)
225-
return sub_axis(a, indices.blocks)
226-
end
227-
228-
# TODO: Use `GradedUnitRanges.blockedunitrange_getindices`.
229-
# Outputs a `BlockUnitRange`.
230-
function sub_axis(a::AbstractUnitRange, indices::Block)
231-
return only(axes(blockedunitrange_getindices(a, indices)))
232-
end
233-
234-
# TODO: Use `GradedUnitRanges.blockedunitrange_getindices`.
235-
# Outputs a `BlockUnitRange`.
236-
function sub_axis(a::AbstractUnitRange, indices::BlockIndexRange)
237-
return only(axes(blockedunitrange_getindices(a, indices)))
238-
end
239-
240-
# TODO: Use `GradedUnitRanges.blockedunitrange_getindices`.
241-
# Outputs a `BlockUnitRange`.
242-
function sub_axis(a::AbstractUnitRange, indices::AbstractVector{<:Block})
243-
return blockedrange([length(a[index]) for index in indices])
244-
end
245-
246-
# TODO: Use `GradedUnitRanges.blockedunitrange_getindices`.
247-
# TODO: Merge blocks.
248-
function sub_axis(a::AbstractUnitRange, indices::BlockVector{<:Block})
249-
# `collect` is needed here, otherwise a `PseudoBlockVector` is
250-
# constructed.
251-
return blockedrange([length(a[index]) for index in collect(indices)])
252-
end
253-
254195
# TODO: Use `Tuple` conversion once
255196
# BlockArrays.jl PR is merged.
256197
block_to_cartesianindex(b::Block) = CartesianIndex(b.n)

0 commit comments

Comments
 (0)