@@ -1058,8 +1058,8 @@ def __read_nsx_data_variant_a(self, nsx_nb):
10581058 filename = "." .join ([self ._filenames ["nsx" ], f"ns{ nsx_nb } " ])
10591059
10601060 # get shape of data
1061- shape = (self .__nsx_params ["2.1" ](nsx_nb )["nb_data_points" ], self .__nsx_basic_header [nsx_nb ]["channel_count" ])
1062- offset = self .__nsx_params ["2.1" ](nsx_nb )["bytes_in_headers" ]
1061+ shape = (int ( self .__nsx_params ["2.1" ](nsx_nb )["nb_data_points" ]), int ( self .__nsx_basic_header [nsx_nb ]["channel_count" ]) )
1062+ offset = int ( self .__nsx_params ["2.1" ](nsx_nb )["bytes_in_headers" ])
10631063
10641064 # read nsx data
10651065 # store as dict for compatibility with higher file specs
@@ -1078,10 +1078,10 @@ def __read_nsx_data_variant_b(self, nsx_nb):
10781078 for data_bl in self .__nsx_data_header [nsx_nb ].keys ():
10791079 # get shape and offset of data
10801080 shape = (
1081- self .__nsx_data_header [nsx_nb ][data_bl ]["nb_data_points" ],
1082- self .__nsx_basic_header [nsx_nb ]["channel_count" ],
1081+ int ( self .__nsx_data_header [nsx_nb ][data_bl ]["nb_data_points" ]) ,
1082+ int ( self .__nsx_basic_header [nsx_nb ]["channel_count" ]) ,
10831083 )
1084- offset = self .__nsx_data_header [nsx_nb ][data_bl ]["offset_to_data_block" ]
1084+ offset = int ( self .__nsx_data_header [nsx_nb ][data_bl ]["offset_to_data_block" ])
10851085
10861086 # read data
10871087 data [data_bl ] = np .memmap (filename , dtype = "int16" , shape = shape , offset = offset , mode = "r" )
@@ -1828,7 +1828,7 @@ def __get_file_size(self, filename):
18281828 """
18291829 filebuf = open (filename , "rb" )
18301830 filebuf .seek (0 , os .SEEK_END )
1831- file_size = filebuf .tell ()
1831+ file_size = int ( filebuf .tell () )
18321832 filebuf .close ()
18331833
18341834 return file_size
@@ -2007,8 +2007,8 @@ def __get_nsx_param_variant_a(self, nsx_nb):
20072007
20082008 nsx_parameters = {
20092009 "nb_data_points" : int (
2010- (self .__get_file_size (filename ) - bytes_in_headers )
2011- / (2 * self .__nsx_basic_header [nsx_nb ]["channel_count" ])
2010+ (int ( self .__get_file_size (filename )) - int ( bytes_in_headers ) )
2011+ / int (2 * self .__nsx_basic_header [nsx_nb ]["channel_count" ])
20122012 - 1
20132013 ),
20142014 "labels" : labels ,
0 commit comments