Skip to content

Commit

Permalink
put setdefault back
Browse files Browse the repository at this point in the history
  • Loading branch information
varchasgopalaswamy committed Oct 26, 2022
1 parent 1a42d5c commit cef5767
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arviz/data/inference_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,14 @@ def from_netcdf(filename, group_kwargs=None, regex=False) -> "InferenceData":

for group in data_groups:

group_kws = {'engine':'h5netcdf'}
group_kws = {}
if group_kwargs is not None and regex is False:
group_kws = group_kwargs.get(group, {})
if group_kwargs is not None and regex is True:
for key, kws in group_kwargs.items():
if re.search(key, group):
group_kws = kws
group_kws.setdefault("engine", "h5netcdf")
with xr.open_dataset(filename, group=group, **group_kws) as data:
if rcParams["data.load"] == "eager":
groups[group] = data.load()
Expand Down

0 comments on commit cef5767

Please sign in to comment.