-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add method for iterating metadata #51
Comments
This (and your earlier comment in the PR) raise the following issue (which I initially wanted to avoid to ensure simplicity). We could add a method The reason why I have not added this requirement initially was that I was afraid that package maintainers would find it difficult to correctly implement this custom type and The alternative, as you propose, would be to add (the same for column-level metadata, but let us leave this discussion for later) CC @nalimilan |
It's definitely tempting to have a way of directly interacting with an On the other hand, I have similar apprehensions about the cost of an increasingly strict interface at this point. I recall some trial and error to get interfaces like |
Let us wait for what @nalimilan thinks |
Given that we have
What would this provide compared with simply using |
It could be a dynamic dict being a view, but I agree - as commented above - that it is tricky. In summary - do we think adding |
As usual, I'd rather wait until somebody really needs it. ;-) |
I couldn't follow all the discussion in #53, but it would make sense to me to just have julia> Dict(key => metadata(df, key) for key in metadatakeys(df))
Dict{String, Float64} with 2 entries:
"RMSE" => 0.10915
"t₀" => 3.974 |
and the same for CC @nalimilan |
Any type that supports metadata will likely need a way to iterate over metadata for propagating metadata to new instances or merging metadata. The generic way of iterating through metadata right now is using accessing each key form the iterable returned by
metadatakeys
. Depending on how metadata is stored this may not be the most efficient way to accomplish this. If the method that is propagating metadata internally is managing a single collection of metadata then a unique implementation can be written for whatever method of iteration is best. However, when combining multiple sets of metadata it's not practical to have a unique method for every combination of metadata storage patterns.A couple things to consider in supporting generic iteration over metadata:
metapairs
andstyledmetapairs
.metadatakeys
?The text was updated successfully, but these errors were encountered: