Skip to content

Commit

Permalink
add .load() before to_netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
karink520 committed Jul 8, 2024
1 parent 973c35b commit 7995fae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pyei/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def to_netcdf(ei_object, filepath):
mode = "a"
for attr in ["demographic_group_fractions", "votes_fractions"]: # array atts
data = xr.DataArray(getattr(ei_object, attr), name=attr)
data.load()
data.to_netcdf(filepath, mode=mode, group=attr, engine="netcdf4")
data.close()

Expand Down

0 comments on commit 7995fae

Please sign in to comment.