Conversation
substruct addition
| import networkx as nx | ||
| import numpy as np | ||
| from typing import List, Union | ||
| from typing import Dict, Iterable, List, Optional, Tuple, Union |
Check notice
Code scanning / CodeQL
Unused import Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 16 days ago
To fix the problem, remove the unused Tuple name from the from typing import ... import list while keeping all the other used types. This eliminates the unnecessary dependency on that particular symbol without affecting the rest of the code.
Concretely, in molSimplify/Classes/mol2D.py, on line 4, update the import statement by deleting Tuple from the comma-separated list. No other code changes are required, and no new imports or definitions are needed. The resulting line should import only Dict, Iterable, List, Optional, and Union, which are referenced elsewhere in the file.
| @@ -1,7 +1,7 @@ | ||
| from __future__ import annotations | ||
| import networkx as nx | ||
| import numpy as np | ||
| from typing import Dict, Iterable, List, Optional, Tuple, Union | ||
| from typing import Dict, Iterable, List, Optional, Union | ||
| from packaging import version | ||
| from molSimplify.Classes.globalvars import globalvars | ||
| from molSimplify.Classes.mol3D import mol3D as Mol3D |
| import pickle | ||
|
|
||
|
|
||
| from typing import Callable |
Check notice
Code scanning / CodeQL
Unused import Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 16 days ago
To fix an unused import, the best approach is to delete the import statement when the imported name is not referenced anywhere in the file. This removes an unnecessary dependency and clarifies the module’s requirements without affecting runtime behavior.
Concretely, in molSimplify/Informatics/MOF/MOF_functionalizer_v2.py, remove the line from typing import Callable at line 30. No other code changes are needed, and no additional methods, imports, or definitions are required. This keeps all existing functionality intact while resolving the CodeQL warning.
| @@ -27,8 +27,6 @@ | ||
| import pickle | ||
|
|
||
|
|
||
| from typing import Callable | ||
|
|
||
| try: | ||
| # Python 3.9+ | ||
| from importlib.resources import files as resource_files # type: ignore[attr-defined] |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #529 +/- ##
==========================================
- Coverage 40.60% 40.58% -0.03%
==========================================
Files 93 93
Lines 30036 30077 +41
==========================================
+ Hits 12197 12207 +10
- Misses 17839 17870 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
substruct addition