Skip to content

Share birrer adjust bicycle#175

Merged
ThorstenFroehlinghaus merged 6 commits into
mainfrom
share_birrer_adjust_bicycle
Aug 21, 2025
Merged

Share birrer adjust bicycle#175
ThorstenFroehlinghaus merged 6 commits into
mainfrom
share_birrer_adjust_bicycle

Conversation

@ThorstenFroehlinghaus
Copy link
Copy Markdown
Member

avoid lamassu exception

Comment on lines +27 to +30
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides this, birrer uses an invalid propulsion_type hydrogen:
image

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':
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i will set it explicitely

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's for now. I'd choose any_station or what would you choose if some day there are two stations renting bikes?

@ThorstenFroehlinghaus ThorstenFroehlinghaus merged commit 78dbabc into main Aug 21, 2025
2 checks passed
@ThorstenFroehlinghaus ThorstenFroehlinghaus deleted the share_birrer_adjust_bicycle branch August 21, 2025 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants