You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, r5py builds a (python+java)TransportNetwork from a directory containing OSM and GTFS files, or from explictly-named OSM and GTFS files. These networks have to be rebuilt every time the same inputs are used. R5 provides methods for using Kryo to serialize/deserialize (java)TransportNetwork objects to/from arbitrary individual files, so that the network can be reloaded in the future without having to rebuild it from the OSM and GTFS inputs. Making use of this interface would be a big gain in flexibility for r5py.
We're finding it easy to work with the current 'build-every-time' approach, so I'm not going to pursue this in the short term. Because of the interaction with Kryo and JDK version, it seems like it will be a good time to revisit once R5 and r5py have digested the update from Java 11 to Java 21 which has been merged into R5's dev branch.
Currently, r5py builds a (python+java)TransportNetwork from a directory containing OSM and GTFS files, or from explictly-named OSM and GTFS files. These networks have to be rebuilt every time the same inputs are used. R5 provides methods for using Kryo to serialize/deserialize (java)TransportNetwork objects to/from arbitrary individual files, so that the network can be reloaded in the future without having to rebuild it from the OSM and GTFS inputs. Making use of this interface would be a big gain in flexibility for r5py.
The serialization/deserialization interface is in com.conveyal.r5.kyro.KryoNetworkSerializer.
I propose implementing this in (python)TransportNetwork by:
TransportNetwork.__init__()
code to a newTransportNetwork.build_from_sources()
methodTransportNetwork.load_network()
method to read from a Kryo-serialized fileTransportNetwork.__init__()
to parse an input list of files or directory to decide which of the methods to useThere's a variety of reasonable ways to name/arrange this all.
r5r does something similar via a Java implementation in org.ipea.r5r.Network.NetworkBuilder
This is something that I'd be happy to prototype following some discussion of naming and organization.
The text was updated successfully, but these errors were encountered: