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

Non-numeric eltypes in OneElement #315

Merged
merged 1 commit into from
Dec 3, 2023

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Dec 3, 2023

This lifts the somewhat unnecessary restriction to numeric eltypes in the OneElement constructor. After this, the following works:

julia> OneElement(SMatrix{2,2}(1:4), (2,2), (2,2))
2×2 OneElement{SMatrix{2, 2, Int64, 4}, 2, Tuple{Int64, Int64}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}:
                     
            [1 3; 2 4]

In general, indexing into this requires that the element type defines zero(T) and ideally returns a value of type T.

Also, fixes some ambiguities in the 0-D Fill and OneElement constructors.

Copy link

codecov bot commented Dec 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1a9746c) 99.88% compared to head (d7eb614) 99.88%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #315   +/-   ##
=======================================
  Coverage   99.88%   99.88%           
=======================================
  Files           8        8           
  Lines         906      906           
=======================================
  Hits          905      905           
  Misses          1        1           

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

@dlfivefifty dlfivefifty merged commit 8c7ace3 into JuliaArrays:master Dec 3, 2023
24 checks passed
@jishnub jishnub deleted the oneelnonnumeric branch December 12, 2023 08:02
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