-
Notifications
You must be signed in to change notification settings - Fork 166
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
_assimilate_histogram
and _regenerate_histogram
refactor into standalone functions
#820
Comments
I presume this would also involve writing unit tests for |
Yes, definitely would want to ensure coverage with testing for sure @junholee6a |
Working on this. It'll take a bit to understand the functions and write test cases |
In Test code: def test_assimilate_histogram(self):
ret_value = histogram_utils._assimilate_histogram(
from_hist_entity_count_per_bin=np.array([50, 0]),
from_hist_bin_edges=np.array([0, 5, 10]),
dest_hist_entity_count_per_bin=np.zeros(10),
dest_hist_bin_edges=np.array((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)),
dest_hist_num_bin=10,
)
print('=============== _assimilate_histogram result ===============')
print(ret_value) Output (reformatted by hand):
Expected output:
Is this a bug? |
Potentially related issue: #838 |
#838 is related. If we merge the capabilities and then make that merged function a standalone that would essentially solve both issues, but we separated these out as they accomplish different goals are are hefty tasks on their own for one developer. |
Looking into this now |
So there is a couple of things with this scenario that we cant necessarily make assumptions about.
Is not super intuitive, I also do not like the evenly distributed assumption:
because of the fact that there is a pretty big assumption there as well. @taylorfturner @micdavis @JGSweets @junholee6a thoughts? |
Definitely, this assumes that the values in
Maybe this is covered by returning a higher |
After thinking about it, I may be leaning more towards your suggested expected outcome, I think your right in that there is not a more intuitive approach without some other significant details being shared. |
Thank you @junholee6a for your input. This call out is VERY much appreciated and I am hopeful this will be looked into as time provides!!! |
Is your feature request related to a problem? Please describe.
_assimilate_histogram
and_regenerate_histogram
functions are not using self for anything of substance and as a result can be separated into their own standalone static functions.Describe the outcome you'd like:
Move these two functions outside of the class to histogram_utils.py
Additional context:
The text was updated successfully, but these errors were encountered: