@@ -873,30 +873,26 @@ def __init__(self):
873873 (255 , np .dtype (np .float64 )),
874874 ]
875875 )
876- self .DTYPE_MAP_XML = dict (
877- [
878- (32768 , np .dtype (np .uint8 )), # Keys to GSO
879- (65526 , np .dtype (np .float64 )),
880- (65527 , np .dtype (np .float32 )),
881- (65528 , np .dtype (np .int32 )),
882- (65529 , np .dtype (np .int16 )),
883- (65530 , np .dtype (np .int8 )),
884- ]
885- )
876+ self .DTYPE_MAP_XML = {
877+ 32768 : np .dtype (np .uint8 ), # Keys to GSO
878+ 65526 : np .dtype (np .float64 ),
879+ 65527 : np .dtype (np .float32 ),
880+ 65528 : np .dtype (np .int32 ),
881+ 65529 : np .dtype (np .int16 ),
882+ 65530 : np .dtype (np .int8 ),
883+ }
886884 # error: Argument 1 to "list" has incompatible type "str";
887885 # expected "Iterable[int]" [arg-type]
888886 self .TYPE_MAP = list (range (251 )) + list ("bhlfd" ) # type: ignore[arg-type]
889- self .TYPE_MAP_XML = dict (
890- [
891- # Not really a Q, unclear how to handle byteswap
892- (32768 , "Q" ),
893- (65526 , "d" ),
894- (65527 , "f" ),
895- (65528 , "l" ),
896- (65529 , "h" ),
897- (65530 , "b" ),
898- ]
899- )
887+ self .TYPE_MAP_XML = {
888+ # Not really a Q, unclear how to handle byteswap
889+ 32768 : "Q" ,
890+ 65526 : "d" ,
891+ 65527 : "f" ,
892+ 65528 : "l" ,
893+ 65529 : "h" ,
894+ 65530 : "b" ,
895+ }
900896 # NOTE: technically, some of these are wrong. there are more numbers
901897 # that can be represented. it's the 27 ABOVE and BELOW the max listed
902898 # numeric data type in [U] 12.2.2 of the 11.2 manual
@@ -3138,24 +3134,22 @@ def _write_map(self) -> None:
31383134 all blocks have been written.
31393135 """
31403136 if not self ._map :
3141- self ._map = dict (
3142- (
3143- ("stata_data" , 0 ),
3144- ("map" , self .handles .handle .tell ()),
3145- ("variable_types" , 0 ),
3146- ("varnames" , 0 ),
3147- ("sortlist" , 0 ),
3148- ("formats" , 0 ),
3149- ("value_label_names" , 0 ),
3150- ("variable_labels" , 0 ),
3151- ("characteristics" , 0 ),
3152- ("data" , 0 ),
3153- ("strls" , 0 ),
3154- ("value_labels" , 0 ),
3155- ("stata_data_close" , 0 ),
3156- ("end-of-file" , 0 ),
3157- )
3158- )
3137+ self ._map = {
3138+ "stata_data" : 0 ,
3139+ "map" : self .handles .handle .tell (),
3140+ "variable_types" : 0 ,
3141+ "varnames" : 0 ,
3142+ "sortlist" : 0 ,
3143+ "formats" : 0 ,
3144+ "value_label_names" : 0 ,
3145+ "variable_labels" : 0 ,
3146+ "characteristics" : 0 ,
3147+ "data" : 0 ,
3148+ "strls" : 0 ,
3149+ "value_labels" : 0 ,
3150+ "stata_data_close" : 0 ,
3151+ "end-of-file" : 0 ,
3152+ }
31593153 # Move to start of map
31603154 self .handles .handle .seek (self ._map ["map" ])
31613155 bio = BytesIO ()
0 commit comments