diff --git a/rook/director/director.py b/rook/director/director.py index beb6a17..041d9ee 100644 --- a/rook/director/director.py +++ b/rook/director/director.py @@ -108,8 +108,8 @@ def _resolve(self): if self.inputs.get("apply_fixes") and self.requires_fixes(): return - # TODO: quick fix for average and concat. Don't use original files for these operators. - if "dims" in self.inputs or "freq" in self.inputs: + # TODO: quick fix for average, regrid and concat. Don't use original files for these operators. + if "dims" in self.inputs or "freq" in self.inputs or "grid" in self.inputs: return # Finally, check if the subset requirements can align with whole datasets diff --git a/tests/test_wps_regrid.py b/tests/test_wps_regrid.py index 8060747..73d2c3a 100644 --- a/tests/test_wps_regrid.py +++ b/tests/test_wps_regrid.py @@ -1,16 +1,27 @@ import pytest +import xarray as xr + from pywps import Service from pywps.tests import assert_response_success, client_for from rook.processes.wps_regrid import Regrid -from .common import PYWPS_CFG, get_output +from .common import PYWPS_CFG, get_output, extract_paths_from_metalink + + +def assert_regrid(path): + assert "meta4" in path + paths = extract_paths_from_metalink(path) + assert len(paths) > 0 + print(paths) + ds = xr.open_dataset(paths[0]) + assert "time" in ds.coords def test_wps_regrid_cmip6(): client = client_for(Service(processes=[Regrid()], cfgfiles=[PYWPS_CFG])) - datainputs = "collection=c3s-cmip6.ScenarioMIP.INM.INM-CM5-0.ssp245.r1i1p1f1.Amon.rlds.gr1.v20190619" + datainputs = "collection=CMIP6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803" datainputs += ";method=nearest_s2d" datainputs += ";grid=auto" resp = client.get( @@ -19,3 +30,4 @@ def test_wps_regrid_cmip6(): print(resp) assert_response_success(resp) assert "output" in get_output(resp.xml) + assert_regrid(path=get_output(resp.xml)["output"])