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

have alias names flow through to NAME/__name__? #10

Open
seanmacavaney opened this issue Apr 24, 2021 · 0 comments
Open

have alias names flow through to NAME/__name__? #10

seanmacavaney opened this issue Apr 24, 2021 · 0 comments

Comments

@seanmacavaney
Copy link
Collaborator

Right now:

MAP -> AP

because MAP is just an alias to AP. Can we (and do we want) alias names to flow through? I'm not sure we can set name on a per-instance basis, but could probably move NAME to be an instance-level field.

This potentially brings up a bunch of questions, though. E.g., do alias names affect equality (MAP == AP)? What happens if metrics are requested for both MAP and AP (for some reason)?

If we want this behavior, I think alias names should affect equality; essentially, they'll be treated as different measures. Otherwise, there could be weird behavior when using them as dictionary keys and such. To get the (potentially aliased) name, use NAME. To get the canonical name, use __name__ (e.g., providers will want to start using __name__ instead of NAME, and support matching should also be done with __name__).

What about aliases that include parameters, like NumRelRet -> NumRet(rel=1)? With the above proposal, it'd end up being NumRelRet -> NumRelRet(rel=1), without specific handling for this case. Maybe it's worth just making it its own measure?

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

1 participant