matsim-vsp / matsim-python-tools

Tools for working with matsim in python
57 stars 20 forks source link

Integrate tools other than data analysis? #6

Closed davibicudo closed 2 years ago

davibicudo commented 4 years ago

Hi, Thanks for the interesting project! I was wondering if you intend to also include python tools for tasks beyond data analysis? Writing XMLs for example: https://github.com/eqasim-org/ile-de-france/blob/develop/matsim/writers.py In the link above, the code is perhaps specific to one use case but it could probably be well generalizable. Kind regards, Davi

billyc commented 4 years ago

Hello! I aim for this Python library to eventually wrap any and all useful MATSim functionality. We're focusing on reading the XML output files now, but writing, setting up configurations, etc, could be tackled in the future.

My next task is to improve the plan reader -- it exposes too much of the XML plumbing right now and we want it to feel more Pythonic.

Is there a specific use case for writing files that you're thinking about? How do you want to integrate MATSim with your Python workflow?

davibicudo commented 4 years ago

Hi Billy, Currently our population is converted from a bunch of CSVs into XML in Java, but we're upgrading our workflow and working on replacing the current scripts with a Python solution. In essence it is similar to the use case of the link above. My first idea was to adapt that code for our use case, but then I remembered of this project and thought it might be the chance to make something reusable by others in the community. If you agree to it, I'd talk to the owners of that project to allow me to port that code in a generalized form as a PR in here.

billyc commented 4 years ago

I definitely agree, it would be great to have some other contributors! And I know the folks on that project too -- collaboration should be easy.

davibicudo commented 4 years ago

Great! It should work quite well :) I'll let you know the updates.

sebhoerl commented 4 years ago

Hi @davibicudo, just got your email. Would be fine for me if you move the code here and then we can start to generalize it. What would be important for me is that there is a fixed version that we can add as a clear dependency. But this here seems to be set up properly on pip, so it is good to go :)

davibicudo commented 4 years ago

Nice! I'm glad :) Probably by the end of next week I'll submit a PR for review.

billyc commented 4 years ago

@davibicudo -- I'm back from vacation and just merged your PR. Could you provide a tiny example code snippet on how to use the new synpop XML writer?

I'd like to include it in the README and then push out a new release.

davibicudo commented 4 years ago

@billyc sure! We also made some local changes which I haven't pushed yet, and the unit test would be nice and is still missing... I'll come back with a new PR with these updates in the following weeks.

davibicudo commented 2 years ago

Done with https://github.com/matsim-vsp/matsim-python-tools/pull/8