how to read the network from folder

144 views
Skip to first unread message

boba boba

unread,
Jun 23, 2022, 10:49:31 AM6/23/22
to pypsa

Hi ,

i have folder that contains buses , carriers , generators , generator-p_max_pu , lines , loads ,loads-p_set , snapshots, storage_units , transformers .

i have used this function to import the data from folder
network = pypsa.Network()
network.import_from_csv_folder(foldername)

but i have found after finishing modelling ,that i do not have any output for loads-p_set  , he did not consider it so i have the output folder same as input , i think so
my question : how could i read the data that changing with snapshots from files loads-p_set.csv  and also the data in generator-p_max_pu.csv 

thanks in advance

Johannes Hampp

unread,
Jun 23, 2022, 11:30:11 AM6/23/22
to boba boba, pypsa
Hi there,

Reading and writing to file are independent operations.

After your model exercise you need to save your results to file, else
they will not change.

Use export_to_csv_folder(...) or export_to_netcdf(...) for saving your
results, see here: https://pypsa.readthedocs.io/en/latest/import_export.html


Best,
Johannes

Best regards,
Johannes Hampp (he/him)

Justus Liebig University Giessen (JLU)
Center for international Development and Environmental Research (ZEU)

mailto: johanne...@zeu.uni-giessen.de

Senckenbergstr. 3
DE-35392 Giessen
https://uni-giessen.de/zeu
> --
> 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/565775c5-ec2a-4faa-b08d-8aa506628cb4n%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/565775c5-ec2a-4faa-b08d-8aa506628cb4n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Message has been deleted

boba boba

unread,
Jun 23, 2022, 7:00:36 PM6/23/22
to pypsa
Hi , could i ask which files should i see at output folder ?
sry , i am so new in pypsa and i owuld like to learn .
and i did it already export_to_csv_folder(...)  but i mean , i have at output folder the same data as input except only investment period file and it seems empty,it has only 2 columns objective and years but both of them is empty and also new file storage_units state of charge and  i found inside it the storage name but , all columns has zero values and file called network ,it has max_memusaga column and has only one valze inside it at first row .

what is memusaga and what should be wrong at my model
thanks for help

Johannes Hampp

unread,
Jun 28, 2022, 10:47:14 AM6/28/22
to boba boba, pypsa
Hi there,

as described in the documentation:

https://pypsa.readthedocs.io/en/latest/api_reference.html#pypsa.Network.export_to_csv_folder

You will see files for all components and time-dependent series if they
have non-default values after the model was run.

investment periods is part of the pathway optimization feature. If you
don't use the feature the file is empty.
The same thing happens for component types which you don't use in your
model: If you don't use them, then an empty file will exist with the
component name as file name (e.g. storage units).

Best,
Johannes

Best regards,
Johannes Hampp (he/him)

Justus Liebig University Giessen (JLU)
Center for international Development and Environmental Research (ZEU)

mailto: johanne...@zeu.uni-giessen.de

Senckenbergstr. 3
DE-35392 Giessen
https://uni-giessen.de/zeu

> https://uni-giessen.de/zeu <https://uni-giessen.de/zeu>
> <https://groups.google.com/d/msgid/pypsa/565775c5-ec2a-4faa-b08d-8aa506628cb4n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pypsa/565775c5-ec2a-4faa-b08d-8aa506628cb4n%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/8b1b4770-0b0c-4006-a824-6caa212bd4cdn%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/8b1b4770-0b0c-4006-a824-6caa212bd4cdn%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages