Ouranosinc / xscen

A climate change scenario-building analysis framework.
https://xscen.readthedocs.io/
Apache License 2.0
15 stars 2 forks source link

More extract features for RDRS #182

Closed juliettelavoie closed 1 year ago

juliettelavoie commented 1 year ago

Pull Request Checklist:

What kind of change does this PR introduce?

Does this PR introduce a breaking change?

not, if we don't change the name of clisops_subset

Other information:

RondeauG commented 1 year ago

I just saw that clisops_subset still exists as is. I think that we should rather have:

def clisops_subset(ds, region):
     warning(blabla)
     ds_subset = xs.spatial.subset(ds, region)
     return ds_subset

So as not to duplicate the code twice and have an outdated version, especially since the new function should work perfectly well with the old arguments.

juliettelavoie commented 1 year ago

I just saw that clisops_subset still exists as is. I think that we should rather have:

def clisops_subset(ds, region):
     warning(blabla)
     ds_subset = xs.spatial.subset(ds, region)
     return ds_subset

So as not to duplicate the code twice and have an outdated version, especially since the new function should work perfectly well with the old arguments.

done!

juliettelavoie commented 1 year ago

In extract_dataset, we ask for the name in the definition of the region in order to update cat:domain. This field was not necessary in clisops_subset, but I made it necessary in spatial.subset.