Skip to content

Commit

Permalink
Merge pull request #42 from dstansby/numpy-depr
Browse files Browse the repository at this point in the history
Fix numpy deprecation warnings
  • Loading branch information
dstansby authored Oct 2, 2020
2 parents e79dd10 + f7e958e commit b86a1ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ strategy:
#Python37_windows:
# python.version: '3.7'
# vmImage: 'vs2017-win2016'
py36_linux:
python.version: '3.6'
vmImage: 'ubuntu-latest'
py37_linux:
python.version: '3.7'
vmImage: 'ubuntu-latest'
py36_macOS:
vmImage: 'xcode9-macOS10.13'
python.version: '3.6'
py38_linux:
python.version: '3.8'
vmImage: 'ubuntu-latest'
py37_macOS:
vmImage: 'xcode9-macOS10.13'
vmImage: 'macOS-latest'
python.version: '3.7'
py38_macOS:
vmImage: 'macOS-latest'
python.version: '3.8'

pool:
vmImage: '$(vmImage)'
Expand Down
6 changes: 3 additions & 3 deletions streamtracer/streamline.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ def trace(self, seeds, grid, direction=0):
seeds, field, grid_spacing, -1, self.max_steps, cyclic)

# Reduce the size of the arrays, and flip the reverse streamlines
xs_f = np.array([xi[:ni, :] for xi, ni in zip(xs_f, ns_f)])
xs_r = np.array([xi[ni - 1:0:-1, :] for xi, ni in zip(xs_r, ns_r)])
xs_f = [xi[:ni, :] for xi, ni in zip(xs_f, ns_f)]
xs_r = [xi[ni - 1:0:-1, :] for xi, ni in zip(xs_r, ns_r)]

# Stack the forward and reverse arrays
self.xs = np.array([np.vstack([xri, xfi]) for xri, xfi in zip(xs_r, xs_f)])
self.xs = [np.vstack([xri, xfi]) for xri, xfi in zip(xs_r, xs_f)]
self.n_lines = np.fromiter([len(xsi) for xsi in self.xs], int)

self.ROT = np.vstack([ROT_f, ROT_r]).T
Expand Down

0 comments on commit b86a1ab

Please sign in to comment.