Пример #1
0
 def test_003(self):
     c = nemo.Context()
     # Add 25 DR generators so that the abbreviated legend is used.
     for i in range(25):
         dr = nemo.generators.DemandResponse(polygons.wildcard, 100, 0)
         c.generators += [dr]
     print(len(c.generators))
     nemo.run(c)
     utils.plot(c, filename='foo.png')
     os.unlink('foo.png')
Пример #2
0
    def test_002(self):
        """Test 2"""
        c = nemo.Context()
        # Make sure there is unserved energy by setting 2nd and
        # subsequent generator capacity to 0.
        for g in c.generators[1:]:
            g.set_capacity(0)
        nemo.run(c)
        utils.plot(c, filename='foo.png')
        os.unlink('foo.png')
        utils.plot(c, filename='foo.png', spills=True)
        os.unlink('foo.png')

        # Test limiting the x-range.
        xlim = [datetime(2010, 1, 1), datetime(2010, 1, 10)]
        utils.plot(c, filename='foo.png', xlim=xlim)
        os.unlink('foo.png')