-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
bugSomething isn't workingSomething isn't working
Description
In fetching options, .values[()] is used:
def _get_unfiltered_pkg_options(
self, predefined_options: dict, not_options: Optional[list] = None
):
options = copy(predefined_options)
if not_options is None:
not_options = []
if hasattr(self, "_period_data"):
not_options.extend(self._period_data)
if hasattr(self, "_auxiliary_data"):
not_options.extend(self._auxiliary_data.keys())
for varname in self.dataset.data_vars.keys(): # pylint:disable=no-member
if varname in not_options:
continue
v = self.dataset[varname].values[()]
options[varname] = v
return optionsUnless I'm mistaken, options should always be scalar. So I think .item() should be used instead.
.item() has the strong advantage of erroring on non-scalar contents. At the moment, the concentration array is fully loaded into memory due to #1681; this would not have happened if .item() is used here.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
📯 New