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

[WIP] v0.3 refactor #28

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft

[WIP] v0.3 refactor #28

wants to merge 34 commits into from

Conversation

lkdvos
Copy link

@lkdvos lkdvos commented Feb 18, 2025

This is a rather large refactor that aims to resolve some inconveniences.

  • AbstractArrayInterface is now no longer opinionated
  • AbstractArrayOps is now no longer supported and we require more explicit usage of @derive

It is built on top of #18 so that one should be merged first.

To do

  • figure out a way to resolve infinite recursion in fallback definition
  • ensure downstream packages work
  • work out interface promotion rule system
  • fix linenumber issue

Copy link
Author

Choose a reason for hiding this comment

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

Since we now have downstream tests, I think it does not make too much sense to try and maintain a full SparseArrayDOKs implementation as a test here. Instead, I tried to include some manual small overloads and unit tests with minimal dependencies, and am counting on the testsuite of SparseArraysBase.
This leads to a bit of an annoying mess whenever there is a breaking change, since then the CI would not automatically be able to run the downstream tests, but I think it is fine to be able to manually check that in these cases.

Copy link
Member

Choose a reason for hiding this comment

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

That sounds reasonable.

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 36.50794% with 40 lines in your changes missing coverage. Please review.

Project coverage is 71.50%. Comparing base (8371a5e) to head (3c7eee8).

Files with missing lines Patch % Lines
src/concatenate.jl 0.00% 34 Missing ⚠️
src/arrayinterface.jl 86.95% 3 Missing ⚠️
src/zero.jl 0.00% 2 Missing ⚠️
src/interface_function.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #28      +/-   ##
==========================================
- Coverage   72.89%   71.50%   -1.40%     
==========================================
  Files           9        8       -1     
  Lines         321      200     -121     
==========================================
- Hits          234      143      -91     
+ Misses         87       57      -30     
Flag Coverage Δ
docs ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@lkdvos
Copy link
Author

lkdvos commented Feb 26, 2025

I've added some more changes, and I'm happy to report that I think I at least fixed some of the linenumber problems (although not all of them, I've noticed...).

One interesting problem I ran into: I can't have cat in a submodule Concatenate, and export it out of that submodule to DerivableInterfaces with that same name, since Base.cat already exists there. This would mean you'd have to import DerivableInterfaces.Concatenate.cat which seems rather excessive... So, either I can get rid of the module altogether (although I did like how it was cleanly separated), or we could export Concatenate, or I'd have to look for an alternative solution. Do you have any opinions about this?

@mtfishman
Copy link
Member

I've added some more changes, and I'm happy to report that I think I at least fixed some of the linenumber problems (although not all of them, I've noticed...).

Great!

One interesting problem I ran into: I can't have cat in a submodule Concatenate, and export it out of that submodule to DerivableInterfaces with that same name, since Base.cat already exists there. This would mean you'd have to import DerivableInterfaces.Concatenate.cat which seems rather excessive... So, either I can get rid of the module altogether (although I did like how it was cleanly separated), or we could export Concatenate, or I'd have to look for an alternative solution. Do you have any opinions about this?

Exporting Concatenate seems reasonable (analogous to how Base exports the Broadcast module).

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