Skip to content

Breaking: split set into unsafe_set and set#926

Merged
rafaqz merged 25 commits intobreakingfrom
better_set
Feb 8, 2026
Merged

Breaking: split set into unsafe_set and set#926
rafaqz merged 25 commits intobreakingfrom
better_set

Conversation

@rafaqz
Copy link
Copy Markdown
Owner

@rafaqz rafaqz commented Feb 10, 2025

This PR aims to make set much more reliable and useful to users, and keep the faster and always type stable unsafe_set for internal use

closes #624, closes #920 and closes #924

@felixcremer
Copy link
Copy Markdown
Collaborator

I suppose this is going to close #624 #920 and #924?

@rafaqz
Copy link
Copy Markdown
Owner Author

rafaqz commented Feb 11, 2025

Yeah, basically just implementing your idea in #624

Copy link
Copy Markdown
Collaborator

@felixcremer felixcremer left a comment

Choose a reason for hiding this comment

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

This is a first rudimentary reading of the code. I am going to add some tests

Comment thread src/Dimensions/format.jl Outdated
checkaxis(lookup::Union{Dimension,Lookup}, axis::AbstractUnitRange) =
first(axes(lookup)) == axis || _checkaxiserror(lookup, axis)

checkaxes(lookups::Tuple, axes::Tuple) = all(map(checkaxis, lookups, axes))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this be the checkaxis function? From what I understand they are doing conceptually the same on different input. I find it quite confusing to have two different functions with such a similar name.

Comment thread src/set.jl

Fields are always the same as keywords for the objects constructor.

## Examples
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could we hide the examples behind an extended Help block, so that one can get them by doing ?? but one can still quickly look at the docstring without having to scroll through all the examples?

Comment thread src/set.jl Outdated
Comment thread src/set.jl Outdated
Comment thread src/Dimensions/set.jl Outdated
Comment thread src/Dimensions/set.jl Outdated
@felixcremer
Copy link
Copy Markdown
Collaborator

set should also work on a DimTree.

@felixcremer
Copy link
Copy Markdown
Collaborator

set of a single array in a DimStack should work but throws the following error:

julia> set(s, (test2=zero(a2)))
ERROR: MethodError: no method matching rebuild(::DimStack{…}; test2::Matrix{…})
This error has been manually thrown, explicitly, so the method may exist but be intentionally marked as unimplemented.

Closest candidates are:
  rebuild(::AbstractDimStack; data, dims, refdims, layerdims, metadata, layermetadata) got unsupported keyword argument "test2"
   @ DimensionalData ~/.julia/dev/DimensionalData/src/stack/stack.jl:73
  rebuild(::AbstractDimStack, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) got unsupported keyword argument "test2"
   @ DimensionalData ~/.julia/dev/DimensionalData/src/stack/stack.jl:66
  rebuild(::AbstractDimStack, ::Any, ::Any, ::Any, ::Any, ::Any) got unsupported keyword argument "test2"
   @ DimensionalData ~/.julia/dev/DimensionalData/src/stack/stack.jl:66
  ...

Stacktrace:
 [1] kwerr(::@NamedTuple{}, ::Function, ::DimStack{…})
   @ Base ./error.jl:165
 [2] _set(s::DimensionalData.Dimensions.Lookups.Safe, st::DimStack{…}; data::Nothing, dims::Nothing, kw::@Kwargs{})
   @ DimensionalData ~/.julia/dev/DimensionalData/src/set.jl:202
 [3] set(::DimStack{…}; kw::@Kwargs{})
   @ DimensionalData ~/.julia/dev/DimensionalData/src/set.jl:139
 [4] top-level scope
   @ REPL[137]:1
Some type information was truncated. Use `show(err)` to see complete types.

