Modified scaling.bins_pairs_by_distance to fix error thrown by narrow distance ranges. #152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed fix for this issue.
When compared to the changes proposed, there two differences: 1) I added
np.iinfo(np.int64).max
to the end ofdist_bins
instead ofnp.inf
and 2) I added two additional conditions to this mask to filter out entries in thepairs_reduced_df
dataframe that fall outside the min and max ofdist_bins
.Tested the changes on HFF Micro-C and everything seems to be in order:
The final dataframe that is returned still contains entries with
min_dist
andmax_dist
values outside of the inputted distance range but that is because ofmake_empty_scaling
function called on line 243 reintroduces them into the dataframe. I'm assuming that this is by design and so I didn't change that behavior.Apologies for the strange documentation in the commits. Something went wrong with the formatting.