File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 651
651
operation and define a halo to be
652
652
added to the subspaced axes.
653
653
============== ======================================""" ,
654
+ # return_esmpy_regrid_operator
655
+ "{{return_esmpy_regrid_operator: `bool`, optional}}" : """return_esmpy_regrid_operator: `bool`, optional
656
+ If True then do not perform the regridding, rather
657
+ return the esmpy.Regrid instance that defines the
658
+ regridding operation.""" ,
654
659
# ----------------------------------------------------------------
655
660
# Method description substitutions (4 levels of indentation)
656
661
# ----------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -791,6 +791,18 @@ def test_Field_regrid_weights_file(self):
791
791
src .regrids (r , method = "linear" , weights_file = tmpfile )
792
792
)
793
793
794
+ @unittest .skipUnless (esmpy_imported , "Requires esmpy/ESMF package." )
795
+ def test_return_esmpy_regrid_operator (self ):
796
+ """esmpy regrid operator returns esmpy.api.regrid.Regrid in regrids and regridc"""
797
+ dst = self .dst
798
+ src = self .src
799
+
800
+ opers = src .regrids (dst , method = "conservative" , return_esmpy_regrid_operator = True )
801
+ operc = src .regridc (dst , method = "conservative" , return_esmpy_regrid_operator = True )
802
+
803
+ self .assertIsInstance (opers , esmpy .api .regrid .Regrid )
804
+ self .assertIsInstance (operc , esmpy .api .regrid .Regrid )
805
+
794
806
795
807
if __name__ == "__main__" :
796
808
print ("Run date:" , datetime .datetime .now ())
You can’t perform that action at this time.
0 commit comments