-
Notifications
You must be signed in to change notification settings - Fork 1
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
Get expectation values per likelihood term #106
Conversation
for more information, see https://pre-commit.ci
Pull Request Test Coverage Report for Build 6801701346
💛 - Coveralls |
The pre-commit doesn't like the way I change names I think. But I kind of prefer changing the type of ret instead of having to returns in this function.. What do you think? |
To me it looks fine-- mypy is not happy though (I think the overloaded type of ret? |
Yes exactly @kdund but I think it's still nicer to overload this than to have to returns of the function or not? |
Any way you can ask mypy to skip those lines? |
Alternately, you could have type hints on return_per_ll and return_sum separately and return either depending? |
Actually, I think the cleanest way would be to always return a dict of dicts and in the default case it only has one key "total". But I kind of hate to make the default more cumbersome to use... So I think I'll just overload this and make mypy ignore the line. |
This PR adds additional functionality to the
get_expectation_values
method in theBlueiceExtendedModel
. By default, the expectation values for the same source are summed over all likelihood terms. This remains to be the default, however now you can also get a dict of a dict, which contains the expectation values for each lieklihood term individually.Example: