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

[ENHANCEMENT] Decide on default position definitions for eltype and ndims #16

Open
mtfishman opened this issue Dec 12, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mtfishman
Copy link
Member

mtfishman commented Dec 12, 2024

Right now there is a generic definition for any AbstractArray subtype that the first parameter is eltype and the second is ndims, that is of course incorrect for some AbstractArray subtypes but it is a very convenient definition since most AbstractArrays follow that convention.

@mtfishman mtfishman added the enhancement New feature or request label Dec 12, 2024
@mtfishman
Copy link
Member Author

We could make it a bit safer and define position(type::Type{<:AbstractVecOrMat}, ::typeof(ndims)) = error("No position.") which would catch many cases I can think of where the current definition is wrong.

@mtfishman
Copy link
Member Author

We could make it a bit safer and define position(type::Type{<:AbstractVecOrMat}, ::typeof(ndims)) = error("No position.") which would catch many cases I can think of where the current definition is wrong.

Actually never mind, that wouldn't be a good idea since many AbstractVecOrMat are type aliases of an AbstractArray in which case ndims is a type parameter (that happens to be hard-coded to a certain value).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant