-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add support for a default aliases file #398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Only a few nitpicks implementation-wise. While thinking about the potential silentless of this feature, I was wondering if we should just list all aliases in DataCollection.info
(), rather than attach it to sources/keys if they happen to be shown (by default not the case for keys).
What if it logged something when an alias is loaded? I'm mildly against listing all the aliases because |
That is correct. I was thinking of warnings/logs too, but wasn't sure people will actually see it. Do we mind just |
Useful for checking if some alias exists, e.g. with `"foo" in run.alias`.
46a8197
to
871512b
Compare
Added a |
Neat, LGTM |
Following up on #367 (comment), I've added support for an
aliases
argument toopen_run()
that defaults to looking for a file namedusr/extra-data-aliases.yml
in the proposal. So as long as that file exists, you get aliases by default. Let the bikeshedding begin! 😀Things to mention:
aliases
argument toopen_run()
and notRunDirectory
because this automatic-aliases-finding thing is specifically for opening runs by proposal. By that argument you could say that thealiases
argument should only support paths and notdict
objects, but I figured it could be useful. I have no objection to removing support fordict
arguments though..with_aliases()
possible inputs is an*arg
of tuples, but I didn't think that API made sense foropen_run()
so I left it out.b29ad11 and b10e82c are smaller fixes that I found useful.