diff --git a/.travis.yml b/.travis.yml index edc88f3..5ebc3a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ install: - conda create -q -n test-environment python=$PYTHON pip nose - source activate test-environment - if [[ "$SHAPELY" == "true" ]]; then - conda install numpy scipy shapely fiona matplotlib; + conda install numpy scipy pandas shapely fiona matplotlib; fi - python -m pip install flake8 - python setup.py install diff --git a/cesiumpy/plotting/tests/test_plotting.py b/cesiumpy/plotting/tests/test_plotting.py index d203356..c06800e 100644 --- a/cesiumpy/plotting/tests/test_plotting.py +++ b/cesiumpy/plotting/tests/test_plotting.py @@ -5,7 +5,8 @@ import unittest import cesiumpy -from cesiumpy.testing import _skip_if_no_numpy, _skip_if_no_matplotlib +from cesiumpy.testing import (_skip_if_no_numpy, _skip_if_no_pandas, + _skip_if_no_matplotlib) class TestScatter(unittest.TestCase): @@ -120,6 +121,42 @@ def test_scatter_errors(self): with nose.tools.assert_raises_regexp(ValueError, msg): v.plot.scatter([130, 140, 150], [30, 40, 50], size=[1, 2]) + def test_scatter_pandas(self): + _skip_if_no_pandas() + import pandas as pd + df = pd.DataFrame({'lon': [130, 140, 150], + 'lat': [50, 60, 70], + 'r': [10, 20, 30], + 'c': ['r', 'g', 'b']}) + # we can't use size column + v = cesiumpy.Viewer(divid='viewertest') + v.plot.scatter(x=df.lon, y=df.lat, size=df.r) + exp = """ + +