Open aulemahal opened 2 years ago
There is already a dependents
variable created during the search()
function, but it gets merged into _requested_variables
and the information is lost afterwards.
Would it be a realistic solution to decouple _dependent_variables
and _requested_variables
, using both when necessary to open the datasets and extract data, and then only keep the _requested_variables
for the final output?
Is your feature request related to a problem? Please describe. When using the catalog with a derived variable registry and calling
to_dataset_dict
, all variables that were needed for the derived variable computation are in the final datasets, even if they were not requested directly.Describe the solution you'd like In the following imaginary example, say we have datasets for
tasmin
,tasmax
andpr
and a function fortas = func(tasmin, tasmax)
in the DVR.I would expect the ouput dataset to only include
tas
andpr
, but with the current intake-esmtasmin
andtasmax
are also returned.Describe alternatives you've considered
_requested_variables
to theESMDataSource
objects, perform that subset into_dataset_dict
directly, after the derived variables have been created._needed_variables
that would store a list of variables including dependencies, while_requested_variables
would not list dependencies. And a subset would be performed byto_dataset_dict
after the derived variable creation.