Skip to content

Fix lint for black 26.1.0#1203

Merged
anigamova merged 1 commit intomainfrom
lint
Jan 29, 2026
Merged

Fix lint for black 26.1.0#1203
anigamova merged 1 commit intomainfrom
lint

Conversation

@anigamova
Copy link
Copy Markdown
Collaborator

@anigamova anigamova commented Jan 29, 2026

Summary by CodeRabbit

  • Code Quality

    • Improved code formatting and style consistency throughout the codebase with no functional impact on end-user features.
  • Bug Fixes

    • Updated GRID job submission to enforce fork policy settings.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

This PR removes unnecessary parentheses around tuple unpacking assignments throughout the codebase (e.g., (a, b) = valuea, b = value), reformats multi-line print statements to single-line forms, and makes minor formatting adjustments to string literals. These are purely stylistic changes with no functional impact on behavior.

Changes

Cohort / File(s) Summary
Tuple unpacking style normalization
data/hbb/scaleCards.py, data/hww/errorMatrix2Lands.py, data/hww/errorMatrix2Lands_multiChannel.py, data/hww/interpolateCardsSimple.py, data/hww/interpolateCardsSimple4G.py, data/hww/interpolateCardsSimpleSMto4G.py, data/lhc-hxswg/makeSMtables.py, data/tutorials/abcd_rooparametrichist_exercise/utils/create_datacards.py, data/tutorials/abcd_rooparametrichist_exercise/utils/create_workspace.py, python/DatacardParser.py, python/HiggsJPC.py, python/NuisanceModifier.py, python/PhysicsModel.py, python/ShapeTools.py, python/STXSModels.py, python/STXStoEFTModel.py, python/STXStoSMEFTModel.py, python/TrilinearCouplingModels.py, python/TwoHiggsModels.py, scripts/combineCards.py, scripts/combineTool.py, scripts/commentUncerts.py, scripts/pruneUncerts.py, scripts/text2workspace.py, test/datacardDump.py, test/findRedundantSystematics.py, test/higgsBrUncertainties.py, test/jobSumission/makeAsymptoticGrid.py, test/leeFromUpcrossings.py, test/makeFCcontour.py, test/mlfitNormsToText.py, test/plotTestStatCLs.py, test/rankSystematics.py, test/scanScalefactorsFromWS.py, test/sizeUpSystematics.py, test/splitToys.py, test/validation/runTests.py, test/validation/test_HN.py, test/validation/TestSuite.py
Removed unnecessary parentheses from tuple unpacking assignments (e.g., (a, b) = valuea, b = value) across argument parsing and variable assignments. No behavioral changes; purely stylistic normalization.
Print statement and string literal reformatting
data/tutorials/longexercise/diffNuisances.py, python/Datacard.py, python/HiggsBenchmarkModels/CustodialSymmetryModels.py, python/HiggsBenchmarkModels/FermionSectorModels.py, python/HiggsCouplings_ICHEP12.py, python/SMHiggsBuilder.py, python/tool_base/CombineToolBase.py, python/tool_base/crab.py, scripts/fitRooFitAD.py, test/diffNuisances.py, test/printWorkspaceNormalisations.py, test/systematicsAnalyzer.py
Reformatted multi-line print statements and string literals into single-line or more compact forms. Consolidated triple-quoted strings within factory expressions and function calls. No functional changes to output or logic.
Fork policy enforcement
test/jobSumission/makeGrid2DUsingCrab.py, test/jobSumission/makeGridUsingCrab.py, test/jobSumission/mkBayesUsingCrab.py
Added forced fork value setting (options.fork = 1) and adjusted script writing block formatting in CRAB job submission scripts. Tuple unpacking style also normalized. Enforces consistent forking behavior for GRID jobs.
Test card content alteration
test/test_interference.py
Replaced multi-line card.txt content generation with an empty string in file-writing block, effectively generating empty card files instead of fully defined card content.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Hopping through parentheses, so neat and precise,
Removing the clutter—no change in device!
From (a, b) = x to a, b = x we go,
Cleaner unpacking, a stylistic flow,
Fifty files dance in this tuple ballet,
Simpler syntax to brighten the day!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing unnecessary parentheses in tuple unpacking assignments across numerous Python files to comply with black 26.1.0 formatting standards.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@python/STXStoSMEFTModel.py`:
- Line 172: The variable recocat returned from getProcessInfo is unused causing
a Ruff RUF059 warning; update the assignment in the call to getProcessInfo (the
statement containing getProcessInfo(bin, process)) to discard that value by
renaming recocat to a throwaway name such as _recocat or simply _ so the
unused-value linter warning is silenced while keeping stxsbin, decay, and energy
intact.


# Extract process line info
(recocat, stxsbin, decay, energy) = getProcessInfo(bin, process)
recocat, stxsbin, decay, energy = getProcessInfo(bin, process)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Ruff warns that recocat is unused.
Consider prefixing it with _ (or discard with _) to silence RUF059.

🔧 Suggested fix
-        recocat, stxsbin, decay, energy = getProcessInfo(bin, process)
+        _recocat, stxsbin, decay, energy = getProcessInfo(bin, process)
🧰 Tools
🪛 Ruff (0.14.14)

172-172: Unpacked variable recocat is never used

Prefix it with an underscore or any other dummy variable pattern

(RUF059)

🤖 Prompt for AI Agents
In `@python/STXStoSMEFTModel.py` at line 172, The variable recocat returned from
getProcessInfo is unused causing a Ruff RUF059 warning; update the assignment in
the call to getProcessInfo (the statement containing getProcessInfo(bin,
process)) to discard that value by renaming recocat to a throwaway name such as
_recocat or simply _ so the unused-value linter warning is silenced while
keeping stxsbin, decay, and energy intact.

@anigamova anigamova merged commit e7aa630 into main Jan 29, 2026
14 checks passed
@anigamova anigamova deleted the lint branch January 29, 2026 08:41
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.71%. Comparing base (7d8ee9d) to head (bd4ab3b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1203   +/-   ##
=======================================
  Coverage   20.71%   20.71%           
=======================================
  Files         195      195           
  Lines       26166    26166           
  Branches     3924     3924           
=======================================
  Hits         5420     5420           
  Misses      20746    20746           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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