julia> set(s, (test2=zero(a2),))
ERROR: ArgumentError: keys (:test2, :test3) and (:test2,) do not match
Stacktrace:
 [1] _keyerr(ka::Tuple{Symbol, Symbol}, kb::Tuple{Symbol})
   @ DimensionalData ~/.julia/dev/DimensionalData/src/set.jl:268
 [2] _set_dimstack_data(::DimensionalData.Dimensions.Lookups.Safe, st::DimStack{…}, newdata::@NamedTuple{})
   @ DimensionalData ~/.julia/dev/DimensionalData/src/set.jl:254
 [3] _set(s::DimensionalData.Dimensions.Lookups.Safe, A::DimStack{…}, newdata::@NamedTuple{})
   @ DimensionalData ~/.julia/dev/DimensionalData/src/set.jl:240
 [4] set(x::DimStack{…}, args::@NamedTuple{}; kw::@Kwargs{})
   @ DimensionalData ~/.julia/dev/DimensionalData/src/set.jl:139
 [5] top-level scope
   @ REPL[138]:1
Some type information was truncated. Use `show(err)` to see complete types.

@rafaqz
Copy link
Copy Markdown
Owner Author

rafaqz commented Apr 4, 2025

Yeah there is nothing written for DimTree yet

@felixcremer
Copy link
Copy Markdown
Collaborator

setting the axes from a DimStack with mixed dimension names to the same names should fail if the axes can't be made the same.

julia> da = DimArray(a, dimz; name=:test)
┌ 2×2 DimArray{Int64, 2} test ┐
├─────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── dims ┐
   X Sampled{Float64} 143.0:2.0:145.0 ForwardOrdered Regular Points,
   Y Sampled{Float64} -38.0:2.0:-36.0 ForwardOrdered Regular Points
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
      -38.0  -36.0
 143.0    1      2
 145.0    3      4

julia> da2 = DimArray(a2, dimz2; name=:test2)
┌ 3×4 DimArray{Int64, 2} test2 ┐
├──────────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── dims ┐
   row    Sampled{Float64} 10.0:10.0:30.0 ForwardOrdered Regular Points,
   column Sampled{Float64} -2.0:1.0:1.0 ForwardOrdered Regular Points
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
     -2.0  -1.0  0.0  1.0
 10.0   1     2    3    4
 20.0   3     4    5    6
 30.0   4     5    6    7

smix = DimStack(da, da2)
julia> set(smix, :row => X, :column => Z) # This should fail, because the DimStack is not usable.2×2×3×4 DimStack ┐
├──────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── dims ┐
   X Sampled{Float64} 143.0:2.0:145.0 ForwardOrdered Regular Points,
   Y Sampled{Float64} -38.0:2.0:-36.0 ForwardOrdered Regular Points,
  ↗ X Sampled{Float64} 10.0:10.0:30.0 ForwardOrdered Regular Points,
  ⬔ Z Sampled{Float64} -2.0:1.0:1.0 ForwardOrdered Regular Points
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── layers ┤
  :test  eltype: Int64 dims: X, Y size: 2×2
  :test2 eltype: Int64 dims: X, Z size: 2×4

@felixcremer
Copy link
Copy Markdown
Collaborator

I am not too sure, what is the correct behaviour here but I think this should keep working even if the set of mixed axes fail:
This could also get rid of the second X axis.

julia> ssame = DimStack(da, set(da, X=>Z))
┌ 2×2×2 DimStack ┐
├────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── dims ┐
   X Sampled{Float64} 143.0:2.0:145.0 ForwardOrdered Regular Points,
   Y Sampled{Float64} -38.0:2.0:-36.0 ForwardOrdered Regular Points,
  ↗ Z Sampled{Float64} 143.0:2.0:145.0 ForwardOrdered Regular Points
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── layers ┤
  :layer1 eltype: Int64 dims: X, Y size: 2×2
  :layer2 eltype: Int64 dims: Z, Y size: 2×2
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

julia> set(ssame, :Z=>X)
┌ 2×2×2 DimStack ┐
├────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── dims ┐
   X Sampled{Float64} 143.0:2.0:145.0 ForwardOrdered Regular Points,
   Y Sampled{Float64} -38.0:2.0:-36.0 ForwardOrdered Regular Points,
  ↗ X Sampled{Float64} 143.0:2.0:145.0 ForwardOrdered Regular Points
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── layers ┤
  :layer1 eltype: Int64 dims: X, Y size: 2×2
  :layer2 eltype: Int64 dims: X, Y size: 2×2

