File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33"""
44
55# -*- coding: utf-8 -*-
6- import numpy as np
6+ import warnings
7+
78import xarray as xr
89
910try :
1011 import xesmf as xe
1112except ModuleNotFoundError :
12- raise Warning (
13- "No module named 'ESMF', often due to installation with pip instead of conda for the xesmf lib."
13+ raise warnings . warn (
14+ "Warning: No module named 'ESMF', often due to installation with pip instead of conda for the xesmf lib."
1415 "You can try to manually set up the ESMFMKFILE global variable with os.environ() function to solve"
1516 "this issue."
1617 )
Original file line number Diff line number Diff line change 33
44import numbers
55import os
6+ import warnings
67
78import numpy as np
89import xarray as xr
910
1011try :
1112 import xesmf as xe
1213except ModuleNotFoundError :
13- raise Warning (
14- "No module named 'ESMF', often due to installation with pip instead of conda for the xesmf lib."
14+ raise warnings . warn (
15+ "Warning: No module named 'ESMF', often due to installation with pip instead of conda for the xesmf lib."
1516 "You can try to manually set up the ESMFMKFILE global variable with os.environ() function to solve"
1617 "this issue."
1718 )
You can’t perform that action at this time.
0 commit comments