Skip to content

Conversation

@fieker
Copy link
Contributor

@fieker fieker commented Dec 10, 2025

No description provided.

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 18.18182% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.21%. Comparing base (2a1d29b) to head (5f80e6c).
⚠️ Report is 31 commits behind head on master.

Files with missing lines Patch % Lines
src/matrix.jl 18.18% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2194      +/-   ##
==========================================
+ Coverage   88.17%   88.21%   +0.03%     
==========================================
  Files          99       99              
  Lines       37177    37087      -90     
==========================================
- Hits        32782    32716      -66     
+ Misses       4395     4371      -24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thofma thofma force-pushed the CF/sub branch 2 times, most recently from 5800a6e to e04724e Compare December 12, 2025 14:42
@thofma
Copy link
Member

thofma commented Dec 12, 2025

@lgoettgens we cleaned it up (similar to your suggestions).

Copy link
Member

@lgoettgens lgoettgens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! Two comments below

@thofma thofma force-pushed the CF/sub branch 2 times, most recently from a110b89 to f2fee53 Compare December 12, 2025 18:24
src/matrix.jl Outdated
Comment on lines 46 to 47
# make x[r, c] sugar for sub(x, r, c)
getindex(x::_MatTypes, r::AbstractVector{Int}, c::AbstractVector{Int}) = sub(x, r, c)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that AA defines https://github.com/Nemocas/AbstractAlgebra.jl/blob/a2325de25fea847b16780935803a30ee84582443/src/Matrix.jl#L476, i.e. the delegation goes from sub to getindex already. This means that this line is superfluous, and the other two special cases should be added to getindex instead.

Suggested change
# make x[r, c] sugar for sub(x, r, c)
getindex(x::_MatTypes, r::AbstractVector{Int}, c::AbstractVector{Int}) = sub(x, r, c)

Comment on lines +28 to +32
function sub(x::$T, r::AbstractUnitRange{Int}, c::AbstractUnitRange{Int})
return deepcopy(view(x, r, c))
end

function sub(M::$T, r::AbstractVector{Int}, c::AbstractVector{Int})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function sub(x::$T, r::AbstractUnitRange{Int}, c::AbstractUnitRange{Int})
return deepcopy(view(x, r, c))
end
function sub(M::$T, r::AbstractVector{Int}, c::AbstractVector{Int})
function getindex(x::$T, r::AbstractUnitRange{Int}, c::AbstractUnitRange{Int})
return deepcopy(view(x, r, c))
end
function getindex(M::$T, r::AbstractVector{Int}, c::AbstractVector{Int})

@lgoettgens
Copy link
Member

Nevermind, my suggestions contradict with the implementations in Nemo. I think, the cleanest solution would be to switch the delegation direction in AA and then keep everything here as is (just removing the last two lines as they then coincide with AA)

@thofma
Copy link
Member

thofma commented Dec 13, 2025

Hm, yeah, there is also still something off. I agree that eventually we should swap it around in AA (make getindex just call sub). But I probably first want get this PR here in.

@fingolfin
Copy link
Member

I'd like to make a "breaking" AA release soon (this week, before Christmas?) for other reasons. If someone can make a PR for the AA change discussed here "soonish", it could perhaps also get into that AA release?

@thofma thofma merged commit e23ad1d into master Dec 15, 2025
20 of 21 checks passed
@thofma thofma deleted the CF/sub branch December 15, 2025 15:59
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.

4 participants