def test_rad2deg(self): self._test1( np.rad2deg, (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, ), 'degree')
def test_tanh(self): self._test1(np.tanh, (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, ), '') self._test1(np.tanh, (np.rad2deg(np.arange(0, pi/2, pi/4)) * self.ureg.degrees, ), results=(np.tanh(np.arange(0, pi/2, pi/4)), ))
def test_rad2deg(self): self._test1( np.rad2deg, (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, ), 'degree', results=(None, None, np.rad2deg(np.arange(0, pi / 2, pi / 4) * 0.001)))
def test_tanh(self): self._test1( np.tanh, (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, ), '') self._test1( np.tanh, (np.rad2deg(np.arange(0, pi / 2, pi / 4)) * self.ureg.degrees, ), results=(np.tanh(np.arange(0, pi / 2, pi / 4)), ))
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)), ))
def test_arctan2(self): m = self.ureg.m j = self.ureg.J km = self.ureg.km self._test2(np.arctan2, np.arange(0, .9, .1) * m, (np.arange(0, .9, .1) * m, np.arange(.9, 0., -.1) * m, np.arange(0, .9, .1) * km, np.arange(.9, 0., -.1) * km, ), raise_with=np.arange(0, .9, .1) * j, output_units='radian')
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), (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)), ))
def test_arctan2(self): m = self.ureg.m j = self.ureg.J km = self.ureg.km self._test2(np.arctan2, np.arange(0, .9, .1) * m, ( np.arange(0, .9, .1) * m, np.arange(.9, 0., -.1) * m, np.arange(0, .9, .1) * km, np.arange(.9, 0., -.1) * km, ), raise_with=np.arange(0, .9, .1) * j, output_units='radian')
def test_rad2deg(self): self._test1(np.rad2deg, (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, ), 'degree', results=(None, None, np.rad2deg(np.arange(0, pi/2, pi/4)*0.001)))
def test_deg2rad(self): self._test1(np.deg2rad, (np.arange(0, pi/2, pi/4) * self.ureg.degrees, ), (self.ureg.m, ), 'radians')
def test_arctanh(self): self._test1(np.arctanh, (np.arange(0, .9, .1) * self.ureg.dimensionless, np.arange(0, .9, .1) * self.ureg.m / self.ureg.m ), (self.ureg.m, ), 'radian')
def test_arccosh(self): self._test1(np.arccosh, (np.arange(1., 1.9, .1) * self.ureg.dimensionless, np.arange(1., 1.9, .1) * self.ureg.m / self.ureg.m ), (self.ureg.m, ), 'radian')
def test_arccos(self): x = np.arange(0, .9, .1) * self.ureg.m self._test1(np.arccos, (np.arange(0, .9, .1) * self.ureg.dimensionless, np.arange(0, .9, .1) * self.ureg.m / self.ureg.m ), (self.ureg.m, ), 'radian')
def test_rad2deg(self): self._test1(np.rad2deg, (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, ), 'degree')
def test_arccos(self): x = np.arange(0, .9, .1) * self.ureg.m self._test1(np.arccos, (np.arange(0, .9, .1) * self.ureg.dimensionless, np.arange(0, .9, .1) * self.ureg.m / self.ureg.m), (self.ureg.m, ), 'radian')
def test_deg2rad(self): self._test1(np.deg2rad, (np.arange(0, pi / 2, pi / 4) * self.ureg.degrees, ), (self.ureg.m, ), 'radians')
def test_arctanh(self): self._test1(np.arctanh, (np.arange(0, .9, .1) * self.ureg.dimensionless, np.arange(0, .9, .1) * self.ureg.m / self.ureg.m), (self.ureg.m, ), 'radian')
def test_arccosh(self): self._test1(np.arccosh, (np.arange(1., 1.9, .1) * self.ureg.dimensionless, np.arange(1., 1.9, .1) * self.ureg.m / self.ureg.m), (self.ureg.m, ), 'radian')