Closed JBGreisman closed 1 year ago
I made the requested refactors to bin_by_percentile()
and the corresponding changes to DataSet.assign_resolution_bins()
to preserve the user-facing API
Base: 98.37% // Head: 98.35% // Decreases project coverage by -0.02%
:warning:
Coverage data is based on head (
5af73b1
) compared to base (01a3e6c
). Patch coverage: 100.00% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@kmdalton I think this is good to go now, but let me know if you have any other thoughts
i think refls that fall outside the bin range should probably get dropped by default, but i am open to suggestions.
This is different than the current behavior in rs.utils.assign_with_binedges()
, but could be implemented in DataSet.assign_resolution_bins()
by pre-dropping any reflections before the call. If I do not do the pre-processing, the behavior will be to raise a ValueError
that says "This function assumes 'bin_edges' contain every entry in 'data'"
.
I hesitate to auto-drop reflections from the DataSet, but I think that could be acceptable as long we add a corresponding remark in the docstring
I updated this PR to allow DataSet.assign_resolution_bins()
to support making assignments based on explicit bin edges. I made the following decisions regarding API:
Fixes #184 by adding a
return_edges
argument toDataSet.assign_resolution_bins()
. This PR adds that flexibility to the API, but otherwise does not change the default behavior of the function to preserve backwards compatibility.