Exemple #1
0
 def test_10(self):
     """Test _parse_float_uncertainty('8', '').........................."""
     answer = nndc._parse_float_uncertainty("8", "")
     assert isinstance(answer, float)
     assert np.isclose(answer, 8.0)
Exemple #2
0
 def test_11(self):
     """Test _parse_float_uncertainty('100.0%', '')....................."""
     answer = nndc._parse_float_uncertainty("100.0%", "")
     assert np.isclose(answer, 100.0)
Exemple #3
0
 def test_08(self):
     """Test _parse_float_uncertainty('257.123', '')...................."""
     answer = nndc._parse_float_uncertainty("257.123", "")
     assert isinstance(answer, float)
     assert np.isclose(answer, 257.123)
Exemple #4
0
 def test_09(self):
     """Test _parse_float_uncertainty('8', '2')........................."""
     answer = nndc._parse_float_uncertainty("8", "2")
     assert np.isclose(answer.nominal_value, 8.0)
     assert np.isclose(answer.std_dev, 2.0)
Exemple #5
0
 def test_05(self):
     """Test _parse_float_uncertainty('257.123E4', '5E3')..............."""
     answer = nndc._parse_float_uncertainty("257.123E4", "5E3")
     assert np.isclose(answer.nominal_value, 2571230.0)
     assert np.isclose(answer.std_dev, 5000.0)
Exemple #6
0
 def test_07(self):
     """Test _parse_float_uncertainty('257.123E+4', '5E-1E-2').........."""
     answer = nndc._parse_float_uncertainty("257.123E+4", "5E-1E-2")
     assert np.isclose(answer.nominal_value, 2571230.0)
     assert np.isclose(answer.std_dev, 0.005)
Exemple #7
0
 def test_20(self):
     """Test _parse_float_uncertainty('7', '@') raises NNDCRequestError."""
     with pytest.raises(nndc.NNDCRequestError):
         nndc._parse_float_uncertainty("7", "@")
Exemple #8
0
 def test_18(self):
     """Test _parse_float_uncertainty('73.92', 'AP')...................."""
     answer = nndc._parse_float_uncertainty('73.92', 'AP')
     assert np.isclose(answer, 73.92)
Exemple #9
0
 def test_17(self):
     """Test _parse_float_uncertainty('1', '****')......................"""
     answer = nndc._parse_float_uncertainty("1", "****")
     assert np.isclose(answer, 1.0)
Exemple #10
0
 def test_19(self):
     """Test _parse_float_uncertainty('73.92', 'CA')...................."""
     answer = nndc._parse_float_uncertainty("73.92", "CA")
     assert np.isclose(answer, 73.92)
Exemple #11
0
 def test_16(self):
     """Test _parse_float_uncertainty('~7', '1')........................"""
     answer = nndc._parse_float_uncertainty("~7", "1")
     assert np.isclose(answer.nominal_value, 7.0)
     assert np.isclose(answer.std_dev, 1.0)
Exemple #12
0
 def test_15(self):
     """Test _parse_float_uncertainty('****', '')......................."""
     answer = nndc._parse_float_uncertainty("****", "")
     assert answer is None
Exemple #13
0
 def test_02(self):
     """Test _parse_float_uncertainty('257.123', '0.015')..............."""
     answer = nndc._parse_float_uncertainty('257.123', '0.015')
     assert np.isclose(answer.nominal_value, 257.123)
     assert np.isclose(answer.std_dev, 0.015)
Exemple #14
0
 def test_12(self):
     """Test _parse_float_uncertainty('73.92+X', '')...................."""
     answer = nndc._parse_float_uncertainty("73.92+X", "")
     assert np.isclose(answer, 73.92)
Exemple #15
0
 def test_04(self):
     """Test _parse_float_uncertainty('257.123E+0', '0.005')............"""
     answer = nndc._parse_float_uncertainty("257.123E+0", "0.005")
     assert np.isclose(answer.nominal_value, 257.123)
     assert np.isclose(answer.std_dev, 0.005)
Exemple #16
0
 def test_13(self):
     """Test _parse_float_uncertainty('Y', '').........................."""
     answer = nndc._parse_float_uncertainty("Y", "")
     assert answer == 0.0
Exemple #17
0
 def test_14(self):
     """Test _parse_float_uncertainty('', '')..........................."""
     answer = nndc._parse_float_uncertainty('', '')
     assert answer is None