@rafaqz
Copy link
Copy Markdown
Owner Author

rafaqz commented Apr 4, 2025

Yeah that should get rid of the second X as they match. Not sure what to do if they are different, probably having the same dim twice shouldn't exist

@felixcremer
Copy link
Copy Markdown
Collaborator

Having the same dim twice doesn't work if you try to construct it.

@felixcremer
Copy link
Copy Markdown
Collaborator

I feel like I don't have a good grasp of how the code is entangled. I tried to fix some ambiguities and go through the tests to get them fixed. You should definitively have a good look at my changes, because it feels a bit like guesswork.

@felixcremer
Copy link
Copy Markdown
Collaborator

I fixed the ambiguities and now we run only in other test failures.

@rafaqz
Copy link
Copy Markdown
Owner Author

rafaqz commented Apr 7, 2025

Thanks. I'm not expecting you to work through all that!! It's fine to just add tests that are broken

@felixcremer
Copy link
Copy Markdown
Collaborator

I am not sure, what is the best behaviour here, but I am leaning towards also changing the Sampling to Sampled.

julia> x = format(X([:a,:b]))
X Categorical{Symbol} ForwardOrdered
wrapping: 2-element Vector{Symbol}:
 :a
 :b

julia> xint = set(x, 1:2)
X Categorical{Int64} ForwardOrdered
wrapping: 1:2

@rafaqz
Copy link
Copy Markdown
Owner Author

rafaqz commented Apr 9, 2025

Raster Bands are Categorical Ints, so I think we can't change that.

@felixcremer
Copy link
Copy Markdown
Collaborator

Set of the locus on the boarder of the typemaximum and minimum fails

julia> x = format(X(typemin(Int8):typemax(Int8)))
X Sampled{Int8} ForwardOrdered Regular Points
wrapping: -128:127

julia> xi = set(x, Intervals(Start()))
X Sampled{Int8} ForwardOrdered Regular Intervals{Start}
wrapping: -128:127

julia> set(xi, Center())
ERROR: DimensionMismatch: argument dimensions must match: length of r1 is 0, length of r2 is 256
Stacktrace:
  [1] -(r1::UnitRange{Int8}, r2::UnitRange{Int8})
    @ Base ./range.jl:1443
  [2] broadcasted
    @ ./broadcast.jl:1143 [inlined]
  [3] broadcasted
    @ ./broadcast.jl:1331 [inlined]
  [4] _shiftlocus(destlocus::Center, span::Regular{…}, sampling::Intervals{…}, l::Sampled{…})
    @ DimensionalData.Dimensions.Lookups ~/.julia/dev/DimensionalData/src/Lookups/utils.jl:30
  [5] _shiftlocus
    @ ~/.julia/dev/DimensionalData/src/Lookups/utils.jl:20 [inlined]
  [6] shiftlocus
    @ ~/.julia/dev/DimensionalData/src/Lookups/utils.jl:11 [inlined]
  [7] _maybeshiftlocus
    @ ~/.julia/dev/DimensionalData/src/Lookups/utils.jl:59 [inlined]
  [8] maybeshiftlocus
    @ ~/.julia/dev/DimensionalData/src/Lookups/utils.jl:57 [inlined]
  [9] _set
    @ ~/.julia/dev/DimensionalData/src/Lookups/set.jl:149 [inlined]
 [10] _set
    @ ~/.julia/dev/DimensionalData/src/Dimensions/set.jl:52 [inlined]
 [11] set(dim::X{Sampled{Int8, UnitRange{Int8}, ForwardOrdered, Regular{Int8}, Intervals{Start}, NoMetadata}}, x::Center)
    @ DimensionalData.Dimensions ~/.julia/dev/DimensionalData/src/Dimensions/set.jl:3
 [12] top-level scope
    @ REPL[197]:1
Some type information was truncated. Use `show(err)` to see complete types.

@rafaqz
Copy link
Copy Markdown
Owner Author

rafaqz commented Apr 14, 2025

Ahh looks like Int overflow. Not sure we can deal with that without changing the type

