From 2d1b5fa7f58ab5dabca2698482125bf9d1036050 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 21 Oct 2025 17:40:24 +0000 Subject: [PATCH 1/2] Update performance test results [skip ci] --- performance.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/performance.md b/performance.md index 5c551d9..bbeb953 100644 --- a/performance.md +++ b/performance.md @@ -1,9 +1,9 @@ # VFBquery Performance Test Results -**Test Date:** 2025-10-21 17:38:40 UTC -**Git Commit:** 92d798acf78d6f2e28fda943a831718308e92efd +**Test Date:** 2025-10-21 17:40:24 UTC +**Git Commit:** 2ffd914e2fdaf1792536bcb9fb735bec0598ef52 **Branch:** dev -**Workflow Run:** 18692555570 +**Workflow Run:** 18692600043 ## Test Overview @@ -25,11 +25,11 @@ This performance test measures the execution time of VFB term info queries for s ✅ **Test Status**: Performance test completed -- **FBbt_00003748 Query Time**: 1.5398 seconds -- **VFB_00101567 Query Time**: 1.5656 seconds -- **Total Query Time**: 3.1054 seconds +- **FBbt_00003748 Query Time**: 1.6001 seconds +- **VFB_00101567 Query Time**: 1.4338 seconds +- **Total Query Time**: 3.0339 seconds 🎉 **Result**: All performance thresholds met! --- -*Last updated: 2025-10-21 17:38:40 UTC* +*Last updated: 2025-10-21 17:40:24 UTC* From 7a3ec748ad2bc5198b8be0aa554ccb81477f916b Mon Sep 17 00:00:00 2001 From: Rob Court Date: Tue, 21 Oct 2025 19:54:50 +0100 Subject: [PATCH 2/2] Refine markdown link encoding and enhance label formatting to prefer symbols over labels for templates and anatomy --- src/vfbquery/vfb_queries.py | 41 ++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/vfbquery/vfb_queries.py b/src/vfbquery/vfb_queries.py index e055de5..b3158ac 100644 --- a/src/vfbquery/vfb_queries.py +++ b/src/vfbquery/vfb_queries.py @@ -323,7 +323,8 @@ def encode_brackets(text): def encode_markdown_links(df, columns): """ - Encodes brackets in the labels and titles within markdown links and images, leaving the link syntax intact. + Encodes brackets in the labels within markdown links, leaving the link syntax intact. + Does NOT encode alt text in linked images ([![...](...)(...)] format). :param df: DataFrame containing the query results. :param columns: List of column names to apply encoding to. """ @@ -332,28 +333,10 @@ def encode_label(label): return label try: - # Process linked images (format: [![alt text](image_url "title")](link)) + # Skip linked images (format: [![alt text](image_url "title")](link)) + # These should NOT be encoded if label.startswith("[!["): - # Split into image part and link part - parts = label.split(")](") - if len(parts) < 2: - return label - - image_part = parts[0] - link_part = parts[1] - - # Process the image part - image_parts = image_part.split("](") - if len(image_parts) < 2: - return label - - alt_text = image_parts[0][3:] # Remove the "[![" prefix - # Encode brackets in alt text - alt_text_encoded = encode_brackets(alt_text) - - # Reconstruct the linked image with encoded alt text - encoded_label = f"[![{alt_text_encoded}]({image_parts[1]})]({link_part}" - return encoded_label + return label # Process regular markdown links elif label.startswith("[") and "](" in label: @@ -1067,9 +1050,16 @@ def _get_instances_from_solr(short_form: str, return_dataframe=True, limit: int # Format thumbnail with proper markdown link (matching Neo4j format) thumbnail = '' if thumbnail_url and template_anatomy: + # Prefer symbol over label for template (matching Neo4j behavior) template_label = template_anatomy.get('label', '') + if template_anatomy.get('symbol') and len(template_anatomy.get('symbol', '')) > 0: + template_label = template_anatomy.get('symbol') template_short_form = template_anatomy.get('short_form', '') + + # Prefer symbol over label for anatomy (matching Neo4j behavior) anatomy_label = anatomy.get('label', '') + if anatomy.get('symbol') and len(anatomy.get('symbol', '')) > 0: + anatomy_label = anatomy.get('symbol') anatomy_short_form = anatomy.get('short_form', '') if template_label and anatomy_label: @@ -1082,13 +1072,18 @@ def _get_instances_from_solr(short_form: str, return_dataframe=True, limit: int # Format template information template_formatted = '' if template_anatomy: + # Prefer symbol over label (matching Neo4j behavior) template_label = template_anatomy.get('label', '') + if template_anatomy.get('symbol') and len(template_anatomy.get('symbol', '')) > 0: + template_label = template_anatomy.get('symbol') template_short_form = template_anatomy.get('short_form', '') if template_label and template_short_form: template_formatted = f"[{template_label}]({template_short_form})" - # Handle label formatting (match Neo4j format) + # Handle label formatting (match Neo4j format - prefer symbol over label) anatomy_label = anatomy.get('label', 'Unknown') + if anatomy.get('symbol') and len(anatomy.get('symbol', '')) > 0: + anatomy_label = anatomy.get('symbol') anatomy_short_form = anatomy.get('short_form', '') row = {