Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set attributes for PT schedule elements in a Schedule #131

Open
KasiaKoz opened this issue Aug 3, 2022 · 0 comments
Open

Set attributes for PT schedule elements in a Schedule #131

KasiaKoz opened this issue Aug 3, 2022 · 0 comments
Labels
enhancement New feature or request invalid This doesn't seem right

Comments

@KasiaKoz
Copy link
Collaborator

KasiaKoz commented Aug 3, 2022

If contained in the Schedule object, the PT schedule element objects: Stop, Route, Service do not exist until requested from the Schedule. A new object is created using data stored in

schedule._graph.nodes
schedule._graph.graph['routes']
schedule._graph.graph['services']

respectively.

Right now we rely on Schedule level methods to change these objects. We should add methods that when an attribute is changed or added e.g. route.mode = 'super_bus' the data in schedule._graph.graph['routes'][route.id] is updated, and a change logged in schedule._graph.graph['change_log'].

Errors should be raised when:

  • attempting to change id of the object
  • attempting to change epsg attribute (projection)
    user should be directed to the dedicated methods for reindexing and reprojections

and warnings for:

  • [Route] changing mode (which affects the modes on the network graph link for the route or could mean that the route needs to be rerouted (depending on the type of mode change))
  • [Route] changing network route (there are genet methods for routing, if user is setting this themselves they should be reminded of these methods and that their route may not be valid)
  • [Route] changing ordered_stops (this will affect the network route which relies on links referenced by stops and their order)
  • [Stop] changing spatial values x or y, since stops are usually snapped to a network link and moving them may mean the snapping is no longer correct

Nb. that schedule._graph is shared with and accessible from lesser objects, e.g. route._graph, if that route if contained within that schedule.

@KasiaKoz KasiaKoz added enhancement New feature or request invalid This doesn't seem right labels Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant