Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #695 +/- ##
==========================================
+ Coverage 73.80% 73.97% +0.17%
==========================================
Files 99 101 +2
Lines 27352 27596 +244
Branches 5718 5746 +28
==========================================
+ Hits 20187 20415 +228
- Misses 5738 5745 +7
- Partials 1427 1436 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
8825e9f to
cbec920
Compare
908773e to
0acc5d4
Compare
| # The central C of propane has 2 heavy neighbors → not a clear terminal. | ||
| sp = ARCSpecies(label='propane', smiles='CCC') | ||
| xyz = sp.get_xyz() | ||
| symbols = xyz['symbols'] |
Check notice
Code scanning / CodeQL
Unused local variable Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 15 hours ago
To fix an unused local variable, either remove the assignment if it serves no purpose, or, if it is intentionally unused for documentation or side effects, rename it to something like _ or unused_* while preserving any necessary right-hand side computation. In this specific test, symbols = xyz['symbols'] is not used at all, and computing xyz['symbols'] has no needed side effects, so the best fix is simply to delete this assignment.
Concretely, in arc/job/adapters/ts/linear_utils/local_geometry_test.py, in TestRestoreTerminalHSymmetry.test_skips_non_terminal_centers, remove line 264 that defines symbols. No additional imports or helper methods are required; the rest of the test already operates directly on xyz and sp.mol.
| @@ -261,7 +261,6 @@ | ||
| # The central C of propane has 2 heavy neighbors → not a clear terminal. | ||
| sp = ARCSpecies(label='propane', smiles='CCC') | ||
| xyz = sp.get_xyz() | ||
| symbols = xyz['symbols'] | ||
| # The middle C is the one with 2 C neighbors. | ||
| atom_to_idx = {a: i for i, a in enumerate(sp.mol.atoms)} | ||
| middle_c = None |
| # Place the migrated H so it ends up *closer to a non-acceptor | ||
| # carbon* than its acceptor. S5 must catch this. | ||
| sp = ARCSpecies(label='ccn', smiles='CCN') | ||
| symbols = sp.get_xyz()['symbols'] |
Check notice
Code scanning / CodeQL
Unused local variable Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 15 hours ago
To fix an unused local variable, either remove the assignment if its value and side effects are unnecessary, or rename it to a conventional unused name (such as _ or unused_symbols) if the evaluation is desired but the variable is not read. Here, the test manually defines pre and post geometries and does not use symbols. The sp instance is already created for clarity, and calling sp.get_xyz() is not used elsewhere. The best minimal change without altering behavior is to keep the method call (in case it has benign side effects) but indicate explicitly that the result is unused by renaming the variable to _ (or similar).
Concretely, in arc/job/adapters/ts/linear_utils/local_geometry_test.py, in TestOrientHAwayFromAxis.test_s5_competing_rival_returns_none, change line 645 from:
symbols = sp.get_xyz()['symbols']to:
_ = sp.get_xyz()['symbols']This preserves the evaluation of sp.get_xyz() and the index, while satisfying the CodeQL rule by using a conventional unused-variable name. No new imports or additional methods are needed.
| @@ -642,7 +642,7 @@ | ||
| # Place the migrated H so it ends up *closer to a non-acceptor | ||
| # carbon* than its acceptor. S5 must catch this. | ||
| sp = ARCSpecies(label='ccn', smiles='CCN') | ||
| symbols = sp.get_xyz()['symbols'] | ||
| _ = sp.get_xyz()['symbols'] | ||
| # We don't actually need a chemically sensible geometry here: | ||
| # just one where the post-migration H lands between two heavy | ||
| # atoms that are *both* in the acceptor fragment, with the |
Added a method for generating TS structures from atom mapped reactants and products.
The method works for unimolecular reactions, and at present is only implemented for isomerization reactions.