Repository navigation
Conversation
Only place1's geo_proximity was read, so composite_proximity(a, b) and composite_proximity(b, a) could differ. Read it from both places and use their mean, and add tests for symmetry and for the mean.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #257
composite_proximity(a, b)andcomposite_proximity(b, a)could differ, because only the first place'sgeo_proximitywas read. In the example from the issue the two orders gave 0.97 and 0.73.Change
In
dreams_app/core/extra/proximity_calculator.py,geo_proximityis now read from both places. If both have one, their mean is used. If only one has it, that value is used. A short note in the docstring says so. Behaviour only changes when the two places carry differentgeo_proximityvalues; every other case returns what it did before.Tests
Three new tests in
tests/test_proximity_calculator.py: the score is the same in either order, the mean is used when both values are present, and a single value counts whichever place carries it. All three failed before the change.Testing
tests/test_proximity_calculator.py: 34 passed.tests/test_places365_classifier.py, which needs torchvision, in my environment.I picked the mean because it's the simplest symmetric choice. If you prefer the minimum or a pair-level value, it's a one-line change.
AI assistance was used for this change; the tests were run before submitting.