arup-group / genet

Manipulate MATSim networks via a Python API.
MIT License
44 stars 9 forks source link

Change Files #230

Open KasiaKoz opened 8 months ago

KasiaKoz commented 8 months ago

Not to be confused with the Changelog - Change files would be yml files describing changes to be applied to the network.

On one of our projects we worked with change files for road modifications to the network. They're a great idea, because you can version control them, separate schemes (dedicated file per scheme) and keep changes to the network neat and tidy.

We should add these here, together with a cli command to apply them.

In addition, change files for PT/Schedule modifications would be very useful. PT schemes are usually a lot more complicated than road network changes, so we could start small, covering the basics, and then improve/add more things in the future.

KasiaKoz commented 8 months ago

Pushed the road changes template we used on the project mentioned above: https://github.com/arup-group/genet/blob/issue-230/change-files/genet/change_files/road-change-template.yml

KasiaKoz commented 8 months ago

Made a start on PT change file template: https://github.com/arup-group/genet/blob/issue-230/change-files/genet/change_files/pt-change-template.yml

brynpickering commented 8 months ago

Looks like a good idea. Maybe scenarios or similar would help avoid confusion with changelog.

This would be easy to map to a YAML schema so that these files can be easily validated.

On the PT change template, it would be good to avoid configurable stuff being in the YAML keys (mostly the timestamp ranges in e.g. the headway_spec), and instead force them to be values. It's slightly more verbose, but easier to validate and handle as a loaded Python dictionary.

Current:

headway_spec:  # within the temporal brackets of operation, specify the headway for the service (in minutes)
  00:00:00-06:00:00: 30
  06:00:00-10:00:00: 10

User-configurable only in YAML values:

headway_spec:  # within the temporal brackets of operation, specify the headway for the service (in minutes)
  - bracket: [00:00:00, 06:00:00]
     headway: 30

You could even then have a choice between headway and frequency in the same section (the schema could force only one of headway or frequency to be used in each list item):

temporal_spec:  # within the temporal brackets of operation, specify the headway for the service (in minutes)
  - bracket: [00:00:00, 06:00:00]
     headway: 30
  - bracket: [06:00:00, 12:00:00]
     frequency: 2

^ maybe this isn't useful, I don't know if headway and frequency can even be defined for the same route, even if they don't share temporal brackets.