Repository navigation
Fix HeatMapWithTime bounds for time-indexed data - #2314
Open
Enesuygurs wants to merge 1 commit into
Open
Enesuygurs wants to merge 1 commit into
Enesuygurs wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
HeatMapWithTime._get_self_bounds()looped overself.dataas if it were a flat list of points. Butdatais a list of time steps, and each step holds a list of[lat, lng(, weight)]points. Sopoint[0]andpoint[1]were whole points, not coordinates.As a result:
get_bounds()returned nested lists such as[[[48.0, 3.0, 0.5], [51.0, 5.0]], ...]instead of[[48.0, 3.0], [52.0, 6.0]].Map.get_bounds()raisedTypeError: '<' not supported between instances of 'list' and 'float'.IndexError.This breaks the common
m.fit_bounds(m.get_bounds())pattern for maps with a HeatMapWithTime.The fix iterates over the points in every time step. The new test covers weighted points, an empty time step and a map with another layer. It fails without the change and passes with it.