HDF5.jl icon indicating copy to clipboard operation
HDF5.jl copied to clipboard

Make `DataFile <: Associative{String,T}`

Open ggggggggg opened this issue 8 years ago • 3 comments

The interface is already dictionary like, as the docs say, but it's different in ways that make it harder to remember. So, we should go ahead and make DataFile (the supertype of HDF5File and others). I think the following is a good start:

  • [x] add keys, deprecate names (https://github.com/JuliaIO/HDF5.jl/pull/698)
  • [x] add haskey, deprecate exists (https://github.com/JuliaIO/HDF5.jl/pull/694)
  • [ ] add iteration providing k=>v Pairs
  • [ ] add values, keytype, valtype, getkey (or just test that Base implemention works and has wide enough signature)
  • [ ] isempty and length are already defined I think
  • [ ] for get!, pop! and delete! either don't implement, or make them provide a clear not implemented error
  • [ ] does get(collection, key, default) make sense? It feels wrong.
  • [ ] should T (keytype) be Any or tighter?

Does this seem reasonable? If so, I'm happy to submit a PR.

ggggggggg avatar May 09 '17 02:05 ggggggggg

This got brought up again in https://github.com/JuliaIO/HDF5.jl/issues/590

I think we should work towards this

musm avatar Aug 25 '20 15:08 musm

First two on the list have PRs addressing them

musm avatar Oct 08 '20 17:10 musm

Now that we have deprecated names to keys. What should we do with name ? It feels kinda "left" out. I'm also similarly uncomfortable with the filename function.

musm avatar Oct 10 '20 22:10 musm