chairemobilite / transition

Transition is a modern new approach to transit planning. It's a web application to model, simulate and plan public transit and alternative transportation.
http://transition.city
MIT License
20 stars 13 forks source link

refactor the Node class to extract the transferableNodes from it #932

Open tahini opened 2 months ago

tahini commented 2 months ago

Transferable nodes are not really an attribute of nodes. They are saved separately from the node in the database and need to be manually excluded from the data field, if they are present, before saving to the DB. They should just not be there. There should be another way to get them if/when they are required, which is not often in Transition itself.

That's for Transition. The capnp cache can remain like this (as it is sort of an API now).

greenscientist commented 2 months ago

I disagree about the capnp cache. We duplicate the data about each Node the way is it at the moment. It would probably be way faster if we'd had a data structure more like the one in the database.

tahini commented 2 months ago

I disagree about the capnp cache. We duplicate the data about each Node the way is it at the moment. It would probably be way faster if we'd had a data structure more like the one in the database.

I agree with that, but changing that requires changing 1- trRouting, 2- Transition, 3- json2capnp in sync or by incrementing some major version where we have none... Or we yolo our way there, hoping noone else is using transition outside us now ;-)

greenscientist commented 2 months ago

I think it would be pretty safe to change. The file format is not really documented, so if someone is using it, it's a little bit at their own risk... Once we have something a bit more solid, we could think about versionning.

greenscientist commented 2 months ago

But yes, refartoring the file format could be done in a separate step.