Skip to content
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

All possible dictionary style operations for storages #7

Open
hhsecond opened this issue Feb 18, 2020 · 2 comments
Open

All possible dictionary style operations for storages #7

hhsecond opened this issue Feb 18, 2020 · 2 comments

Comments

@hhsecond
Copy link
Member

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
Copy link
Member

rlizzo commented Feb 19, 2020

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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants