Share birrer adjust bicycle#175
Conversation
| if vehicle_type.get('form_factor') == 'bike': | ||
| vehicle_type['form_factor'] = 'bicycle' | ||
| vehicle_type['propulsion_type'] = 'electric' | ||
| vehicle_type['max_range_meters'] = BICYCLE_ELECTRIC_MAX_RANGE_METERS |
There was a problem hiding this comment.
Besides this, birrer uses an invalid propulsion_type hydrogen:

According to v2.3 spec this should be hydrogen_fuel_cell
I suggest to fix this here as well.
| if not isinstance(vehicle_types, list): | ||
| return data | ||
| for vehicle_type in vehicle_types: | ||
| if vehicle_type.get('form_factor') == 'bike': |
There was a problem hiding this comment.
Note that converter gbfs_set_return_constraint evaluates the form_factor to decide on which return constraint should be added. I did not check but assume alphabetic ordering in applying transformations. As gbfs_share_birrer_adjust_bicycle is alphabetic order behind gbfs_set_return_constraint, I assume that for yet unchanged form_factor bike no return constraint will be added.
There was a problem hiding this comment.
ok, i will set it explicitely
| vehicle_type['form_factor'] = 'bicycle' | ||
| vehicle_type['propulsion_type'] = 'electric' | ||
| vehicle_type['max_range_meters'] = BICYCLE_ELECTRIC_MAX_RANGE_METERS | ||
| vehicle_type['return_constraint'] = 'roundtrip_station' # there is only one bicycle station |
There was a problem hiding this comment.
That's for now. I'd choose any_station or what would you choose if some day there are two stations renting bikes?
avoid lamassu exception