@@ -80,7 +80,7 @@ def time_series(timefile: Path, colnames: List[str]) -> Optional[DataFrame]:
8080 memory_map = True ,
8181 on_bad_lines = "skip" ,
8282 )
83- data = data .apply (pd .to_numeric , raw = True , errors = "coerce" )
83+ data = data .apply (pd .to_numeric , raw = True , errors = "coerce" ) # type: ignore
8484
8585 # detect useless lines produced when run is restarted
8686 rows_to_del = []
@@ -97,7 +97,7 @@ def time_series(timefile: Path, colnames: List[str]) -> Optional[DataFrame]:
9797
9898 ncols = data .shape [1 ]
9999 _tidy_names (colnames , ncols )
100- data .columns = colnames
100+ data .columns = pd . Index ( colnames )
101101
102102 return data
103103
@@ -126,7 +126,7 @@ def time_series_h5(timefile: Path, colnames: List[str]) -> Optional[DataFrame]:
126126 h5names = h5f ["names" ].asstr ()[len (colnames ) + 1 :]
127127 _tidy_names (colnames , ncols , h5names )
128128 data = dset [()]
129- pdf = pd .DataFrame (data [:, 1 :], index = np . int_ ( data [:, 0 ]), columns = colnames )
129+ pdf = pd .DataFrame (data [:, 1 :], index = data [:, 0 ]. astype ( np . int64 ), columns = colnames )
130130 # remove duplicated lines in case of restart
131131 return pdf .loc [~ pdf .index .duplicated (keep = "last" )]
132132
@@ -198,22 +198,22 @@ def rprof(
198198 memory_map = True ,
199199 on_bad_lines = "skip" ,
200200 )
201- data = data .apply (pd .to_numeric , raw = True , errors = "coerce" )
201+ data = data .apply (pd .to_numeric , raw = True , errors = "coerce" ) # type: ignore
202202
203203 isteps = _extract_rsnap_isteps (rproffile , data )
204204
205- data = {}
205+ all_data = {}
206206 for istep , _ , step_df in isteps :
207- step_df .index = range (step_df .shape [0 ]) # check whether necessary
207+ step_df .index = pd . RangeIndex (step_df .shape [0 ]) # check whether necessary
208208 step_cols = list (colnames )
209209 _tidy_names (step_cols , step_df .shape [1 ])
210- step_df .columns = step_cols
211- data [istep ] = step_df
210+ step_df .columns = pd . Index ( step_cols )
211+ all_data [istep ] = step_df
212212
213213 df_times = pd .DataFrame (
214- list (map (itemgetter (1 ), isteps )), index = map (itemgetter (0 ), isteps )
214+ list (map (itemgetter (1 ), isteps )), index = pd . Index ( map (itemgetter (0 ), isteps ) )
215215 )
216- return data , df_times
216+ return all_data , df_times
217217
218218
219219def rprof_h5 (
@@ -250,7 +250,7 @@ def rprof_h5(
250250 isteps .append ((istep , dset .attrs ["time" ]))
251251
252252 df_times = pd .DataFrame (
253- list (map (itemgetter (1 ), isteps )), index = map (itemgetter (0 ), isteps )
253+ list (map (itemgetter (1 ), isteps )), index = pd . Index ( map (itemgetter (0 ), isteps ) )
254254 )
255255 return data , df_times
256256
@@ -297,7 +297,7 @@ def refstate(
297297 memory_map = True ,
298298 on_bad_lines = "skip" ,
299299 )
300- data = data .apply (pd .to_numeric , raw = True , errors = "coerce" )
300+ data = data .apply (pd .to_numeric , raw = True , errors = "coerce" ) # type: ignore
301301 # drop lines corresponding to metadata
302302 data .dropna (subset = [0 ], inplace = True )
303303 isystem = - 1
0 commit comments