@@ -41,6 +41,7 @@ def test_remote_300K():
41
41
assert tbl ['MOLWT' ][0 ] == 18
42
42
assert tbl ['TAG' ][0 ] == 18505
43
43
44
+
44
45
@pytest .mark .remote_data
45
46
def test_co_basics ():
46
47
tbl = CDMS .get_molecule ('028503' )
@@ -49,15 +50,20 @@ def test_co_basics():
49
50
assert tbl ['Q1' ][10 ] == 11
50
51
assert tbl ['Q7' ][10 ] == 10
51
52
assert tbl ['MOLWT' ][0 ] == 28
52
- assert tbl ['TAG' ][0 ] == 28503
53
+ assert tbl ['TAG' ][0 ] == - 28503
53
54
54
55
55
56
@pytest .mark .remote_data
56
57
def test_ch3cn_negqn ():
57
58
tbl = CDMS .get_molecule ('041501' )
58
59
fourtominusthree = tbl [(tbl ['Q1' ] == 4 ) & (tbl ['Q2' ] == - 3 )]
59
60
assert len (fourtominusthree ) >= 1
60
- assert tbl ['TAG' ][0 ] == 41501
61
+
62
+ # check specifically for -21, which is encoded as `b1`
63
+ twentytwominustwentyone = tbl [(tbl ['Q1' ] == 22 ) & (tbl ['Q2' ] == - 21 )]
64
+ assert len (twentytwominustwentyone ) >= 1
65
+
66
+ assert tbl ['TAG' ][0 ] == - 41501
61
67
62
68
63
69
@pytest .mark .remote_data
@@ -103,16 +109,16 @@ def test_molecule_with_parens():
103
109
104
110
MC = np .ma .core .MaskedConstant ()
105
111
106
- for col , val in zip (tbl [0 ].colnames , (232588.7246 , 0.2828 , - 4.1005 , 3 , 293.8540 , 445 , 66 ,
107
- 506 , 303 , 44 , 14 , 30 , MC , MC , MC , 45 , 13 , 33 , MC , MC , MC , 'H2C(CN)2' , False )):
112
+ for col , val in zip (tbl [0 ].colnames , (232588.7246 , 0.2828 , - 4.1005 , 3 , 293.8540 , 445 , 66506 ,
113
+ 303 , 44 , 14 , 30 , MC , MC , MC , 45 , 13 , 33 , MC , MC , MC , 'H2C(CN)2' , 66 , False )):
108
114
if val is MC :
109
115
assert tbl [0 ][col ].mask
110
116
else :
111
117
assert tbl [0 ][col ] == val
112
118
113
119
# this test row includes degeneracy = 1225, which covers one of the weird letter-is-number parser cases
114
- for col , val in zip (tbl [16 ].colnames , (233373.369 , 10.26 , - 4.8704 , 3 , 1229.0674 , 1125 , 66 ,
115
- 506 , 303 , 112 , 10 , 102 , MC , MC , MC , 112 , 9 , 103 , MC , MC , MC , 'H2C(CN)2' , False ),):
120
+ for col , val in zip (tbl [16 ].colnames , (233373.369 , 10.26 , - 4.8704 , 3 , 1229.0674 , 1125 , 66506 ,
121
+ 303 , 112 , 10 , 102 , MC , MC , MC , 112 , 9 , 103 , MC , MC , MC , 'H2C(CN)2' , 66 , False ),):
116
122
if val is MC :
117
123
assert tbl [16 ][col ].mask
118
124
else :
0 commit comments