Skip to content

Commit

Permalink
chore[skip ci]: add version warning for shapely.
Browse files Browse the repository at this point in the history
  • Loading branch information
Clarmy committed May 13, 2024
1 parent a2c473e commit 724dd40
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cnmaps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@
import warnings

import cartopy
import shapely
from shapely.errors import ShapelyDeprecationWarning


from .maps import * # noqa: F403, F401
from .drawing import * # noqa: F403, F401

__version__ = "1.1.8"

CARTOPY_DIGIT_VERSION = re.match(r"(\d*\.\d*\.\d*)", cartopy.__version__).group(1)
if CARTOPY_DIGIT_VERSION < "0.22.0":
warnings.warn(("由于Cartopy的版本低于0.22.0, 请将Cartopy的版本升级到0.22.0及以上."))
warnings.warn(("由于Cartopy的版本低于0.22.0, 请将Cartopy的版本升级到0.22.0及以上, 否则会影响功能的使用"))

SHAPELY_DIGIT_VERSION = re.match(r"(\d*\.\d*\.\d*)", shapely.__version__).group(1)
if SHAPELY_DIGIT_VERSION >= "2.0.0":
warnings.warn(("由于Shapely的版本高于2.0.0, 请将Shapely的版本降级到2.0.0以下, 否则会影响功能的使用"))

warnings.filterwarnings("ignore", category=ShapelyDeprecationWarning)

Expand Down

0 comments on commit 724dd40

Please sign in to comment.