Open mathause opened 1 year ago
Currently we only allow passing dict as linear regression predictors. We should also allow passing Dataset (a Dataset is also a Mapping)
dict
Dataset
Mapping
https://github.com/MESMER-group/mesmer/blob/69cb102c3080fce1abb193dc5aa73803e127c2a8/mesmer/stats/linear_regression.py#L173
Could be done as:
if isinstance(predictors, xr.Dataset): predictors = dict(predictors.data_vars)
As far as I can see this is possible as xr.Dataset() is a Mapping. So we should advertise it correctly in the docs and add tests.
xr.Dataset()
Currently we only allow passing
dict
as linear regression predictors. We should also allow passingDataset
(aDataset
is also aMapping
)https://github.com/MESMER-group/mesmer/blob/69cb102c3080fce1abb193dc5aa73803e127c2a8/mesmer/stats/linear_regression.py#L173
Could be done as: