Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelClerx committed Aug 15, 2023
1 parent 69012df commit fe47cc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions nevis/_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class linear_interpolant(object):
def __init__(self, grad=False):
self._heights = nevis.gb()
self._resolution = nevis.spacing()
self.grad = grad
self._grad = grad

def __call__(self, x, y):
ny, nx = self._heights.shape
Expand Down Expand Up @@ -78,7 +78,7 @@ def __call__(self, x, y):

# Final result
f = float(np.where(f1 == f2, f1, (y2 - y) * f1 + (y - y1) * f2))
if self.grad:
if self._grad:
# Gradient of the interpolant
g = (h21 - h11) / self._resolution, (h12 - h11) / self._resolution
return f, g
Expand Down
5 changes: 2 additions & 3 deletions nevis/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
"""
import timeit

from pykml.factory import KML_ElementMaker as KML
from lxml import etree

import nevis


Expand Down Expand Up @@ -146,6 +143,8 @@ def generate_kml(path, labels=None, trajectory=None, points=None,):
``lables``, ``trajectory``, and ``points`` can be used simultaneously.
"""
from pykml.factory import KML_ElementMaker as KML
from lxml import etree

def make_coords(x, y):
"""
Expand Down

0 comments on commit fe47cc1

Please sign in to comment.