Skip to content

Commit

Permalink
Merge pull request klarrieu#9 from OpenTopography/main
Browse files Browse the repository at this point in the history
v1.0.3 updates
  • Loading branch information
klarrieu authored Aug 12, 2022
2 parents a8db6c7 + 6e6134f commit af9fae2
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ authors:
given-names: "Kenneth"
orcid: "https://orcid.org/0000-0003-1706-3879"
title: "RiverREM"
version: 1.0.2
date-released: 2022-08-03
version: 1.0.3
date-released: 2022-08-11
url: "https://github.com/OpenTopography/RiverREM"
2 changes: 1 addition & 1 deletion docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &mdash; RiverREM 1.0.2 documentation</title>
<title>Index &mdash; RiverREM 1.0.3 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Welcome to RiverREM’s documentation! &mdash; RiverREM 1.0.2 documentation</title>
<title>Welcome to RiverREM’s documentation! &mdash; RiverREM 1.0.3 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion docs/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Python Module Index &mdash; RiverREM 1.0.2 documentation</title>
<title>Python Module Index &mdash; RiverREM 1.0.3 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion docs/remindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>REM Module &mdash; RiverREM 1.0.2 documentation</title>
<title>REM Module &mdash; RiverREM 1.0.3 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion docs/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search &mdash; RiverREM 1.0.2 documentation</title>
<title>Search &mdash; RiverREM 1.0.3 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion docs/vizindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DEM Visualization Module &mdash; RiverREM 1.0.2 documentation</title>
<title>DEM Visualization Module &mdash; RiverREM 1.0.3 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand Down
5 changes: 3 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.6
- gdal=3.1.4
- python>=3.6
- gdal>=3.1.4
- conda-forge::osmnx
- dataclasses
- seaborn
- scipy>=1.6.0
- shapely
- pandas
- geopandas
Expand Down
7 changes: 2 additions & 5 deletions riverrem/REMMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from shapely.geometry import box # for cropping centerlines to extent of DEM
from geopandas import clip, read_file
import osmnx # for querying OpenStreetMaps data to get river centerlines
from scipy.spatial import cKDTree as KDTree # for finding nearest neighbors/interpolating
from scipy.spatial import KDTree as KDTree # for finding nearest neighbors/interpolating
from itertools import combinations
import time
from riverrem.RasterViz import RasterViz
Expand Down Expand Up @@ -375,10 +375,7 @@ def interp_river_elev(self):
interpolated_values = np.array([])
for i, chunk in enumerate(np.array_split(c_interpolate, chunk_count)):
logging.info(f"{i / chunk_count * 100:.2f}%")
try: # handle deprecated n_jobs kwarg for older versions of scipy
distances, indices = tree.query(chunk, k=self.k, eps=self.eps, workers=self.workers)
except TypeError:
distances, indices = tree.query(chunk, k=self.k, eps=self.eps, n_jobs=self.workers)
distances, indices = tree.query(chunk, k=self.k, eps=self.eps, workers=self.workers)
# interpolate (IDW with power = 1)
weights = 1 / distances # weight river elevations by 1 / distance
weights = weights / weights.sum(axis=1).reshape(-1, 1) # normalize weights
Expand Down

0 comments on commit af9fae2

Please sign in to comment.