예제 #1
0
    def test_cfunits2pint(self, pr_series):
        u = cfunits2pint(pr_series([1, 2]))
        assert (str(u)) == 'kilogram / meter ** 2 / second'
        assert pint2cfunits(u) == 'kg m-2 s-1'

        u = cfunits2pint('m^3 s-1')
        assert str(u) == 'meter ** 3 / second'
        assert pint2cfunits(u) == 'm^3 s-1'
예제 #2
0
    def test_cfunits2pint(self, pr_series):
        u = units2pint(pr_series([1, 2]))
        assert (str(u)) == "kilogram / meter ** 2 / second"
        assert pint2cfunits(u) == "kg m-2 s-1"

        u = units2pint("m^3 s-1")
        assert str(u) == "meter ** 3 / second"
        assert pint2cfunits(u) == "m^3 s-1"
예제 #3
0
    def test_pint2cfunits(self):
        u = units("mm/d")
        assert pint2cfunits(u.units) == "mm d-1"

        u = units("percent")
        assert pint2cfunits(u.units) == "%"

        u = units("pct")
        assert pint2cfunits(u.units) == "%"
예제 #4
0
 def test_pint2cfunits(self):
     u = units('mm/d')
     assert pint2cfunits(u.units) == 'mm d-1'
예제 #5
0
파일: test_utils.py 프로젝트: gacou54/xclim
 def test_pint2cfunits(self):
     u = units("mm/d")
     assert pint2cfunits(u.units) == "mm d-1"