All possible dictionary style operations for storages
Opened this issue · 2 comments
Description
Stockroom provides dictionary-like access mechanism for its storages but all the dictionary-style operations are not possible.
What's possible now
# assignment to keys
stock.data['col', 'sample'] = array
stock.model['name'] = model
stock.tag['key'] = 'val'
# retrieval from keys
print(stock.tag['key'])
What's needed
# fetch all keys, values and items
stock.tag.keys()
stock.tag.values()
stock.tag.items()
# length
len(stock.tag)
# delete
del stock.tag['key']
# contain check
'key' in stock.tag
We should talk before you implement this.
Hangar now can adopt arbitrary column layouts (flat & nested at the moment, but more to come). The layout essentially dictates the API, and each requires a custom implementation. If stockroom is planning to support data in various layouts, then I would offload as much of the work to hangar as possible; it's not that fun to keep all the boilerplate code up to date across multiple classes...
What are your thoughts on balancing simplicity of the stockroom with the features/API available in hangar? Itll be important to figure out as the project moves into a more mature phase.
That's a great point. Let me put my thoughts to a quick design document before we jump into a conversation. Thanks Rick