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

add Aqua.jl tests and fix ambiguity #283

Closed
wants to merge 3 commits into from

Conversation

Moelf
Copy link

@Moelf Moelf commented Oct 24, 2023

Also doc test seems to be failing on 1.10+ because of the @NamedTuple printing

@Moelf Moelf changed the title add Aqua and fix ambiguity add Aqua.jl tests and fix ambiguity Oct 24, 2023
@Moelf
Copy link
Author

Moelf commented Oct 24, 2023

@LilithHafner can you review this? I guess this repo isn't very active these days.

@@ -512,6 +515,12 @@ function BroadcastStyle(b::AbstractArrayStyle{M}, a::StructArrayStyle{S, N}) whe
S′ = Broadcast.result_style(S(), b)
return S′ isa StructArrayStyle ? typeof(S′)(Val{N′}()) : StructArrayStyle{typeof(S′), N′}()
end
function BroadcastStyle(
::Union{SparseArrays.HigherOrderFns.SparseMatStyle, SparseArrays.HigherOrderFns.SparseVecStyle},
Copy link
Contributor

Choose a reason for hiding this comment

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

The aqua addition looks good to me. CI is all red here, even when it was green on master Saying something about "SparseArrays" not found. That should probably get fixed. Maybe this line?

I have not reviewed the changes to src/structarray.jl.

Copy link
Author

Choose a reason for hiding this comment

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

should I import SparseArrays here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like a bad idea to add SparseArrays as a dependency just for this. Maybe a weak dependency if necessary?

Copy link
Member

Choose a reason for hiding this comment

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

There is a SparseArrays extension now, so this may be moved to that?

::Union{SparseArrays.HigherOrderFns.SparseMatStyle, SparseArrays.HigherOrderFns.SparseVecStyle},
::StructArrays.StructArrayStyle{S, 0}
)
return Unknown()
Copy link
Author

Choose a reason for hiding this comment

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

not sure what's the correct style here, but before it would result in ambiguity error so this isn't regression

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like that. Ambiguity errors exist for a reason. If it is truly ambiguous then somebody who understands what is going on needs to disambiguate it, setting it to Unknown() could be worse than an ambiguity error.

@@ -512,6 +515,12 @@ function BroadcastStyle(b::AbstractArrayStyle{M}, a::StructArrayStyle{S, N}) whe
S′ = Broadcast.result_style(S(), b)
return S′ isa StructArrayStyle ? typeof(S′)(Val{N′}()) : StructArrayStyle{typeof(S′), N′}()
end
function BroadcastStyle(
::Union{SparseArrays.HigherOrderFns.SparseMatStyle, SparseArrays.HigherOrderFns.SparseVecStyle},
Copy link
Author

Choose a reason for hiding this comment

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

should I import SparseArrays here?

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.

3 participants