ricnogfer / pypsatopo

PyPSATopo is a tool that allows generating the topographical representation of any arbitrary PyPSA-based network
8 stars 3 forks source link

simplify warning + save figures with white background + use environment.yaml #2

Open martavp opened 10 months ago

martavp commented 10 months ago

Hi @ricnogfer I was trying pypsatop this morning and it looks great!

I tested with the following more updated versions and it worked nicely Python 3.10 PyPSA 0.25.1 Pandas 2.0.3

I installed graphviz in my environment using

mamba install graphviz

Some ideas to improve the current version:

[ ] remove the warning message when a link does not have bus3 or bus4 specified, this is very common and makes the warning log very busy.

[ ] Add an 'environment.yaml' to keep track of the working version of packages

[ ] Save .png and .jpg by default with a white background (currently difficult to see with dark background)

[ ] In readme, instead of defining the components, you can just link the documentation
https://pypsa.readthedocs.io/en/latest/components.html

ricnogfer commented 10 months ago

Hi @martavp,

Great to know that PyPSATopo works nicely!

Thanks for the suggestions. Concerning the background color... by default, the background is set to transparent (see https://github.com/ricnogfer/pypsatopo/blob/master/pypsatopo.py#L49) as I assumed that this would be what most users prefer. That said, PyPSATopo is highly configurable and the background may be set with a specific color. As an example, this will generate the topographical representation of a network with a white background:

pypsatopo.BACKGROUND_COLOR = "white" pypsatopo.generate(my_network)

Will look/implement the remaining suggestions when the time comes. Thanks for your time for having tried out the tool!

ricnogfer commented 10 months ago

Concerning the idea/suggestion:

[ ] Add an 'environment.yaml' to keep track of the working version of packages

This is solved in commit 01106a058458a1bc78fc05eb759e576d07ded5b7.

ricnogfer commented 10 months ago

Concerning the idea/suggestion:

[ ] remove the warning message when a link does not have bus3 or bus4 specified, this is very common and makes the warning log very busy.

A new issue has been created (https://github.com/ricnogfer/pypsatopo/issues/6) that specifies the logic that will be implemented to solve this in a generic way (so that other possible future use-cases can be solved too).