From 71ba37bd628ac78306429f9ad32cce8588ca5c21 Mon Sep 17 00:00:00 2001 From: jayh Date: Sun, 4 Sep 2022 15:31:43 -0400 Subject: [PATCH 1/2] update install instructions --- docs/source/gallery/dong2022.ipynb | 2 +- docs/source/gallery/dong2022.rst | 2 +- docs/source/gallery/hariharan2022.ipynb | 2 +- docs/source/gallery/hariharan2022.rst | 2 +- docs/source/gallery/knights2020.ipynb | 2 +- docs/source/gallery/knights2020.rst | 2 +- docs/source/gallery/konkol2022.ipynb | 2 +- docs/source/gallery/konkol2022.rst | 2 +- docs/source/gallery/tejedor2022.ipynb | 2 +- docs/source/gallery/tejedor2022.rst | 2 +- docs/source/install/index.rst | 8 +++++--- 11 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/source/gallery/dong2022.ipynb b/docs/source/gallery/dong2022.ipynb index 26774fc..91a08d6 100644 --- a/docs/source/gallery/dong2022.ipynb +++ b/docs/source/gallery/dong2022.ipynb @@ -46,7 +46,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.1" + "version": "3.10.4" } }, "nbformat": 4, diff --git a/docs/source/gallery/dong2022.rst b/docs/source/gallery/dong2022.rst index c466e82..a7d864f 100644 --- a/docs/source/gallery/dong2022.rst +++ b/docs/source/gallery/dong2022.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "gallery\dong2022.py" +.. "gallery/dong2022.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html diff --git a/docs/source/gallery/hariharan2022.ipynb b/docs/source/gallery/hariharan2022.ipynb index ba1d725..0e48b09 100644 --- a/docs/source/gallery/hariharan2022.ipynb +++ b/docs/source/gallery/hariharan2022.ipynb @@ -46,7 +46,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.1" + "version": "3.10.4" } }, "nbformat": 4, diff --git a/docs/source/gallery/hariharan2022.rst b/docs/source/gallery/hariharan2022.rst index 5dde4b8..833e088 100644 --- a/docs/source/gallery/hariharan2022.rst +++ b/docs/source/gallery/hariharan2022.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "gallery\hariharan2022.py" +.. "gallery/hariharan2022.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html diff --git a/docs/source/gallery/knights2020.ipynb b/docs/source/gallery/knights2020.ipynb index 0c43be3..4996a01 100644 --- a/docs/source/gallery/knights2020.ipynb +++ b/docs/source/gallery/knights2020.ipynb @@ -46,7 +46,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.1" + "version": "3.10.4" } }, "nbformat": 4, diff --git a/docs/source/gallery/knights2020.rst b/docs/source/gallery/knights2020.rst index 28de201..1317d28 100644 --- a/docs/source/gallery/knights2020.rst +++ b/docs/source/gallery/knights2020.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "gallery\knights2020.py" +.. "gallery/knights2020.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html diff --git a/docs/source/gallery/konkol2022.ipynb b/docs/source/gallery/konkol2022.ipynb index 66ace4a..405b8d6 100644 --- a/docs/source/gallery/konkol2022.ipynb +++ b/docs/source/gallery/konkol2022.ipynb @@ -46,7 +46,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.1" + "version": "3.10.4" } }, "nbformat": 4, diff --git a/docs/source/gallery/konkol2022.rst b/docs/source/gallery/konkol2022.rst index 7e6e034..c2b9c58 100644 --- a/docs/source/gallery/konkol2022.rst +++ b/docs/source/gallery/konkol2022.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "gallery\konkol2022.py" +.. "gallery/konkol2022.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html diff --git a/docs/source/gallery/tejedor2022.ipynb b/docs/source/gallery/tejedor2022.ipynb index 339d0e9..4892fa9 100644 --- a/docs/source/gallery/tejedor2022.ipynb +++ b/docs/source/gallery/tejedor2022.ipynb @@ -46,7 +46,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.1" + "version": "3.10.4" } }, "nbformat": 4, diff --git a/docs/source/gallery/tejedor2022.rst b/docs/source/gallery/tejedor2022.rst index c91bced..1b306f4 100644 --- a/docs/source/gallery/tejedor2022.rst +++ b/docs/source/gallery/tejedor2022.rst @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "gallery\tejedor2022.py" +.. "gallery/tejedor2022.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index da784cb..57c10b4 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -12,7 +12,7 @@ Installation Instructions Installation via *conda* -------------------------- -The latest 'stable' version of *RivGraph* can be installed via `conda`. +The latest 'stable' version of *RivGraph* can be installed via `conda`; as of this writing we have tested this installation process for Python versions 3.9.x and 3.7.13 (per `issue 83 `_). We recommend installing *RivGraph* into a fresh conda environment to minimize the risk of dependency clashes. The easiest way to do this is by opening Terminal (Mac/Unix) or Anaconda Prompt (Windows) and typing: :: @@ -27,8 +27,10 @@ If you would rather install *RivGraph* into a pre-existing environment "myenv", .. warning:: - *RivGraph* dependencies may be pinned to specific versions of packages (e.g. geopandas 0.7) that may not mesh with your existing environment. - Check the `environment file `_ for these cases. + *RivGraph* dependencies may be pinned to specific versions of packages that may not mesh with your existing environment. + Check the `environment file `_ for these cases. + If you are having trouble getting the environment to resolve, or it is taking a very long time, consider using *mamba* + as a drop-in replacement for *conda* (see `mamba docs `_). Installation from source ------------------------ From 91549f7df601002022d765d688531a979eacb816 Mon Sep 17 00:00:00 2001 From: jayh Date: Sun, 4 Sep 2022 15:31:54 -0400 Subject: [PATCH 2/2] scipy deprecation --- rivgraph/classes.py | 2 +- rivgraph/deltas/delta_directionality.py | 2 +- rivgraph/im_utils.py | 2 +- rivgraph/mask_utils.py | 2 +- rivgraph/rivers/river_utils.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rivgraph/classes.py b/rivgraph/classes.py index b8ac831..58ac398 100644 --- a/rivgraph/classes.py +++ b/rivgraph/classes.py @@ -15,7 +15,7 @@ import numpy as np import networkx as nx from pyproj.crs import CRS -from scipy.ndimage.morphology import distance_transform_edt +from scipy.ndimage import distance_transform_edt from matplotlib import pyplot as plt import geopandas as gpd from shapely.geometry import LineString diff --git a/rivgraph/deltas/delta_directionality.py b/rivgraph/deltas/delta_directionality.py index 67e153a..e347441 100644 --- a/rivgraph/deltas/delta_directionality.py +++ b/rivgraph/deltas/delta_directionality.py @@ -15,7 +15,7 @@ from scipy.stats import mode, linregress from scipy.interpolate import interp1d from scipy.spatial import ConvexHull -from scipy.ndimage.morphology import distance_transform_edt +from scipy.ndimage import distance_transform_edt import rivgraph.io_utils as io import rivgraph.directionality as dy diff --git a/rivgraph/im_utils.py b/rivgraph/im_utils.py index a74f98c..8b2f8f0 100644 --- a/rivgraph/im_utils.py +++ b/rivgraph/im_utils.py @@ -892,7 +892,7 @@ def fill_holes(I, maxholesize=0): I = np.array(I, dtype=bool) if maxholesize == 0: - I = nd.morphology.binary_fill_holes(I) + I = nd.binary_fill_holes(I) return I else: # Fill only holes less than maxholesize diff --git a/rivgraph/mask_utils.py b/rivgraph/mask_utils.py index ba67d02..6bb9870 100644 --- a/rivgraph/mask_utils.py +++ b/rivgraph/mask_utils.py @@ -14,7 +14,7 @@ import geopandas as gpd import rivgraph.im_utils as iu import rivgraph.geo_utils as gu -from scipy.ndimage.morphology import distance_transform_edt +from scipy.ndimage import distance_transform_edt from shapely.geometry import Polygon from shapely.ops import cascaded_union from scipy import stats diff --git a/rivgraph/rivers/river_utils.py b/rivgraph/rivers/river_utils.py index 129141c..06b3b1d 100644 --- a/rivgraph/rivers/river_utils.py +++ b/rivgraph/rivers/river_utils.py @@ -10,7 +10,7 @@ import numpy as np import networkx as nx from fastdtw import fastdtw -from scipy.ndimage.morphology import distance_transform_edt +from scipy.ndimage import distance_transform_edt import shapely from shapely.geometry import LineString, Polygon from scipy import signal @@ -641,7 +641,7 @@ def get_transect_indices_along_buffered_lines(cl, mapper): pts[i] = idxlist return pts - + def get_transect_endpoints_xy(lpts, rpts): """