
import unittest


class PlotStyleTest(unittest.TestCase):
    def test_default(self):
        from opengrid.library.plotting import plot_style
        plt = plot_style()


class CarpetTest(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-12-31', freq='h')
        ser = pd.Series(np.random.normal(size=len(index)), index=index, name='abc')
        plotting.carpet(ser)


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


import unittest
import pandas as pd
from opengrid.library import plotting


class PlotStyleTest(unittest.TestCase):
    def test_default(self):
        plt = plotting.plot_style()


class CarpetTest(unittest.TestCase):
    def test_default(self):
        import numpy as np
        index = pd.date_range('2015-1-1', '2015-12-31', 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


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

Resolve RuntimeError: Invalid DISPLAY variable - tst
[BLD] Resolve RuntimeError: Invalid DISPLAY variable - tst

  
  import unittest
+ import pandas as pd
+ from opengrid.library import plotting
  
  
  class PlotStyleTest(unittest.TestCase):
      def test_default(self):
-         from opengrid.library.plotting import plot_style
-         plt = plot_style()
+         plt = plotting.plot_style()
  
  
  class CarpetTest(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-12-31', freq='h')
          ser = pd.Series(np.random.normal(size=len(index)), index=index, name='abc')
-         plotting.carpet(ser)
+         assert plotting.carpet(ser) is not None
+ 
+     def test_empty(self):
+         assert plotting.carpet(pd.Series(index=list('abc'))) is None
  
  
  if __name__ == '__main__':
      unittest.main()
  
Resolve RuntimeError: Invalid DISPLAY variable - tst
## Code Before:

import unittest


class PlotStyleTest(unittest.TestCase):
    def test_default(self):
        from opengrid.library.plotting import plot_style
        plt = plot_style()


class CarpetTest(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-12-31', freq='h')
        ser = pd.Series(np.random.normal(size=len(index)), index=index, name='abc')
        plotting.carpet(ser)


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

## Instruction:
Resolve RuntimeError: Invalid DISPLAY variable - tst
## Code After:

import unittest
import pandas as pd
from opengrid.library import plotting


class PlotStyleTest(unittest.TestCase):
    def test_default(self):
        plt = plotting.plot_style()


class CarpetTest(unittest.TestCase):
    def test_default(self):
        import numpy as np
        index = pd.date_range('2015-1-1', '2015-12-31', 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


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