Skip to content

Conversation

@asinghvi17
Copy link
Collaborator

@asinghvi17 asinghvi17 commented Apr 30, 2025

  • Extent for merged lookup now expands into the extent for individual dimensions, same for any other lookup that declares itself to be multidimensional
  • New trait function hasmultipledimensions (name controversial)

@tiemvanderdeure
Copy link
Collaborator

I know this is mostly an internal thing - but I don't know if I find hasmultipledimensions an intuitive name.

@rafaqz
Copy link
Owner

rafaqz commented Apr 30, 2025

hasadditionaldimensions ? hasinternaldimensions ?

Its for these mutidimensional dims you can index with the internal dimensions, like X/Y for Geometry

@felixcremer
Copy link
Collaborator

I prefer hasinternaldimensions over hasmultipledimensions.

@asinghvi17
Copy link
Collaborator Author

That could also be e.g. Projected which we don't care about in this context. I only want lookups that are "multidimensional" even if they are vectors, like merged or geometry.

@asinghvi17 asinghvi17 changed the base branch from main to breaking May 5, 2025 00:33
@asinghvi17 asinghvi17 changed the title hasmultipledimensions Extent passthrough for multidimensional lookups May 5, 2025
Base.CartesianIndices(dims::DimTuple) = CartesianIndices(map(d -> axes(d, 1), dims))

# Extents.jl
#=
Copy link
Owner

Choose a reason for hiding this comment

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

Why was this commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So that we still had the old version to refer back to, mainly

Copy link
Owner

Choose a reason for hiding this comment

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

can just remove it, but we probably need an explanation for the new complexity

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea, now that it works I'll do that

Copy link
Collaborator Author

@asinghvi17 asinghvi17 left a comment

Choose a reason for hiding this comment

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

I'm waffling on whether we should define hasmultipledimensions for dimensions...


multidims = otherdims(ds, regulardims)
multidim_raw_bounds = bounds.(multidims) # we trust that bounds will give us a tuple of bounds one for each enclosed dimension
multidim_raw_bounds = map(bounds, multidims) # we trust that bounds will give us a tuple of bounds one for each enclosed dimension
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This needs to be made into a contract, perhaps in the docs of hasmultipledimensions and MultiDimensionalLookup

Copy link
Collaborator Author

@asinghvi17 asinghvi17 left a comment

Choose a reason for hiding this comment

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

I'm waffling on whether we should define hasmultipledimensions for dimensions...

@rafaqz rafaqz changed the title Extent passthrough for multidimensional lookups Breaking: Extent passthrough for multidimensional lookups May 6, 2025
@rafaqz
Copy link
Owner

rafaqz commented Jun 28, 2025

Any updates on this?

I want to merge the breaking branch soon... was this really breaking? If so would be good to combine

@asinghvi17
Copy link
Collaborator Author

Just need to add docs really

But feature wise it is complete

@rafaqz
Copy link
Owner

rafaqz commented Jun 28, 2025

Seems like it needs a few tests too

@asinghvi17
Copy link
Collaborator Author

Yeah that too!

Might get claude to do that.

…991)

- Add comprehensive tests for hasmultipledimensions trait in merged.jl
- Test that regular lookups return false for hasmultipledimensions
- Test that MergedLookup returns true for hasmultipledimensions
- Test extent passthrough for merged dimensions
- Test mixed regular and merged dimensions
- Test that operations preserve the hasmultipledimensions trait
- Add fallback methods to handle edge cases:
  - hasmultipledimensions(::Any) = false for non-Lookup types
  - bounds(x::AbstractArray) for raw arrays
- Import Extents in merged.jl test file
- Fix bounds ambiguity with explicit module qualification
@tiemvanderdeure tiemvanderdeure mentioned this pull request Oct 26, 2025
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.

5 participants