How to use the pint.compat.np.arange function in Pint

To help you get started, we’ve selected a few Pint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hgrecco / pint / pint / testsuite / test_umath.py View on Github external
def test_cosh(self):
        self._test1(np.cosh, (np.arange(0, pi/2, pi/4) * self.ureg.dimensionless,
                              np.arange(0, pi/2, pi/4) * self.ureg.radian,
                              np.arange(0, pi/2, pi/4) * self.ureg.mm / self.ureg.m
                             ), (1*self.ureg.m, ), '', results=(None, None, np.cosh(np.arange(0, pi/2, pi/4)*0.001)))
        self._test1(np.cosh, (np.rad2deg(np.arange(0, pi/2, pi/4)) * self.ureg.degrees,
                             ), results=(np.cosh(np.arange(0, pi/2, pi/4)), ))
github hgrecco / pint / pint / testsuite / test_umath.py View on Github external
def test_cosh(self):
        self._test1(np.cosh, (np.arange(0, pi/2, pi/4) * self.ureg.dimensionless,
                              np.arange(0, pi/2, pi/4) * self.ureg.radian,
                              np.arange(0, pi/2, pi/4) * self.ureg.mm / self.ureg.m
                             ), (self.ureg.m, ), '', results=(None, None, np.cosh(np.arange(0, pi/2, pi/4)*0.001)))
        self._test1(np.cosh, (np.rad2deg(np.arange(0, pi/2, pi/4)) * self.ureg.degrees,
                             ), results=(np.cosh(np.arange(0, pi/2, pi/4)), ))
github hgrecco / pint / pint / testsuite / test_quantity.py View on Github external
def test_gt_zero_NP(self):
        ureg = self.ureg
        ureg.autoconvert_offset_to_baseunit = False
        qpos = ureg.Quantity(5, 'J')
        qneg = ureg.Quantity(-5, 'J')
        aeq = np.testing.assert_array_equal
        aeq(qpos > np.zeros(3), np.asarray([True, True, True]))
        aeq(qneg > np.zeros(3), np.asarray([False, False, False]))
        aeq(ureg.Quantity(np.arange(-1, 2), ureg.J) > np.zeros(3),
            np.asarray([False, False, True]))
        aeq(ureg.Quantity(np.arange(-1, 2), ureg.J) > np.zeros(3),
            np.asarray([False, False, True]))
        self.assertRaises(ValueError,
                          ureg.Quantity(np.arange(-1, 2), ureg.J).__gt__,
                          np.zeros(4))
github hgrecco / pint / pint / testsuite / test_umath.py View on Github external
def test_sinh(self):
        self._test1(np.sinh, (np.arange(0, pi/2, pi/4) * self.ureg.dimensionless,
                              np.arange(0, pi/2, pi/4) * self.ureg.radian,
                              np.arange(0, pi/2, pi/4) * self.ureg.mm / self.ureg.m
                              ), (1*self.ureg.m, ), '', results=(None, None, np.sinh(np.arange(0, pi/2, pi/4)*0.001)))
        self._test1(np.sinh, (np.rad2deg(np.arange(0, pi/2, pi/4)) * self.ureg.degrees,
                              ), results=(np.sinh(np.arange(0, pi/2, pi/4)), ))
github hgrecco / pint / pint / testsuite / test_umath.py View on Github external
def test_tan(self):
        self._test1(np.tan, (np.arange(0, pi/2, pi/4) * self.ureg.dimensionless,
                             np.arange(0, pi/2, pi/4) * self.ureg.radian,
                             np.arange(0, pi/2, pi/4) * self.ureg.mm / self.ureg.m
                            ), (1*self.ureg.m, ), '', results=(None, None, np.tan(np.arange(0, pi/2, pi/4)*0.001)))
        self._test1(np.tan, (np.rad2deg(np.arange(0, pi/2, pi/4)) * self.ureg.degrees,
                            ), results=(np.tan(np.arange(0, pi/2, pi/4)), ))
github hgrecco / pint / pint / testsuite / test_umath.py View on Github external
def test_cos(self):
        self._test1(np.cos, (np.arange(0, pi/2, pi/4) * self.ureg.dimensionless,
                             np.arange(0, pi/2, pi/4) * self.ureg.radian,
                             np.arange(0, pi/2, pi/4) * self.ureg.mm / self.ureg.m,
                            ), (self.ureg.m, ), '',
                    results=(None,
                             None,
                             np.cos(np.arange(0, pi/2, pi/4)*0.001),
                    )
        )
        self._test1(np.cos,
                    (np.rad2deg(np.arange(0, pi/2, pi/4)) * self.ureg.degrees,
                     ),
                    results=(np.cos(np.arange(0, pi/2, pi/4)), )
        )
github hgrecco / pint / pint / testsuite / test_umath.py View on Github external
def test_sin(self):
        self._test1(np.sin, (np.arange(0, pi/2, pi/4) * self.ureg.dimensionless,
                             np.arange(0, pi/2, pi/4) * self.ureg.radian,
                             np.arange(0, pi/2, pi/4) * self.ureg.mm / self.ureg.m
                            ), (1*self.ureg.m, ), '', results=(None, None, np.sin(np.arange(0, pi/2, pi/4)*0.001)))
        self._test1(np.sin, (np.rad2deg(np.arange(0, pi/2, pi/4)) * self.ureg.degrees,
                            ), results=(np.sin(np.arange(0, pi/2, pi/4)), ))
github hgrecco / pint / pint / testsuite / test_umath.py View on Github external
def test_sin(self):
        self._test1(np.sin, (np.arange(0, pi/2, pi/4) * self.ureg.dimensionless,
                             np.arange(0, pi/2, pi/4) * self.ureg.radian,
                             np.arange(0, pi/2, pi/4) * self.ureg.mm / self.ureg.m
                            ), (1*self.ureg.m, ), '', results=(None, None, np.sin(np.arange(0, pi/2, pi/4)*0.001)))
        self._test1(np.sin, (np.rad2deg(np.arange(0, pi/2, pi/4)) * self.ureg.degrees,
                            ), results=(np.sin(np.arange(0, pi/2, pi/4)), ))
github hgrecco / pint / pint / testsuite / test_umath.py View on Github external
def test_deg2rad(self):
        self._test1(np.deg2rad, (np.arange(0, pi/2, pi/4) * self.ureg.degrees,
                                 ), (self.ureg.m, ), 'radians')