@@ -95,10 +95,10 @@ def cleanup():
9595def print_title (title , overline = "" , underline = "" ):
9696 len_title = len (title )
9797 if overline :
98- print (str (overline ) * len_title )
99- print (title )
98+ print (str (overline ) * len_title ) # noqa: T201
99+ print (title ) # noqa: T201
100100 if underline :
101- print (str (underline ) * len_title )
101+ print (str (underline ) * len_title ) # noqa: T201
102102
103103
104104def print_compiledir_content ():
@@ -159,7 +159,7 @@ def print_compiledir_content():
159159 _logger .error (f"Could not read key file '{ filename } '." )
160160
161161 print_title (f"PyTensor cache: { compiledir } " , overline = "=" , underline = "=" )
162- print ()
162+ print () # noqa: T201
163163
164164 print_title (f"List of { len (table )} compiled individual ops" , underline = "+" )
165165 print_title (
@@ -168,9 +168,9 @@ def print_compiledir_content():
168168 )
169169 table = sorted (table , key = lambda t : str (t [1 ]))
170170 for dir , op , types , compile_time in table :
171- print (dir , f"{ compile_time :.3f} s" , op , types )
171+ print (dir , f"{ compile_time :.3f} s" , op , types ) # noqa: T201
172172
173- print ()
173+ print () # noqa: T201
174174 print_title (
175175 f"List of { len (table_multiple_ops )} compiled sets of ops" , underline = "+"
176176 )
@@ -180,9 +180,9 @@ def print_compiledir_content():
180180 )
181181 table_multiple_ops = sorted (table_multiple_ops , key = lambda t : (t [1 ], t [2 ]))
182182 for dir , ops_to_str , types_to_str , compile_time in table_multiple_ops :
183- print (dir , f"{ compile_time :.3f} s" , ops_to_str , types_to_str )
183+ print (dir , f"{ compile_time :.3f} s" , ops_to_str , types_to_str ) # noqa: T201
184184
185- print ()
185+ print () # noqa: T201
186186 print_title (
187187 (
188188 f"List of { len (table_op_class )} compiled Op classes and "
@@ -191,33 +191,33 @@ def print_compiledir_content():
191191 underline = "+" ,
192192 )
193193 for op_class , nb in reversed (table_op_class .most_common ()):
194- print (op_class , nb )
194+ print (op_class , nb ) # noqa: T201
195195
196196 if big_key_files :
197197 big_key_files = sorted (big_key_files , key = lambda t : str (t [1 ]))
198198 big_total_size = sum (sz for _ , sz , _ in big_key_files )
199- print (
199+ print ( # noqa: T201
200200 f"There are directories with key files bigger than { int (max_key_file_size )} bytes "
201201 "(they probably contain big tensor constants)"
202202 )
203- print (
203+ print ( # noqa: T201
204204 f"They use { int (big_total_size )} bytes out of { int (total_key_sizes )} (total size "
205205 "used by all key files)"
206206 )
207207
208208 for dir , size , ops in big_key_files :
209- print (dir , size , ops )
209+ print (dir , size , ops ) # noqa: T201
210210
211211 nb_keys = sorted (nb_keys .items ())
212- print ()
212+ print () # noqa: T201
213213 print_title ("Number of keys for a compiled module" , underline = "+" )
214214 print_title (
215215 "number of keys/number of modules with that number of keys" , underline = "-"
216216 )
217217 for n_k , n_m in nb_keys :
218- print (n_k , n_m )
219- print ()
220- print (
218+ print (n_k , n_m ) # noqa: T201
219+ print () # noqa: T201
220+ print ( # noqa: T201
221221 f"Skipped { int (zeros_op )} files that contained 0 op "
222222 "(are they always pytensor.scalar ops?)"
223223 )
@@ -242,18 +242,18 @@ def basecompiledir_ls():
242242 subdirs = sorted (subdirs )
243243 others = sorted (others )
244244
245- print (f"Base compile dir is { config .base_compiledir } " )
246- print ("Sub-directories (possible compile caches):" )
245+ print (f"Base compile dir is { config .base_compiledir } " ) # noqa: T201
246+ print ("Sub-directories (possible compile caches):" ) # noqa: T201
247247 for d in subdirs :
248- print (f" { d } " )
248+ print (f" { d } " ) # noqa: T201
249249 if not subdirs :
250- print (" (None)" )
250+ print (" (None)" ) # noqa: T201
251251
252252 if others :
253- print ()
254- print ("Other files in base_compiledir:" )
253+ print () # noqa: T201
254+ print ("Other files in base_compiledir:" ) # noqa: T201
255255 for f in others :
256- print (f" { f } " )
256+ print (f" { f } " ) # noqa: T201
257257
258258
259259def basecompiledir_purge ():
0 commit comments