Skip to content

Comments

Update mol2D.py#529

Merged
rolan701 merged 6 commits intomainfrom
rolan701-patch-25
Feb 9, 2026
Merged

Update mol2D.py#529
rolan701 merged 6 commits intomainfrom
rolan701-patch-25

Conversation

@rolan701
Copy link
Contributor

@rolan701 rolan701 commented Feb 9, 2026

substruct addition

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

Import of 'Tuple' is not used.

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.

Suggested changeset 1
molSimplify/Classes/mol2D.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/molSimplify/Classes/mol2D.py b/molSimplify/Classes/mol2D.py
--- a/molSimplify/Classes/mol2D.py
+++ b/molSimplify/Classes/mol2D.py
@@ -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
EOF
@@ -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
Copilot is powered by AI and may make mistakes. Always verify output.
import pickle


from typing import Callable

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Callable' is not used.

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.

Suggested changeset 1
molSimplify/Informatics/MOF/MOF_functionalizer_v2.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/molSimplify/Informatics/MOF/MOF_functionalizer_v2.py b/molSimplify/Informatics/MOF/MOF_functionalizer_v2.py
--- a/molSimplify/Informatics/MOF/MOF_functionalizer_v2.py
+++ b/molSimplify/Informatics/MOF/MOF_functionalizer_v2.py
@@ -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]
EOF
@@ -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]
Copilot is powered by AI and may make mistakes. Always verify output.
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 27.27273% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.58%. Comparing base (039ae99) to head (d4dab2f).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
molSimplify/Classes/mol2D.py 12.12% 29 Missing ⚠️
...lSimplify/Informatics/MOF/MOF_functionalizer_v2.py 72.72% 3 Missing ⚠️
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     
Flag Coverage Δ
unittests 40.58% <27.27%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rolan701 rolan701 merged commit fcabb4e into main Feb 9, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant