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 Base.length methods for ViewAxis and ComponentAxis types #294

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

dingraha
Copy link
Contributor

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

This PR just adds Base.length methods for the ViewAxis and ComponentIndex types, which I find necessary in downstream packages.

@visr
Copy link

visr commented Feb 7, 2025

This would be good to reduce the breakage from #249. I'm not sure how internal it was, but getting a ComponentIndex instead of an Int and a ViewAxis instead of a UnitRange seems pretty breaking.

Perhaps it would make sense to add these as well:

  • Cannot convert an object of type ComponentArrays.ComponentIndex{Int64, ComponentArrays.NullAxis} to an object of type Int64
  • MethodError: no method matching iterate(::ComponentArrays.ViewAxis{1:0, nothing, ComponentArrays.Shaped1DAxis{(0,)}})

@dingraha
Copy link
Contributor Author

dingraha commented Feb 7, 2025

@visr Sorry for the trouble. I've added a couple of methods that may fix your issue to this PR. Would you be able to try them out?

visr added a commit to Deltares/Ribasim that referenced this pull request Feb 7, 2025
@visr
Copy link

visr commented Feb 7, 2025

@dingraha thanks a lot, that fixes all the issues we noticed with v0.15.23!

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