rafaqz / DimensionalData.jl

Named dimensions and indexing for julia arrays and other data
https://rafaqz.github.io/DimensionalData.jl/stable/
MIT License
271 stars 38 forks source link

`name(Dim)` is Symbol and docstring says it should be String #494

Closed felixcremer closed 1 year ago

felixcremer commented 1 year ago

There is a mismatch for the name function between the docstring and the implementation where the docstring states, that it should return a string, but then it returns a Symbol. I am not sure, whether it matters much in which way to resolve this mismatch.

help?> DD.name
  name(x) => String
  name(xs:Tuple) => NTuple{N,String}
  name(x, dims::Tuple) => NTuple{N,String}
  name(x, dim) => String

  Get the name of an array or Dimension, or a tuple of of either.

  Second argument dims can be Dimensions, Dimension types, or Symbols for Dim{Symbol}.

julia> ax = Dim{:n}(1:3)
Dim{:n} 1:3

julia> name(ax)
:n
rafaqz commented 1 year ago

Yeah it needs to be a Symbol for NamedTuple keys and Table columns. The doc must be old.

felixcremer commented 1 year ago

I prepare a PR to fix the docstring.

rafaqz commented 1 year ago

Did you have a PR for this?

felixcremer commented 1 year ago

Sorry, I had a branch but somehow didn't push it online. I pushed it now.

rafaqz commented 1 year ago

No worries, just avoiding doing it myself if you have