Skip to content

Commit

Permalink
Merge pull request #4211 from hove-io/geovelo_places_count
Browse files Browse the repository at this point in the history
[Jormungandr]: Geovelo: places_count added
  • Loading branch information
azime authored Feb 6, 2024
2 parents ecdef14 + 81c3852 commit 7bec236
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/jormungandr/jormungandr/street_network/geovelo.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def __init__(
self._feed_publisher = FeedPublisher(**feed_publisher) if feed_publisher else None
self.verify = verify
self.mode_weight = kwargs.get("mode_weight") or DEFAULT_MODE_WEIGHT
self.places_count = kwargs.get("places_count", 125)
self.mode_weight_keys = set(self.mode_weight.keys())

def status(self):
Expand Down Expand Up @@ -452,7 +453,7 @@ def is_reached_by_physical_mode(self, place):
return self.mode_weight_keys & self.get_physical_modes_uris(place)

def get_truncated_places_isochrone(self, places_isochrone):
return places_isochrone[:125]
return places_isochrone[: self.places_count]

def filter_places_isochrone(self, places_isochrone):
result = (p for p in places_isochrone if self.is_reached_by_physical_mode(p))
Expand Down

0 comments on commit 7bec236

Please sign in to comment.