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

alias feature is not motivated or documented #57

Open
nsheff opened this issue Dec 21, 2021 · 6 comments
Open

alias feature is not motivated or documented #57

nsheff opened this issue Dec 21, 2021 · 6 comments
Labels

Comments

@nsheff
Copy link
Member

nsheff commented Dec 21, 2021

There's a parallel yacman object in alias.py, which is said to be "A class that extends YacAttMap to provide alias feature."

@stolarczyk Can you provide any additional context or information about what this is? it is not mentioned anywhere else

@nsheff nsheff added the docs label Dec 21, 2021
@stolarczyk
Copy link
Member

There's no docs page for this package so alias usage is documented here: https://github.com/databio/yacman/blob/master/docs/usage.md#key-aliases-in-aliasedyacattmap

@nsheff
Copy link
Member Author

nsheff commented Dec 22, 2021

perfect, thanks for the pointer

@nsheff
Copy link
Member Author

nsheff commented Jan 7, 2022

@stolarczyk can you tell me where we made use of the AliasedYacAttMap object?

I thought it was refgenconf but I see that is not the case.

@nsheff
Copy link
Member Author

nsheff commented Jan 7, 2022

One thing I'm wondering about is: how does this handle nested aliases? All the examples are providing aliases for top-level items in the dict. How do you accommodate aliases for second-level (or lower) items in a nested dict? It seems this isn't implemented to work like that, so can this functionality arise from the recursive nature of attmap?

Follow-up question: is this important for our use case?

I'm asking because in my rewrite of yacman, I'm simplifying things and so I think we'd lose the ability to specify nested aliases like this and I want to know if that is important.

@stolarczyk
Copy link
Member

stolarczyk commented Jan 9, 2022

@stolarczyk can you tell me where we made use of the AliasedYacAttMap object?

I thought it was refgenconf but I see that is not the case.

It does use it; search for "AliasedYacAttMap" in refgenconf.py file.

I didn't intend to make the key aliases feature recursive. It is meant to be used for the top level keys only.
It is actually explicitly stated in the document I linked above:

AliasedYacAttMap is a child class of YacAttMap that supports top-level key aliases

@nsheff
Copy link
Member Author

nsheff commented Jan 10, 2022

Makes perfect sense, thanks!

I was misled because I noticed the primary RefGenConf object is just a YacAttMap, it didn't cross my mind that it may be used as a separate object as an attribute of that object, but I see now that's how it does. And I'm glad to hear it only requires top-level attributes, that makes my job easier!

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

No branches or pull requests

2 participants