Skip to content
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

Adapt test_mutating_op_like_(add)mul to work with scalar mul as well #1892

Merged
merged 3 commits into from
Nov 10, 2024

Conversation

lgoettgens
Copy link
Collaborator

I now came across two places (namely thofma/Hecke.jl#1659 for SRows and oscar-system/Oscar.jl#4271 for RootSpaceElems) where we don't have a multiplication between objects, but only scalar multiplication (and corresponding mul! methods).

To make use of the test_mutating_op_* functions, we must have a way to disable multiplications between objects. I achieved this in this PR by adding two kwargs, that state if the left respective right factor of some multiplication is a scalar. If this is the case, we only run the tests where the output is aliased with a non-scalar input. This skips all tests where we would multiply two objects (which errors in the above cases) and the ones where we use a scalar type to save the output in (as these don't really make sense anyway and will fallback to the default impl).

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.79%. Comparing base (4013a59) to head (aac5ba3).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1892      +/-   ##
==========================================
- Coverage   88.14%   87.79%   -0.35%     
==========================================
  Files         120      120              
  Lines       30300    30276      -24     
==========================================
- Hits        26708    26582     -126     
- Misses       3592     3694     +102     

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

fingolfin
fingolfin previously approved these changes Nov 7, 2024
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

As always: thank you very much for working on this, I really appreciate it :-)

test/Rings-conformance-tests.jl Outdated Show resolved Hide resolved
test/Rings-conformance-tests.jl Outdated Show resolved Hide resolved
test/Rings-conformance-tests.jl Outdated Show resolved Hide resolved
test/Rings-conformance-tests.jl Outdated Show resolved Hide resolved
test/Rings-conformance-tests.jl Outdated Show resolved Hide resolved
test/Rings-conformance-tests.jl Outdated Show resolved Hide resolved
test/Rings-conformance-tests.jl Outdated Show resolved Hide resolved
@lgoettgens
Copy link
Collaborator Author

Yeah, this target type thing seems more natural. Let me try it out and then come back to this.

@lgoettgens lgoettgens marked this pull request as draft November 8, 2024 09:03
@lgoettgens lgoettgens marked this pull request as ready for review November 9, 2024 21:01
@fingolfin fingolfin merged commit c509f90 into Nemocas:master Nov 10, 2024
28 of 29 checks passed
@lgoettgens lgoettgens deleted the lg/test_mutating_mul-scalar branch November 15, 2024 09:28
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