# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Links are updated with Changelog.jl using the command:

```julia
Changelog.generate(
    Changelog.CommonMark(),             # output type
    "CHANGELOG.md";                     # input and output file
    repo = "rafaqz/DimensionalData.jl", # default repository for links
)
```

## [0.30.0]

### Added

- `combine` method added to complement `groupby` ([#903])
- `DimSlices` object is now documented interface.
- Tables can now be converted to `AbstractDimArray` or `AbstractDimStack`,
  guessing the lookup values from dimension columns, thanks to major efforts by [@JoshuaBillson] and [@tiemvanderdeure] in ([#739])
- `presevedims` can be used to preseve dimensions of array during conversion to
  tables, so that values may themselves be `AbstractDimArray` ([#917])
- `rebuildsliced` documented and added to the developer interface 
- Broadcasts improved for all `AbstractBasicDimArray`, like `DimSelectors`.
- `groupby` accepts name keyword to set the name of the DimGroupbyArray
- New `hasinternaldimensions` trait function for lookups that contain multiple dimensions - along with tests. ([#991])
- BREAKING: MergedLookup and other lookups with `hasinternaldimensions` now return `extent`/`bounds` of their "internal" dimensions, not of their indices as they did before.  If you merge an X and Y dimension, the extent of that merged lookup will have X and Y elements.  ([#991])


### Fixed

- `Begin`/`End` bugfixed for use as types
- lookup methods like `order`, `span` etc work from all objects consistently
  ([#1071])
- `==` for AbstractDimArray with missing values return missing and do not error
- `isequal` of AbstractDimArrays takes the dimensions into account

### Changed

- `similar` for `AbstractDimStack` has modified behavior more consistent with
  `similar` for `AbstractArray` ([#903]).
- Internal const `CategoricalEltypes` now includes `DataType` - so that a
  lookup of types is considered `Categorical` by default ([#876]).
- `skipmissing` on an `AbstractDimStack` now skips any `missing` values in any fiels, rather than `missing`, which can't
  actually occur ([#1041]).
- Minor changes in coversion to and from tables in some cases.
- Abstract constructors for AbstractDimArray were removed, as they cause ambiguity hassles. 
  If necessary, extending packages can define methods like these for their own types:
    DimArray{T}(x::UndefInitializer, dims::Dimension...; kw...) where T = DimArray{T}(x, dims; kw...)
    DimArray{T}(x::UndefInitializer, dims::MaybeDimTuple; kw...) where T = DimArray(Array{T}(undef, map(length, dims)), dims; kw...)
    MyDimArray(st::AbstractDimStack; kw...) = DD.dimarray_from_dimstack(MyDimArray, st; kw...) 
- the deprecated `index` function is now removed completely
- `metadata(obj, dims)` no longer works as its ambiguous and not consistently
  implemented - `metadata(obj)` does not return a Tuple for each dimension 
  like other similar methods, but the metadata of `obj`. To get dimension 
  metadata going forward, explicitly use `metadata(dims(obj, X))`
- `val(obj)` no longer returns `map(val, dims(obj))` because that's just weird,
  val seems like it would return `parent` from that call. `lookup` does this anyway.
- Added a `D` parameter to AbstractDimStack in ([#1128]) so that its more
  interoperable with AbstractDimArray
- Removed two methods that don't have much use and cause lots of invalidations:
  - `Base.convert(Type{<:AbstractString}, name::DD.AbstractName)` is removed, use `string(name)` instead.
  - `Base.merge(stack::AbstractDimStack, pairs)` is removed, use `merge(stack, NamedTuple(pairs))` instead.
- `unsafe_set` was split out from `set` in ([#926])  - `set` now fixes everything to return a
  correct object, and `unsage_set` does not. Use `set` directly, and
  `unsafe_set` in packages or if you really know what youre doing.

- Removed deprecated LookupArrays and LookupArray

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

[#739]: https://github.com/rafaqz/DimensionalData.jl/issues/739
[#876]: https://github.com/rafaqz/DimensionalData.jl/issues/876
[#903]: https://github.com/rafaqz/DimensionalData.jl/issues/903
[#917]: https://github.com/rafaqz/DimensionalData.jl/issues/917
[#991]: https://github.com/rafaqz/DimensionalData.jl/pull/991
[#926]: https://github.com/rafaqz/DimensionalData.jl/issues/926
[#1041]: https://github.com/rafaqz/DimensionalData.jl/issues/1041
[#1071]: https://github.com/rafaqz/DimensionalData.jl/issues/1071
[#1128]: https://github.com/rafaqz/DimensionalData.jl/issues/1128
[@JoshuaBillson]: https://github.com/JoshuaBillson
[@tiemvanderdeure]: https://github.com/tiemvanderdeure
