Esempio n. 1
0
def test_Scale():
    application = Scale(Constant(33, 'widgets'), {'test': 1. / 11}, 'widgets', 'subwigs').test()
    for yearresult in application.push(1000 + np.arange(365), np.random.rand(365)):
        np.testing.assert_equal(yearresult[1], 3)

    def check_units():
        application = Scale(Constant(33, 'widgets'), {'test': 1.8}, 'deg. C', 'deg F.').test()
        for yearresult in application.push(1000 + np.arange(365), np.random.rand(365)):
            return

    np.testing.assert_raises(Exception, check_units)
Esempio n. 2
0
 def check_units():
     application = Scale(Constant(33, 'widgets'), {'test': 1.8}, 'deg. C', 'deg F.').test()
     for yearresult in application.push(1000 + np.arange(365), np.random.rand(365)):
         return