From 034beb010ad4926fb6dfc4d6ba240f32c375f10d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 17:55:25 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A7=B9=20[code=20health=20improvement?= =?UTF-8?q?]=20Refactor=20FIXME=20and=20dead=20code=20in=20analyzeSBML.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Extracted magic number 4 into `max_modification_distance`. - Changed FIXME comment to a TODO as it documents a heuristic improvement opportunity. - Removed unused `score = difflib.ndiff(...)` variable. - Simplified `winner` list comprehension logic to `min(scores, key=lambda x: x[1])[0]`. Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com> --- bionetgen/atomizer/atomizer/analyzeSBML.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bionetgen/atomizer/atomizer/analyzeSBML.py b/bionetgen/atomizer/atomizer/analyzeSBML.py index 928d3bc4..b9eab4b5 100644 --- a/bionetgen/atomizer/atomizer/analyzeSBML.py +++ b/bionetgen/atomizer/atomizer/analyzeSBML.py @@ -283,7 +283,6 @@ def analyzeSpeciesModification(self, baseElement, modifiedElement, partialAnalys distance = self.distanceToModification( particle, comparisonElement, translationKeys[0] ) - score = difflib.ndiff(particle, modifiedElement) else: # FIXME: make sure we only do a search on those variables that are viable # candidates. this is once again fuzzy string matchign. there should @@ -299,15 +298,14 @@ def analyzeSpeciesModification(self, baseElement, modifiedElement, partialAnalys distance = self.distanceToModification( particle, comparisonElement, translationKeys[0] ) - score = difflib.ndiff(particle, modifiedElement) - # FIXME:tis is just an ad-hoc parameter in terms of how far a mod is from a species name + # TODO: 4 is just an ad-hoc parameter in terms of how far a mod is from a species name # use something better - if distance < 4: + + max_modification_distance = 4 + if distance < max_modification_distance: scores.append([particle, distance]) if len(scores) > 0: - winner = scores[[x[1] for x in scores].index(min([x[1] for x in scores]))][ - 0 - ] + winner = min(scores, key=lambda x: x[1])[0] else: winner = None if winner: From e1c0255cef58a0b861c256947555afa2a8f28299 Mon Sep 17 00:00:00 2001 From: akutuva21 Date: Mon, 13 Apr 2026 10:16:52 -0400 Subject: [PATCH 2/2] chore: PR #55 remove forbidden artifacts and run black --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 39aa9026..f9bf9c80 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ temp_testing/* build dist Issues/rule_keywords/test_DeleteMolecules_changed.bngl +.jules/ +__pycache__/