-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1.0 #255
v1.0 #255
Conversation
* Compact show for BlockRange * update docstrings * don't specialize show for zero dim * fix missing io in print * missing show tests * show for BlockIndexRange
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #255 +/- ##
==========================================
+ Coverage 94.53% 95.50% +0.97%
==========================================
Files 16 18 +2
Lines 1501 1625 +124
==========================================
+ Hits 1419 1552 +133
+ Misses 82 73 -9 ☔ View full report in Codecov by Sentry. |
* Add BlockedOneTo * axes for AbstractBlockedUnitRange returns BlockedOneTo * Rewrite test using blockedrange instead of BlockedUnitRange * Update BlockedUnitRange docstring and add for BlockedOneTo/blockedrange * Show for BlockedOneTo * Blocklengths for OrdinalRange block sizes * Update docs * Return BlockedOneTo in indexing with BlockRange * Be less fussy in show tests * Require 1-based lasts in blockedrange * Disallow offset arrays in BlockedUnitRange * undo unnecessary doc change * Test conversions between BlockedOneTo and BlockedUnitRange * Reduce the number of convert methods * Remove axes1 specialization * Disallow offset block axes and blocks in BlockArray constructor * Remove unused axes method
* Specialize blockedrange BroadcastStyle for LazyArrayStyle * Add compat for LazyArrays
@jishnub I think the LazyArrays.jl extension should probably live in LazyArrays.jl. Partly because a lot of LazyBandedMatrices.jl should be moved there. It'll be a lot of work to move that over... |
* Move BandedMatrices+BlockArrays code in BlockBandedMatrices to extension * Bump julia-actions/setup-julia from 1 to 2 (#387) Bumps [julia-actions/setup-julia](https://github.com/julia-actions/setup-julia) from 1 to 2. - [Release notes](https://github.com/julia-actions/setup-julia/releases) - [Commits](julia-actions/setup-julia@v1...v2) --- updated-dependencies: - dependency-name: julia-actions/setup-julia dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Move over blockbanded code * Add tests * Update Project.toml * add tests * Update Project.toml --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Allow more general BlockUnitRange element types * Restrict element type * Get tests passing * Fix some tests * Fix some doctests * Skip broken test in Julia v1.6 * Better support for unitful numbers * Fix tests * Stricter types in _BlockedUnitRange * Improve tests coverage
* Allow non-Int eltypes in BlockedOneTo * Specific constructors in BlockedOneTo * Restrict eltype to integers in BlockedOneTo constructors * Tests for construction from a Tuple
* Move LazyArrays extension to LazyArrays.jl * remove LazyArrays * Move over OneToCumsum This was type piracy in LazyBandedMatrices.jl * Update blockaxis.jl * move out InfiniteArrays.jl tests
@jishnub do you know what's going on with the CI? |
Do you mean why the checks are being skipped? I've used a plugin to skip duplicate checks if a commit has already been tested. |
|
||
BlockedUnitRange(::BlockedUnitRange) = throw(ArgumentError("Forbidden due to ambiguity")) | ||
_blocklengths2blocklasts(blocks) = cumsum(blocks) # extra level to allow changing default cumsum behaviour | ||
@inline blockedrange(blocks::Union{Tuple,AbstractVector}) = _BlockedUnitRange(_blocklengths2blocklasts(blocks)) | ||
# Use `accumulate` instead of `cumsum` because it preserves the element type of the block lengths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jishnub I don't understand this change. Can you give an example where they are different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also will break a lot of smart block ranges eg:
julia> cumsum(Fill(2,10))
2:2:20
julia> accumulate(+,Fill(2,10))
10-element Vector{Int64}:
2
4
6
8
10
12
14
16
18
20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok I tried reverting the change and I see the issue.
I don't like the special cases below, instead we should specialise accumulate(+, ::AbstractFill)
.
* Bump julia-actions/setup-julia from 1 to 2 (#387) Bumps [julia-actions/setup-julia](https://github.com/julia-actions/setup-julia) from 1 to 2. - [Release notes](https://github.com/julia-actions/setup-julia/releases) - [Commits](julia-actions/setup-julia@v1...v2) --- updated-dependencies: - dependency-name: julia-actions/setup-julia dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Map imported names to correct parentmodules (#391) * Remove unused imported names (#392) * Don't import Base.Cartesian (#394) I don't think this is being used anymore * Use FillArrays accumulate * Bump julia-actions/cache from 1 to 2 (#398) Bumps [julia-actions/cache](https://github.com/julia-actions/cache) from 1 to 2. - [Release notes](https://github.com/julia-actions/cache/releases) - [Commits](julia-actions/cache@v1...v2) --- updated-dependencies: - dependency-name: julia-actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Project.toml * Update Project.toml * try running Pkg.update() --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jishnu Bhattacharya <[email protected]>
@jishnub @mtfishman I have essentially all my downstream packages working. I think this is ready to merge and tag. Anything else you wanted merged in first? |
The only potentially breaking change I would maybe want to see is changing the definition of I'm also not entirely convinced of the current slicing behavior of BlockArrays/AbstractBlockedUnitRange when they are sliced with UnitRange, i.e. #347, but I see the argument from @jishnub that preserving the axes of the indices used in the slicing operation is more consistent with conventions in other parts of the Julia ecosystem (besides slicing with |
Not sure if #373 will also be considered for part of the v1 release? |
Agreed, I think it will be confusing for new users that A more incremental renaming that could be beneficial for disambiguating |
I think it actually used to be called
I'd be open to it but I'm not convinced that it is better, or if it's better that it's enough better to merit rewriting a bunch of things and delaying the release. I'm also trying to decide whether the rhyming with My instinct is to leave things as-is since its not too hard to understand and the docs point to to the other functions. |
Since I learned about |
Actually I like @jishnub any opinions on this? |
Also @KristofferC please let us know if you have any opinions on changes as creator of this package! |
Is the proposal here to rename |
That's what I had in mind. |
The change makes sense to me, although I wonder if the two names being so similar might lead to confusion? |
Everything leads to confusion 🤷♂️ PseudoBlockArray definitely leads to confusion. |
Alright, I don't have issues with this change, so perhaps we should go ahead |
I made #400 to track this issue. I'm happy to make a PR this week. |
We should probably have a NEWS.md in the repo where we list the major changes to make it easier to upgrade. |
I don't necessarily think NEWS.md is a good idea. They add extra maintenance burden and inevitably become out-of-date, and Git commit history serves the same purpose. |
What about a section in the README that lists the breaking changes of v1? |
Sure. We can add an example of |
README.md
Outdated
- `BlockedArray` replaces `PseudoBlockArray`. | ||
- Axes are now typically `BlockedOneTo` instead of `BlockUnitRange`. | ||
- Support for some simple block-banded matrices has been moved here from BlockBandedMatrices.jl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other things to potentially mention:
- The definition of
blocksizes(array::AbstractArray)
is changed fromblocklengths.(axes(array))
to an iterator of sizeblocksize(array)
over the sizes of each block ofarray
. BlockedUnitRange
is now parametrized by the element type instead of hardcoded toInt
.
Great to see this merged! Thanks for all of your work on this package @jishnub @dlfivefifty (and previous maintainers). We're planning to depend on this package quite a lot for our tensor network ecosystem, we currently have a pretty ad-hoc block sparse tensor type which we are rewriting from scratch using the BlockArrays package and it has really simplified our lives quite a bit having a well thought out block array interface to work from. It has made me wonder why distributed array types have been re-implementing their own block array-like interfaces instead of using the BlockArrays interface since it seems like a natural fit for that but I suppose that is a different story. |
I don’t think it’s much of mystery: often when someone looks at a package designed by someone else they get put off if the design doesn’t match their expectations. This is made worse if the first attempt doesn’t work or if they encounter a bug. Then one decides they’re better of just designing their system from scratch that does match what they expect. Unfortunately there’s not much that can be done other than make PRs to replace custom designs with ones based on this package…. but it’s not something I’m inclined to spend time worrying about. In any case I’m really glad to hear this package is useful and hopefully the package will continue to improve as a result. |
BlockedOneTo
blocksizes
PseudoBlockArray
asBlockedArray