Skip to content

Commit

Permalink
unit test boxplot
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhelskens committed Apr 23, 2018
1 parent d3833b0 commit 98831c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion opengrid/library/plotting.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import os
import matplotlib.pyplot as plt
import os
import numpy as np
import pandas as pd
import matplotlib
import pandas as pd
import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from matplotlib.dates import date2num, num2date, HourLocator, DayLocator, AutoDateLocator, DateFormatter
from matplotlib.colors import LogNorm

Expand Down
11 changes: 10 additions & 1 deletion opengrid/tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ def test_default(self):
class CarpetTest(unittest.TestCase):
def test_default(self):
import numpy as np
index = pd.date_range('2015-1-1', '2015-12-31', freq='h')
index = pd.date_range('2015-1-1', '2015-2-1', freq='h')
ser = pd.Series(np.random.normal(size=len(index)), index=index, name='abc')
assert plotting.carpet(ser) is not None

def test_empty(self):
assert plotting.carpet(pd.Series(index=list('abc'))) is None

class BoxplotTest(unittest.TestCase):
def test_default(self):
import numpy as np
import pandas as pd
from opengrid.library import plotting
index = pd.date_range('2015-1-1', '2015-2-1', freq='d')
df = pd.DataFrame(index=index, data=np.random.randint(5, size=(len(index),20)))
plotting.boxplot(df)


if __name__ == '__main__':
unittest.main()

0 comments on commit 98831c8

Please sign in to comment.