-
Notifications
You must be signed in to change notification settings - Fork 112
Replace padded_similar
by similar
#634
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #634 +/- ##
==========================================
- Coverage 88.10% 88.09% -0.02%
==========================================
Files 29 29
Lines 1908 1906 -2
==========================================
- Hits 1681 1679 -2
Misses 227 227 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Why is this not breaking currently? |
This package is loading It is because of this type-piracy that it might be better to not depend explicitly on |
Is it breaking to drop Offset Arrays as a dependency now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes a custom padded_similar
function and replaces its usage with Julia's built-in similar
function. The change aims to eliminate an explicit dependency on OffsetArrays
to facilitate moving OffsetArrays
support to a package extension in future releases.
- Removes the
padded_similar
function definition that handled both regular arrays and offset arrays - Replaces the call to
padded_similar(TC, indspad)
withsimilar(Array{TC}, indspad)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
indsA = axes(A) | ||
indspad = padded_axes(indsA, it) | ||
coefs = padded_similar(TC, indspad) | ||
coefs = similar(Array{TC}, indspad) |
Copilot
AI
Oct 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The replacement similar(Array{TC}, indspad)
may not be functionally equivalent to the original padded_similar(TC, indspad)
. The original function returned OffsetArray{TC}(undef, inds)
for non-OneTo indices, but similar(Array{TC}, indspad)
will always return a regular Array type regardless of the index type. This could break functionality when indspad
contains offset indices.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that actually a problem based on how coefs
is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well Copilot isn't correct here. similar
will return an OffsetArray
if the package is loaded, so there's no difference here.
I'm not familiar with this package to say whether it's breaking. Presumably it will be, as offset axes won't be supported by default if |
These should be functionally equivalent, but this removes an explicit dependency on
OffsetArrays
. This change makes it easier to moveOffsetArrays
support to a package extension in a future breaking release.