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

Move StaticArrayStyle here. #8

Merged
merged 4 commits into from
Aug 22, 2022
Merged

Conversation

N5N3
Copy link
Contributor

@N5N3 N5N3 commented Aug 21, 2022

This PR wants to move Size, StaticArrayStyle, is_staticarray_like (renamed from isstatic), and similar_type into Core package.
These functions are needed in StructArrays.jl to support static broadcast for a StructArray of StaticArrays. JuliaArrays/StructArrays.jl#215 (comment)
Edit: It turns out we only need StaticArrayStyle and similar_type to achieve this. Since similar_type has been taken care by #5
This PR only wants to move StaticArrayStyle here.

@N5N3 N5N3 changed the title Move some broadcast related function/type here. Move StaticArrayStyle here. Aug 22, 2022
@codecov
Copy link

codecov bot commented Aug 22, 2022

Codecov Report

Merging #8 (18e296a) into main (c97edbf) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 18e296a differs from pull request most recent head 4fd3332. Consider uploading reports for the commit 4fd3332 to get more accurate results

@@            Coverage Diff            @@
##              main        #8   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           46        48    +2     
=========================================
+ Hits            46        48    +2     
Impacted Files Coverage Δ
src/StaticArraysCore.jl 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mateuszbaran
Copy link
Collaborator

Looks fine, could you just add a test for the constructor and bump version?

I haven't merged #5 yet because I don't know which methods of similar_type need to be moved here -- I'd like some input on this before merging that PR.

Project.toml Outdated Show resolved Hide resolved
Co-authored-by: Mateusz Baran <[email protected]>
@N5N3
Copy link
Contributor Author

N5N3 commented Aug 22, 2022

which methods of similar_type need to be moved here

I'm assuming similar_type could be used only when we have loaded StaticArrays.jl?
If that's true, then #5 should be enough for 2-args usage. (Just like StructArrays.jl).

But if some package want to add more methods, I think we will have to move Size here.

@mateuszbaran
Copy link
Collaborator

I'm assuming similar_type could be used only when we have loaded StaticArrays.jl?
If that's true, then #5 should be enough for usage. (Just like StructArrays.jl).

Technically similar_type could be used without StaticArrays.jl and that's why I want some input -- it's perfectly fine to just have a function without methods here for people to extend it in other packages but so far no one confirmed that this is what they want.

But if some package want to add more methods, I think we will have to move Size here.

That is very likely but it should not be a problem.

@mateuszbaran mateuszbaran merged commit 5b4e390 into JuliaArrays:main Aug 22, 2022
@N5N3 N5N3 deleted the extendable_bc branch August 22, 2022 11:27
@mateuszbaran
Copy link
Collaborator

@N5N3 could you make a corresponding PR to StaticArrays.jl?

@N5N3
Copy link
Contributor Author

N5N3 commented Aug 23, 2022 via email

@mateuszbaran
Copy link
Collaborator

I wouldn't like to have StaticArraysCore and StaticArrays desynchronized for too long. Are you planning to work on similar_type this week? Or do you just need the function definition like in #5 ?

@N5N3
Copy link
Contributor Author

N5N3 commented Aug 23, 2022 via email

@mateuszbaran
Copy link
Collaborator

OK, then I will finish that PR today.

mateuszbaran added a commit to JuliaArrays/StaticArrays.jl that referenced this pull request Aug 24, 2022
)

* Define `similar_type` and `StaticArrayStyle` in core package.

See JuliaArrays/StaticArraysCore.jl#5
and JuliaArrays/StaticArraysCore.jl#8

* Bump version

* Update Project.toml

Co-authored-by: Mateusz Baran <[email protected]>

Co-authored-by: Mateusz Baran <[email protected]>
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