From 1d233068d162fae92cdc74ce0079f3264ac2dd04 Mon Sep 17 00:00:00 2001 From: Paul Hobson Date: Fri, 25 Oct 2024 15:24:55 -0700 Subject: [PATCH] fix last call to missing dist function --- .travis.yml | 47 -------------------------------- pygridgen/boundary_interactor.py | 8 ++---- 2 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 99fa3bf..0000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -language: python - -matrix: - include: - - python: 2.7 - env: - - COVERAGE=false - - ARGS="" - - python: 3.5 - env: - - COVERAGE=false - - ARGS="" - - python: 3.6 - env: - - COVERAGE=false - - ARGS="" - - python: 3.7 - language: python - sudo: required - dist: xenial - env: - - COVERAGE=true - - ARGS="--strict" - -before_install: - - sudo apt-get update -yq - - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - - chmod +x miniconda.sh - - ./miniconda.sh -b -p $HOME/miniconda - - export PATH=$HOME/miniconda/bin:$PATH - - conda update --yes conda - - conda install --yes nomkl - -install: - - conda create --yes --channel=conda-forge --name=test python=$TRAVIS_PYTHON_VERSION nomkl gridgen numpy matplotlib pyproj pytest pytest-pep8 coverage docopt requests pyyaml - - source activate test - - pip install coveralls - - pip install -e . - -script: - - coverage run --source pygridgen check_pygridgen.py ${ARGS} - -after_success: - - if [ ${COVERAGE} = true ]; then - coverage report -m; - coveralls; - fi diff --git a/pygridgen/boundary_interactor.py b/pygridgen/boundary_interactor.py index 41ac0fd..32a601f 100644 --- a/pygridgen/boundary_interactor.py +++ b/pygridgen/boundary_interactor.py @@ -1,12 +1,8 @@ -try: - import cPickle as pickle -except ImportError: - import pickle +import pickle from copy import deepcopy import numpy as np -from numpy import dist from matplotlib import pyplot from matplotlib.artist import Artist from matplotlib.patches import Polygon @@ -33,7 +29,7 @@ def dist_point_to_segment(p, s0, s1): c1 = np.dot(w, v) if c1 <= 0: - return dist(p, s0) + return np.hypot(p, s0) c2 = np.dot(v, v) if c2 <= c1: