Skip to content

Commit

Permalink
refactor(distutils): Version classes are deprecated, use internal cla…
Browse files Browse the repository at this point in the history
…ss (#1331)
  • Loading branch information
mwtoews authored Jan 21, 2022
1 parent dced106 commit 7ec884f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions flopy/export/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,10 @@ def initialize_geometry(self):
needed for the netcdf file
"""
pyproj = import_optional_dependency("pyproj")
from distutils.version import LooseVersion
from ..utils.parse_version import Version

# Check if using newer pyproj version conventions
pyproj220 = LooseVersion(pyproj.__version__) >= LooseVersion("2.2.0")
pyproj220 = Version(pyproj.__version__) >= Version("2.2.0")

proj4_str = self.proj4_str
print(f"initialize_geometry::proj4_str = {proj4_str}")
Expand Down
8 changes: 4 additions & 4 deletions flopy/utils/gridintersect.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import numpy as np
import contextlib
import warnings
from distutils.version import LooseVersion

from .utl_import import import_optional_dependency

from .geometry import transform
from .geospatial_utils import GeoSpatialUtil
from .parse_version import Version

NUMPY_GE_121 = str(np.__version__) >= LooseVersion("1.21")
NUMPY_GE_121 = Version(np.__version__) >= Version("1.21")

shapely = import_optional_dependency("shapely", errors="silent")
if shapely is not None:
SHAPELY_GE_20 = str(shapely.__version__) >= LooseVersion("2.0")
SHAPELY_LT_18 = str(shapely.__version__) < LooseVersion("1.8")
SHAPELY_GE_20 = Version(shapely.__version__) >= Version("2.0")
SHAPELY_LT_18 = Version(shapely.__version__) < Version("1.8")
else:
SHAPELY_GE_20 = False
SHAPELY_LT_18 = False
Expand Down

0 comments on commit 7ec884f

Please sign in to comment.