tensorwerk / stockroom

Version control for software 2.0
https://tensorwerk.com
Apache License 2.0
64 stars 5 forks source link

All possible dictionary style operations for storages #7

Open hhsecond opened 4 years ago

hhsecond commented 4 years ago

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
rlizzo commented 4 years ago

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.

hhsecond commented 4 years ago

That's a great point. Let me put my thoughts to a quick design document before we jump into a conversation. Thanks Rick