1616def make_a_tc_report ():
1717 with get_db_client () as db :
1818 from test2text .services .embeddings .embed import embed_requirement
19+
1920 st .header ("Test2Text Report" )
2021
2122 def write_requirements (current_requirements : set [tuple ]):
@@ -27,7 +28,13 @@ def write_requirements(current_requirements: set[tuple]):
2728 with dist :
2829 st .write ("Distance" )
2930
30- for req_id , req_external_id , req_summary , _ , distance in current_requirements :
31+ for (
32+ req_id ,
33+ req_external_id ,
34+ req_summary ,
35+ _ ,
36+ distance ,
37+ ) in current_requirements :
3138 req , summary , dist = st .columns (3 )
3239 with req :
3340 st .write (f"#{ req_id } Requirement { req_external_id } " )
@@ -126,7 +133,10 @@ def write_requirements(current_requirements: set[tuple]):
126133 radius , limit = st .columns (2 )
127134 with radius :
128135 filter_radius = st .number_input (
129- "Insert a radius" , value = 1.00 , step = 0.01 , key = "filter_radius"
136+ "Insert a radius" ,
137+ value = 1.00 ,
138+ step = 0.01 ,
139+ key = "filter_radius" ,
130140 )
131141 st .info ("Max distance to annotation" )
132142 with limit :
@@ -212,7 +222,9 @@ def write_requirements(current_requirements: set[tuple]):
212222 current_reqs = current_annotations .get (
213223 current_annotation , set ()
214224 )
215- current_annotations .update ({current_annotation : current_reqs })
225+ current_annotations .update (
226+ {current_annotation : current_reqs }
227+ )
216228 current_annotations [current_annotation ].add (
217229 (
218230 req_id ,
@@ -262,9 +274,13 @@ def write_requirements(current_requirements: set[tuple]):
262274 with anno :
263275 with st .container (border = True ):
264276 st .write ("Requirements" )
265- st .info ("Found Requirements for chosen annotation" )
277+ st .info (
278+ "Found Requirements for chosen annotation"
279+ )
266280 write_requirements (
267- current_annotations [reqs_by_anno [radio_choice ]]
281+ current_annotations [
282+ reqs_by_anno [radio_choice ]
283+ ]
268284 )
269285 with viz :
270286 with st .container (border = True ):
@@ -285,7 +301,9 @@ def write_requirements(current_requirements: set[tuple]):
285301 if select == "2D" :
286302 plot_2_sets_in_one_2d (
287303 minifold_vectors_2d (annotation_vectors ),
288- minifold_vectors_2d (requirement_vectors ),
304+ minifold_vectors_2d (
305+ requirement_vectors
306+ ),
289307 "Annotation" ,
290308 "Requirements" ,
291309 first_color = "red" ,
0 commit comments