Skip to content

Commit fd8f0ef

Browse files
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 <[email protected]>
1 parent 9156dd3 commit fd8f0ef

File tree

8 files changed

+11
-16
lines changed

8 files changed

+11
-16
lines changed

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Changelog.generate(
4040

4141
- `similar` for `AbstractDimStack` has modified behavior more consistent with
4242
`similar` for `AbstractArray` ([#903]).
43-
- Internal const `CategoricalEltypes` now includes `DataType` - sot that a
43+
- Internal const `CategoricalEltypes` now includes `DataType` - so that a
4444
lookup of types is considered `Categorical` by default ([#876]).
4545
- `skipmissing` on an `AbstractDimStack` now skips any `missing` values in any fiels, rather than `missing`, which can't
4646
actually occur ([#1041]).
@@ -51,12 +51,15 @@ Changelog.generate(
5151
DimArray{T}(x::UndefInitializer, dims::MaybeDimTuple; kw...) where T = DimArray(Array{T}(undef, map(length, dims)), dims; kw...)
5252
MyDimArray(st::AbstractDimStack; kw...) = DD.dimarray_from_dimstack(MyDimArray, st; kw...)
5353
- the deprecated `index` function is now removed completely
54-
- `metadta(obj, dims)` no longer works as its ambiguous and not consistently
54+
- `metadata(obj, dims)` no longer works as its ambiguous and not consistently
5555
implemented - `metadata(obj)` does not return a Tuple for each dimension
5656
like other similar methods, but the metadata of `obj`. To get dimension
5757
metadata going forward, explicitly use `metadata(dims(obj, X))`
58-
- `val(obj)` no longer returns `map(val, dims(obj))` because thats just weird,
58+
- `val(obj)` no longer returns `map(val, dims(obj))` because that's just weird,
5959
val seems like it would return `parent` from that call. `lookup` does this anyway.
60+
- Removed two methods that don't have much use and cause lots of invalidations:
61+
- `Base.convert(Type{<:AbstractString}, name::DD.AbstractName)` is removed, use `string(name)` instead.
62+
- `Base.merge(stack::AbstractDimStack, pairs)` is removed, use `merge(stack, NamedTuple(pairs))` instead.
6063

6164

6265
<!-- Links generated by Changelog.jl -->

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"markdown-it": "^14.1.0",
77
"markdown-it-mathjax3": "^4.3.2",
88
"vitepress": "^1.6.3",
9-
"vitepress-plugin-tabs": "^0.7.1"
9+
"vitepress-plugin-tabs": "^0.6.0"
1010
},
1111
"scripts": {
1212
"docs:dev": "vitepress dev build/.documenter",

docs/src/dimensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ DimensionalData.jl uses `Dimensions` everywhere:
3636
This symmetry means we can ignore how data is organized,
3737
and label and access it by name, letting DD work out the details for us.
3838

39-
Dimensions are defined in the [`Dimensions`](@ref) submodule, and some
39+
Dimensions are defined in the [`DimensionalData.Dimensions`](@ref) submodule, and some
4040
Dimension-specific methods can be brought into scope with:
4141

4242
```julia

src/name.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ Abstract supertype for name wrappers.
55
"""
66
abstract type AbstractName end
77

8-
Base.convert(T::Type{<:AbstractString}, name::AbstractName) = convert(T, string(name))
9-
108
"""
119
NoName <: AbstractName
1210

src/stack/stack.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,6 @@ function Base.merge(
241241
)
242242
rebuild_from_arrays(x1, merge(map(layers, (x1, x2, xs...))...); kw...)
243243
end
244-
function Base.merge(s::AbstractDimStack, pairs; kw...)
245-
rebuild_from_arrays(s, merge(layers(s), pairs); refdims=())
246-
end
247244
function Base.merge(
248245
x1::NamedTuple, x2::AbstractDimStack, xs::Union{AbstractDimStack,NamedTuple}...;
249246
)

test/groupby.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ end
100100
mean(A[X=x, Ti=d])
101101
end
102102
end
103-
@test all(collect(mean.(gb)) .=== manualmeans)
104-
@test all(mean.(gb) .=== manualmeans)
105-
@test all(combine(mean, gb) .=== manualmeans)
103+
@test isequal(collect(mean.(gb)), manualmeans)
104+
@test isequal(mean.(gb), manualmeans)
105+
@test isequal(combine(mean, gb), manualmeans)
106106
end
107107

108108
@testset "broadcast_dims runs after groupby" begin

test/name.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ using DimensionalData: Name, NoName
77
@test Symbol(Name(:x)) === :x
88
@test string(Name(:x)) === "x"
99
@test Name(Name(:x)) === Name(:x)
10-
@test convert(String, Name(:x)) === "x"
1110
end
1211

1312
@testset "NoName" begin
1413
@test Symbol(NoName()) === Symbol("")
1514
@test string(NoName()) === ""
1615
@test Name(NoName()) === NoName()
17-
@test convert(String, NoName()) === ""
1816
end
1917

test/stack.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ end
147147
@test merge(mixed) === mixed
148148
@test keys(merge(mixed, s)) == (:one, :two, :extradim, :three)
149149
@test keys(merge(s, mixed)) == (:one, :two, :three, :extradim)
150-
@test keys(merge(s, (:new=>da4,))) == (:one, :two, :three, :new)
151150
end
152151

153152
@testset "setindex" begin

0 commit comments

Comments
 (0)