Skip to content

Conversation

@rolan701
Copy link
Contributor

new pathway for structgen

Comment on lines +480 to +485


# Main function
# @param args Argument namespace
def main(args=None):
# issue a call to test TF, this is needed to keep

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

Copilot Autofix

AI about 8 hours ago

In general, to fix commented-out code, either (a) fully reinstate it as active code if it is actually needed, or (b) remove it entirely if it is obsolete or intentionally disabled. If the intent is to document example usage, it should be rephrased as a proper comment (possibly with quoting or formatting) rather than raw commented code.

Here, the commented elif branches for 'chainb' and 'autocorr' are clearly non-functional and appear to be obsolete subcommand handlers. Since we should not change existing functionality, the safest choice is to delete these commented-out lines altogether. This maintains current behavior (they were not executed anyway) while resolving the CodeQL warning and improving readability.

Concretely, in molSimplify/__main__.py within the main function’s help-handling block (lines ~505–510), remove the six lines:

        #    elif 'chainb' in args:
        #        parser = argparse.ArgumentParser(description=DescString_chainb)
        #        parseinputs_chainb(parser)
        #    elif 'autocorr' in args:
        #        parser = argparse.ArgumentParser(description=DescString_autocorr)
        #        parseinputs_autocorr(parser)

No new imports, functions, or definitions are required.

Suggested changeset 1
molSimplify/__main__.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/__main__.py b/molSimplify/__main__.py
--- a/molSimplify/__main__.py
+++ b/molSimplify/__main__.py
@@ -502,12 +502,6 @@
         if 'slabgen' in args:
             parser = argparse.ArgumentParser(description=DescString_slabgen)
             parseinputs_slabgen(parser)
-        #    elif 'chainb' in args:
-        #        parser = argparse.ArgumentParser(description=DescString_chainb)
-        #        parseinputs_chainb(parser)
-        #    elif 'autocorr' in args:
-        #        parser = argparse.ArgumentParser(description=DescString_autocorr)
-        #        parseinputs_autocorr(parser)
         elif 'db' in args:
             parser = argparse.ArgumentParser(description=DescString_db)
             parseinputs_db(parser)
EOF
@@ -502,12 +502,6 @@
if 'slabgen' in args:
parser = argparse.ArgumentParser(description=DescString_slabgen)
parseinputs_slabgen(parser)
# elif 'chainb' in args:
# parser = argparse.ArgumentParser(description=DescString_chainb)
# parseinputs_chainb(parser)
# elif 'autocorr' in args:
# parser = argparse.ArgumentParser(description=DescString_autocorr)
# parseinputs_autocorr(parser)
elif 'db' in args:
parser = argparse.ArgumentParser(description=DescString_db)
parseinputs_db(parser)
Copilot is powered by AI and may make mistakes. Always verify output.
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 9.47867% with 191 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.61%. Comparing base (37bc057) to head (4bb9582).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
molSimplify/__main__.py 9.47% 191 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #523      +/-   ##
==========================================
- Coverage   40.64%   40.61%   -0.03%     
==========================================
  Files          93       93              
  Lines       30015    30024       +9     
==========================================
- Hits        12199    12194       -5     
- Misses      17816    17830      +14     
Flag Coverage Δ
unittests 40.61% <9.47%> (-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 1744278 into main Jan 27, 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.

2 participants