@tiemvanderdeure tiemvanderdeure mentioned this pull request Oct 26, 2025
@rafaqz rafaqz changed the base branch from main to breaking February 8, 2026 08:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 76.62338% with 72 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.69%. Comparing base (6d0a793) to head (c9936ae).
⚠️ Report is 1 commits behind head on breaking.

Files with missing lines Patch % Lines
src/Lookups/set.jl 77.48% 34 Missing ⚠️
src/utils.jl 67.44% 14 Missing ⚠️
src/Dimensions/set.jl 65.71% 12 Missing ⚠️
src/Dimensions/utils.jl 0.00% 7 Missing ⚠️
src/set.jl 92.30% 4 Missing ⚠️
src/Lookups/utils.jl 90.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           breaking     #926      +/-   ##
============================================
- Coverage     87.36%   86.69%   -0.68%     
============================================
  Files            57       58       +1     
  Lines          5683     5839     +156     
============================================
+ Hits           4965     5062      +97     
- Misses          718      777      +59     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rafaqz rafaqz merged commit d4b7506 into breaking Feb 8, 2026
7 of 10 checks passed
@rafaqz rafaqz deleted the better_set branch February 8, 2026 12:45
rafaqz added a commit that referenced this pull request Feb 18, 2026
* include DataType in CategoricalEltypes (#876)

* Breaking: `DimVector` of `NamedTuple` is a `NamedTuple` `DimTable` (#839)

* DimVector of NamedTuple is a NamedTuple table

* bugfix

* remove show

* fix ambiguity

* Breaking: add `combine` method for `groupby` output, fixing `similar` for `AbstractDimStack` (#903)

* add combine method

* test groupby and similar

* docs entry

* Breaking: `preservedims` in tables (#917)

* add preservedims keyword to DimTable

* add tests

* Apply suggestions from code review

Co-authored-by: Anshul Singhvi <anshulsinghvi@gmail.com>

* tests, and fix DimSlices

* better table docs

* cleanup

* test

* indexing overhaul

* fix similar and broadcast for basicdimarray

* bugfix rebuildsliced

* more indexing cleanup

* cleanup similar and gubfix indexing

* bugfixes

* uncomment

* fix doctests

* just dont doctest unreproducable failures, for now

* combine new Tables integrations

* bugfix and cleanup show

* bugfix and more tests for preservedims and mergedims

---------

Co-authored-by: Anshul Singhvi <anshulsinghvi@gmail.com>

* Remove deprecations (#1009)

* typo

* add missing reference docs

* fix DimSlices doc

* Breaking: skipmissing on a dimstack (#1041)

* iterate values where no layer is missing

* add tests

* add skipmissing to reference

* Breaking: Materialize `DimArray` or `DimStack` From a Table (#739)

* Table Materializer Methods

* Made col Optional for DimArray

* Apply suggestions from code review

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Handle coordinates with different loci

* replaced At() with Contains() in _coords_to_ords

* Added optional selectors and public methods for table materializer

* Updated table constructors for DimArray and DimStack

* Updated DimArray and DimStack docs to include table materializer methods

* Table materializer test cases

* export table materializer methods

* Added Random to tables.jl test cases

* Update src/array/array.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Removed exports

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Replaced selector type with instance.

* Table materializer can now infer dimensions from the coordinates.

* Update src/stack/stack.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/array/array.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/table_ops.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Added support for guessing the dimension ordering and span for Dates and DateTimes

* Replaced LinRange with StepRangeLen in _build_dim

* Added Tables.istable check to DimArray constructor

* Update src/array/array.jl

* merge materialize2

* fix scuffed merge

* filter instead of indexing in test for clarity

* fix DimSlices doc

* fix ambiguities

* bugfixes

* do checks and call Tables.columns before constructing stack from table

* test dimensions are automatically detected when constructing dimstack

* comments not docstrings for internals

* check for columnaccess if dims are passed

* add type argument to dimarray_from_table

* allow passing name to DimStack

* add a section to the documentation

* use Tables.columnnames instead of keys

* make DimArray work with all tables that are abstractarrays

* do not treat dimvectors as tables

* simplify get_column

---------

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>
Co-authored-by: Tiem van der Deure <tiemvanderdeure@gmail.com>

* start a CHANGELOG

* bump minor version to 0.30.0

* document Changelog.jl usage

* use rebuild for similar of dimarray with new axes (#1082)

* add _similar dispatch for abstractdimarray

* update tests

* Update src/array/array.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update src/array/array.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

---------

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Breaking: standardise interface methods and remove `index` (#1083)

* standardise interface methods and remove index

* update Changelog

* cleanup

* move const

* cleanup

* remove index from test

* dont export index

* last index

* tweaks

* more tweaks

* fix tests

---------

Co-authored-by: Raf Schouten <schoutenr@ull-pf39vwmc.mobility.unimelb.net.au>

* move abstract constructors to DimArray constructors (#1087)

* Forward name keyword in groupby (#1084)

* Forward name keyword in groupby

* Add test for setting groupby name explicitly

* Update src/groupby.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Update test/groupby.jl

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Add Changelog entry

* Mention name keyword in docstring

---------

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Remove rtol from At selector (#1062)

* Remove rtol from At selector

* Remove explicit rtol from test

* Remove unused type parameter

* fix At constructors

---------

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* fix selector tests

* fix At in dimindices

* Breaking: remove methods that are hardly uesd and cause many invalidations (#1113)

* do 0.6, 0.7.2 broke for us (#1099)

* Fix tests on julia 1.12 (#1110)

* use isequal instead of === to compare NaN

* drop all and broadcast

* specify DimensionalData.Dimensions to make reference unique in docs

* drop convert method for name to abstractstring

* remove `merge` method for dimstack with iterators of pairs

* add to changelog

---------

Co-authored-by: Lazaro Alonso <lazarus.alon@gmail.com>

* Implement `Base.instantiate` - take 2 (#1118)

* implement `instantiate` - get rid of BasicDimensionalStyle

* fix setindex! for opaquearray to make some error messages clearer

* fix materialize!

* StandardIndices methods should be last (#1129)

* add `broadcastable` for abstractdimstack (#1127)

* Add the `D` parameter to `AbstractDimStack` (#1128)

* put D parameter in AbstractDimStack

* update CHANGELOG.md

* remove deprecated LookupArrays (#1132)

* Extend matmul with DimUnitRange axes (#1124)

* Add dims fallback

* Update matmul for mixtures of normal arrays and dimarrays

* Fix bugs

* Add and remove some comparedims checks

* Add tests for matmul with DimUnitRange axes

* Test that dims is nothing for an array

* Test that dims returns dims if all axes DimUnitRange

* Check lookup of anon dims

* Breaking: Include refdims as columns in DimTable (#1119)

* Complete unfinished docstring example

* Support refdims in DimTable

* Test refdims in DimTable

* By default add no refdims to Tables

To make feature non-breaking

* Update tables tests

* Test getcolumn for DimStack/DimArray

* Remove unused variable

* Update constructor calls

* Correctly compute dimnums

* Use all dims to compute colnames

* By default include refdims

* Make sure data-array is duplicated if necessary

* Add preservedims/refdims test

* Fix some bugs

* Add more joint compatibility tests with refdims

* Support AoG selection of refdims

* Only extended array with dims if needed

* Test AoG with refdims

* refdims doc line

---------

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Add a DimStackArray generator (#1131)

* add DimStackArray

* export DimStackArray

* add tests

* add a docstring

* drop inner constructor

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* fix missing }

* fix DimStackArray type definition

* add tests for broadcast over stack

* add to the docs

---------

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* uncomment tests

* unccomend dimindices tests

Co-authored-by: Felix Cremer <felix.cremer@dlr.de>

* Swap dims test and value test in == (#1111)

* Swap dims test and value test in ==

* Add isequal test

* Add broken test for dimarray isequal with different axes

* Make the same swap in == also for DimStack

* Add isequal for AbstractDimArray and AbstractDimstack

* Fix stack test

* Update test/stack.jl

Co-authored-by: Tiem van der Deure <tiemvanderdeure@gmail.com>

* Add Changelog entry

---------

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>
Co-authored-by: Tiem van der Deure <tiemvanderdeure@gmail.com>

* Breaking: Make reduction methods error when passed missing dimensions (#1162)

* Fix NearestNeighbor extension

Description of the fix from Claude:

  The issue was in ext/DimensionalDataNearestNeighborsExt.jl at line 35:

  Problem: The distance vector was being created with the wrong element type:
  distvec = Vector{NN.get_T(eltype(points))}(undef, 1)

  NN.get_T(eltype(points)) was returning SVector{2, Float64} (the point type) instead of Float64 (the scalar distance type). This caused knn! to fail with:
  ArgumentError: dists must have eltype Float64, got StaticArraysCore.SVector{2, Float64}

  Fix: Changed to use eltype(eltype(points)) which correctly extracts the scalar type:
  distvec = Vector{eltype(eltype(points))}(undef, 1)

* Disable broken inference tests

Claude blames the implementation of `_sortdims()`, which is called by `_dims()`
and is apparently not type-stable.

* Disable CondaPkg verbosity

This otherwise spams the terminal.

* Revert "fix `sum(da; dims = :notadim)` (#1116)"

This reverts commit 2245221.

* Improve error messages for reduction methods with missing dims

This uses the new `_missingdims()` helper function to select all the missing
dimensions, and we now don't call `basetypeof` in `_extradimsmsg()` since
`extradims` may not all be `Dim`s.

* Fix Makie tests

* Breaking: split `set` into `unsafe_set` and `set` (#926)

* tweaks

* some ambiguities

* more set

* bugfix unsafe and reorder

* set tweaks

* Update src/Dimensions/set.jl

* Update src/set.jl

* Update src/set.jl

* Update src/Dimensions/set.jl

* Add a few test cases

* Try to fix some ambiguities and some wrong variable names

* Fix ambiguities

* Reimport _astuple

* Add roundtrip tests

* more set tests

* merge breaking

* more tests

* checkaxes => checkaxis

* fix doctests

* doc unsafe set

---------

Co-authored-by: Felix Cremer <fcremer@bgc-jena.mpg.de>

* fix ambiguities

* update CHANGELOG.md for set changes

* Breaking: Extent passthrough for multidimensional lookups (#991)

* hasmultipledimensions

* expand the definition of extent

* bump cairomakie compat

* Add tests for hasmultipledimensions trait and extent passthrough (PR #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

* Refactor to `hasinternaldimensions`

* Add changelog

* Tweak metadata on dimensions.md docs

* Add yet more tests

* Fix StackOverflow in mergedims for single dimension

Wrap old_dims in _astuple() when constructing MergedLookup so that
a bare Dimension doesn't cause infinite recursion in combinedims.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix BoundsError in bounds for empty MergedLookup

Add isempty guard so that bounds on an empty MergedLookup returns ()
instead of throwing when calling first on an empty collection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix multidimensional_lookups test assertions

- Wrap merged_dims in tuple for Extents.extent call
- Assert ArgumentError for unsupported Near selector
- Use Z type instead of Dim{:Z} for @dim-declared dimension

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update CHANGELOG.md

* Add docstring for `hasinternaldimensions`

* Describe what is going on in new extent code

* Add hasinternaldimensions docs to doc pages

---------

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Add removal of LookupArrays into Changelog and remove LookupArrays reference in docs (#1173)

---------

Co-authored-by: Tiem van der Deure <tiemvanderdeure@gmail.com>
Co-authored-by: Anshul Singhvi <anshulsinghvi@gmail.com>
Co-authored-by: Felix Cremer <fcremer@bgc-jena.mpg.de>
Co-authored-by: Joshua Billson <61667893+JoshuaBillson@users.noreply.github.com>
Co-authored-by: Raf Schouten <schoutenr@ull-pf39vwmc.mobility.unimelb.net.au>
Co-authored-by: Lazaro Alonso <lazarus.alon@gmail.com>
Co-authored-by: Seth Axen <seth@sethaxen.com>
Co-authored-by: Felix Cremer <felix.cremer@dlr.de>
Co-authored-by: James Wrigley <JamesWrigley@users.noreply.github.com>
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