We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78d6123 commit 0e80f8aCopy full SHA for 0e80f8a
1 file changed
uxarray/core/dataset.py
@@ -97,9 +97,16 @@ def __init__(
97
ds = args[0]
98
# Replacee only args[0], `ds`, with `ds.data_vars` as `dict`
99
args = (dict(ds.data_vars),) + args[1:]
100
- # Set `coords` and `attrs` only if they are not explicitly provided
101
- kwargs.setdefault("coords", dict(ds.coords))
102
- kwargs.setdefault("attrs", ds.attrs)
+ # coords not passed positionally
+ if len(args) < 2:
+ kwargs.setdefault(
103
+ "coords", dict(ds.coords)
104
+ ) # Set it as kwarg only if not explicitly provided
105
+ # attrs not passed positionally
106
+ if len(args) < 3:
107
108
+ "attrs", ds.attrs
109
110
111
super().__init__(*args, **kwargs)
112
0 commit comments