Skip to content

Commit

Permalink
Merge 3d0a445 into 2e85035
Browse files Browse the repository at this point in the history
  • Loading branch information
corranwebster committed Dec 19, 2014
2 parents 2e85035 + 3d0a445 commit 8616dc0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -2,6 +2,9 @@ language: python
python:
- '2.7_with_system_site_packages'
- 2.6
- 3.2
- 3.3
- 3.4
before_install:
- sudo apt-get update
- sudo apt-get install python-numpy swig
Expand All @@ -16,6 +19,7 @@ script:
- if [[ $TRAVIS_PYTHON_VERSION == *_with_system_site_packages ]]; then ETS_TOOLKIT='wx' coverage run -p -m nose.core -v chaco; fi
- if [[ $TRAVIS_PYTHON_VERSION == *_with_system_site_packages ]]; then coverage combine; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then coverage run -m nose.core -v chaco/tests; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.* ]]; then ETS_TOOLKIT='qt4' coverage run -p -m nose.core -v chaco; fi
notifications:
email:
- travis-ci@enthought.com
Expand Down
7 changes: 5 additions & 2 deletions chaco/base.py
Expand Up @@ -2,6 +2,8 @@
Defines basic traits and functions for the data model.
"""

from __future__ import division

# Standard library imports
from math import radians, sqrt

Expand Down Expand Up @@ -69,7 +71,8 @@ def bin_search(values, value, ascending):
array value is the last value less (greater) than the desired value.
Returns -1 if *value* is beyond the minimum or maximum of *values*.
"""
if ascending > 0:
ascending = ascending > 0
if ascending:
if (value < values[0]) or (value > values[-1]):
return -1
else:
Expand All @@ -82,7 +85,7 @@ def bin_search(values, value, ascending):
midval = values[ mid ]
if midval == value:
return mid
elif midval > value:
elif (ascending and midval > value) or (not ascending and midval < value):
hi = mid
else:
lo = mid
Expand Down
11 changes: 5 additions & 6 deletions dev_requirements.txt
@@ -1,8 +1,7 @@
--allow-external PIL
--allow-unverified PIL
PIL
pillow
unittest2
coverage
-e git+http://github.com/enthought/traits.git#egg=traits
-e git+http://github.com/enthought/traitsui.git#egg=traitsui
-e git+http://github.com/enthought/enable.git#egg=enable
-e git+https://github.com/enthought/traits.git#egg=traits
-e git+https://github.com/pradyun/pyface.git@python3#egg=pyface
-e git+https://github.com/pradyun/traitsui.git@python3#egg=traitsui
-e git+https://github.com/pradyun/enable.git@python3#egg=enable

0 comments on commit 8616dc0

Please sign in to comment.