File tree 1 file changed +2
-16
lines changed
1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -114,22 +114,7 @@ def _datatree_to_netcdf(
114
114
if unlimited_dims is None :
115
115
unlimited_dims = {}
116
116
117
- ds = dt .ds
118
- group_path = dt .pathstr .replace (dt .root .pathstr , "" )
119
- if ds is None :
120
- _create_empty_group (filepath , group_path , mode )
121
- else :
122
- ds .to_netcdf (
123
- filepath ,
124
- group = group_path ,
125
- mode = mode ,
126
- encoding = _maybe_extract_group_kwargs (encoding , dt .pathstr ),
127
- unlimited_dims = _maybe_extract_group_kwargs (unlimited_dims , dt .pathstr ),
128
- ** kwargs
129
- )
130
- mode = "a"
131
-
132
- for node in dt .descendants :
117
+ for node in dt .subtree :
133
118
ds = node .ds
134
119
group_path = node .pathstr .replace (dt .root .pathstr , "" )
135
120
if ds is None :
@@ -143,3 +128,4 @@ def _datatree_to_netcdf(
143
128
unlimited_dims = _maybe_extract_group_kwargs (unlimited_dims , dt .pathstr ),
144
129
** kwargs
145
130
)
131
+ mode = "a"
You can’t perform that action at this time.
0 commit comments