@@ -46,23 +46,23 @@ def _image_matches_groups(spec_id: str, library: str, groups: list[dict], spec_l
4646 if not any (v in spec_features for v in values ):
4747 return False
4848 # Impl-level tag filters (issue #2434)
49- elif category == "impl_dep " :
49+ elif category == "dep " :
5050 impl_deps = impl_tags .get ("dependencies" , [])
5151 if not any (v in impl_deps for v in values ):
5252 return False
53- elif category == "impl_tech " :
53+ elif category == "tech " :
5454 impl_techs = impl_tags .get ("techniques" , [])
5555 if not any (v in impl_techs for v in values ):
5656 return False
57- elif category == "impl_pat " :
57+ elif category == "pat " :
5858 impl_pats = impl_tags .get ("patterns" , [])
5959 if not any (v in impl_pats for v in values ):
6060 return False
61- elif category == "impl_prep " :
61+ elif category == "prep " :
6262 impl_preps = impl_tags .get ("dataprep" , [])
6363 if not any (v in impl_preps for v in values ):
6464 return False
65- elif category == "impl_style " :
65+ elif category == "style " :
6666 impl_styles = impl_tags .get ("styling" , [])
6767 if not any (v in impl_styles for v in values ):
6868 return False
@@ -79,11 +79,11 @@ def _calculate_global_counts(all_specs: list) -> dict:
7979 "dom" : {},
8080 "feat" : {},
8181 # Impl-level tag counts (issue #2434)
82- "impl_dep " : {},
83- "impl_tech " : {},
84- "impl_pat " : {},
85- "impl_prep " : {},
86- "impl_style " : {},
82+ "dep " : {},
83+ "tech " : {},
84+ "pat " : {},
85+ "prep " : {},
86+ "style " : {},
8787 }
8888
8989 for spec_obj in all_specs :
@@ -117,15 +117,15 @@ def _calculate_global_counts(all_specs: list) -> dict:
117117 # Count impl-level tags (issue #2434)
118118 impl_tags = impl .impl_tags or {}
119119 for dep in impl_tags .get ("dependencies" , []):
120- global_counts ["impl_dep " ][dep ] = global_counts ["impl_dep " ].get (dep , 0 ) + 1
120+ global_counts ["dep " ][dep ] = global_counts ["dep " ].get (dep , 0 ) + 1
121121 for tech in impl_tags .get ("techniques" , []):
122- global_counts ["impl_tech " ][tech ] = global_counts ["impl_tech " ].get (tech , 0 ) + 1
122+ global_counts ["tech " ][tech ] = global_counts ["tech " ].get (tech , 0 ) + 1
123123 for pat in impl_tags .get ("patterns" , []):
124- global_counts ["impl_pat " ][pat ] = global_counts ["impl_pat " ].get (pat , 0 ) + 1
124+ global_counts ["pat " ][pat ] = global_counts ["pat " ].get (pat , 0 ) + 1
125125 for prep in impl_tags .get ("dataprep" , []):
126- global_counts ["impl_prep " ][prep ] = global_counts ["impl_prep " ].get (prep , 0 ) + 1
126+ global_counts ["prep " ][prep ] = global_counts ["prep " ].get (prep , 0 ) + 1
127127 for style in impl_tags .get ("styling" , []):
128- global_counts ["impl_style " ][style ] = global_counts ["impl_style " ].get (style , 0 ) + 1
128+ global_counts ["style " ][style ] = global_counts ["style " ].get (style , 0 ) + 1
129129
130130 # Sort counts
131131 for category in global_counts :
@@ -144,11 +144,11 @@ def _calculate_contextual_counts(filtered_images: list[dict], spec_id_to_tags: d
144144 "dom" : {},
145145 "feat" : {},
146146 # Impl-level tag counts (issue #2434)
147- "impl_dep " : {},
148- "impl_tech " : {},
149- "impl_pat " : {},
150- "impl_prep " : {},
151- "impl_style " : {},
147+ "dep " : {},
148+ "tech " : {},
149+ "pat " : {},
150+ "prep " : {},
151+ "style " : {},
152152 }
153153
154154 for img in filtered_images :
@@ -178,15 +178,15 @@ def _calculate_contextual_counts(filtered_images: list[dict], spec_id_to_tags: d
178178
179179 # Count impl-level tags (issue #2434)
180180 for dep in impl_tags .get ("dependencies" , []):
181- counts ["impl_dep " ][dep ] = counts ["impl_dep " ].get (dep , 0 ) + 1
181+ counts ["dep " ][dep ] = counts ["dep " ].get (dep , 0 ) + 1
182182 for tech in impl_tags .get ("techniques" , []):
183- counts ["impl_tech " ][tech ] = counts ["impl_tech " ].get (tech , 0 ) + 1
183+ counts ["tech " ][tech ] = counts ["tech " ].get (tech , 0 ) + 1
184184 for pat in impl_tags .get ("patterns" , []):
185- counts ["impl_pat " ][pat ] = counts ["impl_pat " ].get (pat , 0 ) + 1
185+ counts ["pat " ][pat ] = counts ["pat " ].get (pat , 0 ) + 1
186186 for prep in impl_tags .get ("dataprep" , []):
187- counts ["impl_prep " ][prep ] = counts ["impl_prep " ].get (prep , 0 ) + 1
187+ counts ["prep " ][prep ] = counts ["prep " ].get (prep , 0 ) + 1
188188 for style in impl_tags .get ("styling" , []):
189- counts ["impl_style " ][style ] = counts ["impl_style " ].get (style , 0 ) + 1
189+ counts ["style " ][style ] = counts ["style " ].get (style , 0 ) + 1
190190
191191 # Sort counts
192192 for category in counts :
@@ -239,19 +239,19 @@ def _calculate_or_counts(
239239 for v in spec_tags .get ("features" , []):
240240 group_counts [v ] = group_counts .get (v , 0 ) + 1
241241 # Impl-level tag counts (issue #2434)
242- elif category == "impl_dep " :
242+ elif category == "dep " :
243243 for v in impl_tags .get ("dependencies" , []):
244244 group_counts [v ] = group_counts .get (v , 0 ) + 1
245- elif category == "impl_tech " :
245+ elif category == "tech " :
246246 for v in impl_tags .get ("techniques" , []):
247247 group_counts [v ] = group_counts .get (v , 0 ) + 1
248- elif category == "impl_pat " :
248+ elif category == "pat " :
249249 for v in impl_tags .get ("patterns" , []):
250250 group_counts [v ] = group_counts .get (v , 0 ) + 1
251- elif category == "impl_prep " :
251+ elif category == "prep " :
252252 for v in impl_tags .get ("dataprep" , []):
253253 group_counts [v ] = group_counts .get (v , 0 ) + 1
254- elif category == "impl_style " :
254+ elif category == "style " :
255255 for v in impl_tags .get ("styling" , []):
256256 group_counts [v ] = group_counts .get (v , 0 ) + 1
257257
@@ -284,11 +284,11 @@ def _parse_filter_groups(request: Request) -> list[dict]:
284284 "dom" ,
285285 "feat" ,
286286 # Impl-level categories (issue #2434)
287- "impl_dep " ,
288- "impl_tech " ,
289- "impl_pat " ,
290- "impl_prep " ,
291- "impl_style " ,
287+ "dep " ,
288+ "tech " ,
289+ "pat " ,
290+ "prep " ,
291+ "style " ,
292292 )
293293 for key , value in query_params :
294294 if key in valid_categories and value :
@@ -421,11 +421,11 @@ async def get_filtered_plots(request: Request, db: AsyncSession = Depends(requir
421421 - data: Data type tag (numeric, categorical, etc.)
422422 - dom: Domain tag (statistics, finance, etc.)
423423 - feat: Features tag (basic, 3d, interactive, etc.)
424- - impl_dep : Impl dependencies filter (scipy, sklearn, etc.)
425- - impl_tech : Impl techniques filter (twin-axes, colorbar, etc.)
426- - impl_pat : Impl patterns filter (data-generation, etc.)
427- - impl_prep : Impl dataprep filter (kde, binning, etc.)
428- - impl_style : Impl styling filter (publication-ready , etc.)
424+ - dep : Impl dependencies filter (scipy, sklearn, etc.)
425+ - tech : Impl techniques filter (twin-axes, colorbar, etc.)
426+ - pat : Impl patterns filter (data-generation, etc.)
427+ - prep : Impl dataprep filter (kde, binning, etc.)
428+ - style : Impl styling filter (minimal-chrome , etc.)
429429
430430 Returns:
431431 FilteredPlotsResponse with images, counts, and orCounts per group
0 commit comments