Skip to content

Commit b358d22

Browse files
authored
Merge pull request Kaggle#601 from marketneutral/master
Add bqplot and qgrid
2 parents d31b5f2 + bc6b2d1 commit b358d22

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ RUN pip install flashtext && \
487487
pip install osmnx && \
488488
apt-get -y install libspatialindex-dev && \
489489
pip install pytorch-ignite && \
490+
pip install qgrid && \
491+
pip install bqplot && \
490492
/tmp/clean-layer.sh
491493

492494
# Tesseract and some associated utility packages

tests/qgrid.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import unittest
2+
import pandas as pd
3+
from qgrid import QgridWidget
4+
5+
class TestQgrid(unittest.TestCase):
6+
def test_nans():
7+
df = pd.DataFrame([(pd.Timestamp('2017-02-02'), np.nan),
8+
(4, 2),
9+
('foo', 'bar')])
10+
view = QgridWidget(df=df)
11+
view._handle_qgrid_msg_helper({
12+
'type': 'change_sort',
13+
'sort_field': 1,
14+
'sort_ascending': True
15+
})

tests/test_bqplot.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import unittest
2+
import numpy as np
3+
import bqplot.pyplot as plt
4+
5+
class TestBqplot(unittest.TestCase):
6+
def test_figure(self):
7+
size = 100
8+
scale = 100.0
9+
np.random.seed(0)
10+
x_data = np.arange(size)
11+
y_data = np.cumsum(np.random.randn(size) * scale)
12+
fig = plt.figure(title='First Example')
13+
plt.plot(y_data)
14+
fig.save_png()

0 commit comments

Comments
 (0)