Adding component values to the pypsa Network manually

114 views
Skip to first unread message

swagat panda

unread,
Sep 6, 2021, 5:29:30 AM9/6/21
to pypsa
Hello Everyone,

I have a small question. I want to add all network components to an empty pypsa network manually using normal pandas dataframe manipulations, instead of Network.add or .madd methods.

 Will that cause any unwanted or undetectable issues later on during lopf?  Are there some attributes that will not be modified by this? (On visual inspection of the NetCDF file I didn't notice any difference)

----
Thanks and Regards

Swagat Panda

Neumann, Fabian

unread,
Sep 6, 2021, 6:07:27 AM9/6/21
to swagat panda, pypsa
Hi Swagat,

there are also functions to import components from dataframes


Maybe that's useful.

Best wishes 

Fabian N

On 6 Sep 2021, at 11:30, swagat panda <swagat...@gmail.com> wrote:

Hello Everyone,
--
You received this message because you are subscribed to the Google Groups "pypsa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pypsa+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pypsa/533ae80c-1a7b-4179-9e32-4839d96e92d0n%40googlegroups.com.

swagat panda

unread,
Sep 6, 2021, 6:49:14 AM9/6/21
to pypsa
Hi Fabian,

Thanks for the answer. It's a lifesaver 😊. But still, for the sake of clarity, it is also okay to use custom methods using
pandas dataframe to insert components and values, right?

----
Thanks and Regards

Swagat Panda

Fabian Neumann

unread,
Sep 7, 2021, 3:32:43 AM9/7/21
to swagat panda, pypsa
Yes, I think so. You may just need to be extra careful with providing
suitable values for every attribute as the defaults won't apply
automatically.

You may want to use n.consistency_check().

Best wishes,

Fabian N

On 06/09/2021 12:49, swagat panda wrote:
> Hi Fabian,
>
> Thanks for the answer. It's a lifesaver 😊. But still, for the sake of
> clarity, it is also okay to use custom methods using
> pandas dataframe to insert components and values, right?
>
> /----/
> Thanks and Regards
>
> Swagat Panda
>
> On Monday, 6 September 2021 at 12:07:27 UTC+2 fabian....@kit.edu wrote:
>
> Hi Swagat,
>
> there are also functions to import components from dataframes
>
> https://pypsa.readthedocs.io/en/latest/import_export.html#adding-components-using-pandas-dataframes
> <https://pypsa.readthedocs.io/en/latest/import_export.html#adding-components-using-pandas-dataframes>
>
> Maybe that's useful.
>
> Best wishes
>
> Fabian N
>
> On 6 Sep 2021, at 11:30, swagat panda <swagat...@gmail.com> wrote:
>
> Hello Everyone,
>
> I have a small question. I want to add all network components to an
> empty pypsa network manually using normal pandas dataframe
> manipulations, instead of Network.add or .madd methods.
>
> / Will that cause any unwanted or undetectable issues later on
> during lopf?  Are there some attributes that will not be modified by
> this? (On visual inspection of the NetCDF file I didn't notice any
> difference)/
> /
> /
> /----/
> Thanks and Regards
>
> Swagat Panda
>
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to pypsa+un...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pypsa/533ae80c-1a7b-4179-9e32-4839d96e92d0n%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/533ae80c-1a7b-4179-9e32-4839d96e92d0n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pypsa+un...@googlegroups.com
> <mailto:pypsa+un...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pypsa/4a69a0d9-6418-4455-888c-7c1bcb4982b6n%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/4a69a0d9-6418-4455-888c-7c1bcb4982b6n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages