Closed Choklatier closed 11 months ago
Attention: 1 lines
in your changes are missing coverage. Please review.
Comparison is base (
12fd171
) 97.28% compared to head (5535428
) 97.28%. Report is 1 commits behind head on main.:exclamation: Current head 5535428 differs from pull request most recent head 058c94c. Consider uploading reports for the commit 058c94c to get more accurate results
Files | Patch % | Lines |
---|---|---|
puma/histogram.py | 80.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks @Choklatier! I think with adding this there are two approaches, extending the current Histogram
class to support bin heights and edges or by defining an extra class like you have done here. I'd maybe be more partial to having it all within the original class but that's just personal preference. But I notice with the current setup that there is quite a bit of shared code between the two classes in the __init__
, so maybe a better approach is to define a histogram base class and have the two types of histograms inherit from them to reduce the amount of shared code?
Thanks @Choklatier! I think with adding this there are two approaches, extending the current
Histogram
class to support bin heights and edges or by defining an extra class like you have done here. I'd maybe be more partial to having it all within the original class but that's just personal preference. But I notice with the current setup that there is quite a bit of shared code between the two classes in the__init__
, so maybe a better approach is to define a histogram base class and have the two types of histograms inherit from them to reduce the amount of shared code?
Thank you for the comment! I agree that there is a lot of shared code in the __init__
and also the divide method is copy pasted since it should exist for all histograms. Do you think it is better to have only one Histogram class and handle the differences in the constructor?
Thanks @Choklatier! I think with adding this there are two approaches, extending the current
Histogram
class to support bin heights and edges or by defining an extra class like you have done here. I'd maybe be more partial to having it all within the original class but that's just personal preference. But I notice with the current setup that there is quite a bit of shared code between the two classes in the__init__
, so maybe a better approach is to define a histogram base class and have the two types of histograms inherit from them to reduce the amount of shared code?Thank you for the comment! I agree that there is a lot of shared code in the
__init__
and also the divide method is copy pasted since it should exist for all histograms. Do you think it is better to have only one Histogram class and handle the differences in the constructor?
Yeah, if that's good with you I think it would be nice that way, just determine which is which based on the constructor arguments
Hi @Choklatier. The PR looks already really good! I just have two comments, mainly about some service stuff.
Once this is done, I'm happy to make the final review and merge it
Hi @Choklatier. The PR looks already really good! I just have two comments, mainly about some service stuff.
* Could you please fix the linting and pre-commit issues in the PR? * Could you also please add tests for your new functionality? * Could you add a changelog entry?
Once this is done, I'm happy to make the final review and merge it
I will add the new modification suggested by @zcapjdb and then I'll try to write some tests for the new functionality! I'll let you know if I figure out how to fix the linting and pre-commit issues!
Hi @Choklatier. The PR looks already really good! I just have two comments, mainly about some service stuff.
* Could you please fix the linting and pre-commit issues in the PR? * Could you also please add tests for your new functionality? * Could you add a changelog entry?
Once this is done, I'm happy to make the final review and merge it
@afroch I believe that each point is done now. Let me know if I missed something or if there is an issue!
I'm merging this now, thanks again @Choklatier for the great contribution and @zcapjdb and @afroch for the reviews
Summary
This pull request introduces the following changes
Relates to the following issues Probably the structure should be revisited to get rid of some helper functions and copy of the "divide" method Need to implement error handling (throwing and catching stuff) !
Conformity