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

Write results to cope with PyPsa #18

Open
arjunane opened this issue May 30, 2016 · 7 comments
Open

Write results to cope with PyPsa #18

arjunane opened this issue May 30, 2016 · 7 comments
Assignees

Comments

@arjunane
Copy link
Collaborator

Results shall optionally (and maybe also by default) be formated in a way, that PyPsa can red them.

@maltesc
Copy link
Collaborator

maltesc commented May 31, 2016

This will be done by ZNES, too. Let's create synergy here!

@arjunane
Copy link
Collaborator Author

Good point. Let us just make the output choosable. :)

@maltesc
Copy link
Collaborator

maltesc commented May 31, 2016

Yes, this will happen. The idea is to simply add another "export_csv" function, that automatically calculates the values and exports the corresponding tables.
But this is only one part of it, since you will need the new structure also within the database (in order to be able to dynamically access the different results), we need to change the result-database structure. What is your idea?

@maltesc
Copy link
Collaborator

maltesc commented Jun 28, 2016

We decided to create an independent tool that reads the osmTGmod result data, processes it in Python and writes PyPSA tables into another database (which in ZNES's case is the project database, but this can be easily adapted). This tool will be available soon.

@MatthiasKl
Copy link

Is this tool already available? I am about to write something to convert osmtgmod csv output data to pypsa csv input data - but would of course prefer to use something existing rather than to code on my own.

@arjunane
Copy link
Collaborator Author

arjunane commented Nov 28, 2017

Hi MatthiasKI,
this tool is unfortunatelly not available. As osmTGmod already populates a PostgresDB, i just read the information i need with psycopg2 and SQL-Querrys into python and populate the PyPSA network with it. Takes some time but works quite smoothly. If you come up with a osmTGmod inbuild solution, i will be more than happy to integrate that into the code. Just start a pull-request.

@MatthiasKl
Copy link

Thank you for the advice. I did it like this, only started on the csv output instead of the PostgresDB. It tunred out to be only few lines of coding, the main "challenge" was transformation of coordinate notation from wkb to normal numbers. Furtunately, shapely does this. So after all, indeed no need for whatever tool to get the network to pypsa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants