-
Notifications
You must be signed in to change notification settings - Fork 624
Open
Description
Checklist
- I am using the current
masterbranch.
Describe the Bug
When a time-dependent variable, in this case n.links_t.p2 is all 0., the whole table is dropped upon export, here is the line of code where it happens:
Line 504 in a0027f5
| if len(col_export) > 0: |
I.e. if all columns equal the default, the whole table is dropped. Which leads to results disappearing.
MWE
!wget https://model.energy/networks/c6c1d08a805dbbeae283ce07a1195934.nc
import pypsa
n = pypsa.Network("c6c1d08a805dbbeae283ce07a1195934.nc")
(n.links_t.p2 != n.components["Link"]["attrs"].at["p2","default"]).any()
n.links_t.p2["hydrogen_electrolyser"] = 0.
n.export_to_netcdf("c6-test.nc")
n = pypsa.Network("c6-test.nc")
n.links_t.p2
n.links_t.p2["hydrogen_compressor"] = 0.
n.export_to_netcdf("c6c-test.nc")
n = pypsa.Network("c6c-test.nc")
n.links_t.p2Solution
Should not actually drop anything, i.e. save the file exactly as the user expects, then let the compression algorithm worry about saving disk space.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels