You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the only way I can find to retrieve the names of the components of ds::KeyedDataset is with keys(ds.data). As noted on slack, it's not safe to access ds.data directly, as its implementation might change. Is there another way to get the components list with an API function? Alternatively, an API function like components(ds::KeyedDataset) = collect(keys(ds.data)) would be useful.
Similarly, am I correct that given a component name k::Symbol, getproperty(ds::KeyedDataset, k) is the intended way to access the corresponding KeyedArray?
The text was updated successfully, but these errors were encountered:
Is there another way to get the components list with an API function?
No, that's why we want to implement #60, so the interface will just be like any other dictionary with Tuple keys.
Similarly, am I correct that given a component name k::Symbol, getproperty(ds::KeyedDataset, k) is the intended way to access the corresponding KeyedArray?
Yes, if your keys are just single symbols then you can access the components with ds.train/ds[:train]/ds[(:train,)]. Internally, keys are stores as "path" tuples to handle hierarchical data, in which case you access the component with ds[(:train, :input, :foo)]
Currently the only way I can find to retrieve the names of the components of
ds::KeyedDataset
is withkeys(ds.data)
. As noted on slack, it's not safe to accessds.data
directly, as its implementation might change. Is there another way to get the components list with an API function? Alternatively, an API function likecomponents(ds::KeyedDataset) = collect(keys(ds.data))
would be useful.Similarly, am I correct that given a component name
k::Symbol
,getproperty(ds::KeyedDataset, k)
is the intended way to access the correspondingKeyedArray
?The text was updated successfully, but these errors were encountered: