Skip to content

07 13 chore lint this project to an inch of its life - #51

Merged
fsargent merged 1 commit into
mainfrom
07-13-chore_lint_this_project_to_an_inch_of_its_life
Jul 13, 2026
Merged

07 13 chore lint this project to an inch of its life#51
fsargent merged 1 commit into
mainfrom
07-13-chore_lint_this_project_to_an_inch_of_its_life

Conversation

@fsargent

@fsargent fsargent commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix IRV ballot tabulation and recalculate the published IRV VSE outputs.
  • Regenerate the IRV simulation pages and chart images.
  • Refresh the project lint/format setup so Trunk runs Ruff and markdownlint cleanly, including explicit imports and focused Ruff rules.

Verification

  • trunk fmt --ci --no-progress --all
  • trunk check --ci --no-progress --all --filter=ruff
  • trunk check --ci --no-progress --all --filter=markdownlint

Summary by CodeRabbit

  • New Features

    • Added reproducible IRV/RCV simulation tooling and refreshed interactive charts, static images, and reported outcomes.
    • Added project configuration for installation, development dependencies, and automated documentation tests.
  • Bug Fixes

    • Corrected tie handling and strategic ballot behavior in several voting methods.
    • Improved IRV result ordering and winner identification.
    • Hardened handling of mismatched ballot and voter data.
  • Documentation

    • Added detailed IRV simulation methodology and results.
    • Reorganized results navigation and updated VSE figures and links.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @fsargent, your pull request is larger than the review limit of 150000 diff characters

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@fsargent, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b5c72373-84be-4a9d-b7ed-64ae9b39ad48

📥 Commits

Reviewing files that changed from the base of the PR and between ec63879 and 80475fd.

⛔ Files ignored due to path filters (5)
  • docs/5vse.png is excluded by !**/*.png
  • docs/5vse_small.png is excluded by !**/*.png
  • docs/vse.png is excluded by !**/*.png
  • docs/vsestrat.png is excluded by !**/*.png
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (22)
  • .trunk/configs/.yamllint.yaml
  • .trunk/configs/ruff.toml
  • .trunk/trunk.yaml
  • dataClasses.py
  • docs/404.html
  • docs/VSEbasic.md
  • docs/index.md
  • docs/irv-simulation.md
  • docs/stratbreakdown.html
  • docs/stratstuff.html
  • docs/vse-graph.html
  • docs/vsebreakdown.html
  • methods.py
  • mise.toml
  • mydecorators.py
  • pyproject.toml
  • scripts/regenerate_pages_images.py
  • sodaTest.py
  • stratFunctions.py
  • tests.py
  • voterModels.py
  • vse.py
📝 Walkthrough

Walkthrough

The PR updates linting and project configuration, modernizes Python imports and argument handling, fixes voting-method behavior, adds deterministic IRV simulation and chart-generation scripts, expands doctest registration, and refreshes published VSE documentation and assets.

Changes

Simulation and voting updates

Layer / File(s) Summary
Tooling and project setup
.trunk/configs/*, .trunk/trunk.yaml, pyproject.toml
Lint rules, Trunk plugins, runtimes, package metadata, development dependencies, and pytest doctest settings are configured.
Module imports and public wiring
dataClasses.py, mydecorators.py, voterModels.py, stratFunctions.py, vse.py, tests.py
Wildcard imports are replaced, compatibility APIs use modern introspection, chooser defaults use None, vse.__all__ is defined, and doctest suites are registered.
Voting method behavior
methods.py
MAV tie scanning, strategic ballot comparison, IRV result ordering, V321 handling, and related method code are updated.
Deterministic simulation and page generation
scripts/recalculate_irv_pages.py, scripts/regenerate_pages_images.py, docs/*
Seeded IRV simulations produce VSE and scenario metrics, which are written into interactive charts and rendered as PNG assets; documentation records the setup and results.
Election count helper corrections
sodaTest.py
Argument binding, cached-property handling, delegation threshold iteration, and Monte Carlo diagnostics are updated.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant recalculate
  participant ProcessPoolExecutor
  participant PageAssets
  CLI->>recalculate: elections, seed, workers
  recalculate->>ProcessPoolExecutor: deterministic chunk jobs
  ProcessPoolExecutor-->>recalculate: VSE and scenario aggregates
  recalculate->>PageAssets: refreshed HTML and PNG chart assets
Loading

Suggested reviewers: jamesonquinn, marcosb, nealmcb

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 48.31% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the changes, but it is too vague and generic to clearly describe the main update. Rename it to something specific, e.g. "chore: tighten lint and update project config".
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-13-chore_lint_this_project_to_an_inch_of_its_life

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.

@fsargent
fsargent changed the base branch from main to codex/fix-irv-tabulation July 13, 2026 20:06
@fsargent
fsargent force-pushed the 07-13-chore_lint_this_project_to_an_inch_of_its_life branch from ec63879 to 01547ed Compare July 13, 2026 20:08
@fsargent
fsargent force-pushed the codex/fix-irv-tabulation branch 3 times, most recently from fb64750 to 755e75a Compare July 13, 2026 20:14

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 11

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
mydecorators.py (1)

166-166: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

curried still uses Python 2 func_codemydecorators.py:166 will raise AttributeError under Python 3.10+. Replace it with self.func.__code__.co_argcount.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@mydecorators.py` at line 166, Update the argument-count check in curried to
use the Python 3 code object attribute self.func.__code__.co_argcount instead of
the obsolete self.func.func_code.co_argcount, preserving the existing comparison
and currying behavior.
🧹 Nitpick comments (7)
sodaTest.py (2)

11-12: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor: unused _varkw and fragile kwargs['exclude'] access.

_varkw is unpacked but never used (F841). Consider using _* or removing it. Additionally, kwargs['exclude'] on line 14 will KeyError if kwargs is non-empty but lacks an 'exclude' key — using kwargs.get('exclude', []) would be more robust.

♻️ Proposed refactor
-        attrs,varargs,_varkw,defaults = spec.args, spec.varargs, spec.varkw, spec.defaults
+        attrs, varargs, _varkw, defaults = spec.args, spec.varargs, spec.varkw, spec.defaults
-            if kwargs and attr in kwargs['exclude']:
+            if kwargs and attr in kwargs.get('exclude', []):
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sodaTest.py` around lines 11 - 12, Update the argument unpacking near
inspect.getfullargspec(func) to avoid binding the unused _varkw value, and
change the kwargs['exclude'] access in the surrounding function to use a default
empty list when the key is absent.

Source: Linters/SAST tools


75-85: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Mutable default cantWin=[] is a latent shared-state bug.

The mutable default cantWin = [] is shared across all calls that don't pass cantWin. Since cantWin is later mutated via .add() (line 282), state can leak between ElectionCounts instances. Ruff flags this as B006. While this appears to be a pre-existing pattern (also on lines 128 and 190), this PR's lint focus makes it worth addressing.

♻️ Proposed fix
-    def __init__(self, delg, appr, prefs, order, cantWin = [], oldSmith = None):
+    def __init__(self, delg, appr, prefs, order, cantWin = None, oldSmith = None):
         """
         delg: A list of n delegation counts
         appr: A list of n approval counts
         prefs: A list of n preference lists counts
         order: delegation order.
         """
+        if cantWin is None:
+            cantWin = []
         self.n = len(delg)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sodaTest.py` around lines 75 - 85, Update the ElectionCounts.__init__
parameter cantWin to avoid a mutable list default, using a None sentinel and
initializing a fresh list inside the constructor when no value is provided.
Preserve caller-supplied cantWin values and apply the same fix to the other
mutable default parameters in the nearby constructors identified by the review.

Source: Linters/SAST tools

voterModels.py (1)

1-1: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Prefer strict=True over strict=False for these equal-length zip calls.

Both sites were updated only to satisfy Ruff's B905 (zip-without-explicit-strict), but both chose the lenient option. Electorate.socUtils assumes every voter has the same number of candidate utilities, and DimVoter.fromDims assumes v, c, e.dimWeights, and caring all share ndims. With strict=False, a length mismatch (e.g. a malformed electorate) would silently truncate and produce a wrong-but-plausible social-utility/candidate-distance result instead of failing loudly.

  • voterModels.py#L125: change zip(*self, strict=False) to zip(*self, strict=True) in Electorate.socUtils.
  • voterModels.py#L235-243: change both zip(caring, e.dimWeights, strict=False) and zip(v,c,e.dimWeights,caring, strict=False) to strict=True in DimVoter.fromDims.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@voterModels.py` at line 1, Update the zip calls in Electorate.socUtils and
DimVoter.fromDims to use strict=True instead of strict=False, preserving loud
failure on mismatched voter, candidate, dimension-weight, or caring-vector
lengths.
.trunk/configs/ruff.toml (1)

2-5: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep B006 enabled

There are several mutable-default sites in the repo (methods.py:getLeast, dataClasses.py:CandidateWithCount.__init__, sodaTest.py:ElectionCounts.__init__, sodaTest.py:beaters, sodaTest.py:growFrom). B006 is still catching a real bug class here, so remove it from ignore only after these are cleaned up; B008/E501 can stay ignored.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.trunk/configs/ruff.toml around lines 2 - 5, The Ruff configuration
currently ignores B006 despite mutable-default issues remaining in
methods.py:getLeast, dataClasses.py:CandidateWithCount.__init__,
sodaTest.py:ElectionCounts.__init__, sodaTest.py:beaters, and
sodaTest.py:growFrom. Clean up those mutable defaults using appropriate per-call
initialization, then remove B006 from the ignore list while keeping B008 and
E501 ignored.
pyproject.toml (1)

12-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

--doctest-modules and load_tests in tests.py will collect the same doctests twice.

addopts = "--doctest-modules" makes pytest scan all Python files for doctests. tests.py:14-22 also adds doctest.DocTestSuite for vse, voterModels, stratFunctions, methods, and dataClasses via the load_tests protocol. The five modules' doctests will execute twice. If load_tests is only for unittest-without-pytest compatibility, consider guarding it with a pytest check or removing it entirely in favor of --doctest-modules.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` around lines 12 - 13, Remove the duplicate doctest collection
by updating the tests.py load_tests integration for vse, voterModels,
stratFunctions, methods, and dataClasses, or guard it when running under pytest;
retain --doctest-modules as the sole pytest collection path while preserving
unittest compatibility if required.
.trunk/trunk.yaml (1)

37-37: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Align the Trunk Python runtime with the supported interpreter range .trunk/trunk.yaml:37 pins python@3.14.4, while pyproject.toml declares requires-python = ">=3.10,<3.13". Use a Python runtime within the supported range (for example, python@3.12.x) so Python-based lint tooling stays aligned with the project matrix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.trunk/trunk.yaml at line 37, Update the Python runtime entry in Trunk’s
configuration from python@3.14.4 to a version within the project’s declared
>=3.10,<3.13 range, such as python@3.12.x, keeping the Python lint tooling
aligned with the supported interpreter matrix.
scripts/regenerate_pages_images.py (1)

183-183: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Useless ternary — both branches yield the same value.

left=0.14 if selected else 0.14 always evaluates to 0.14; simplify.

♻️ Proposed fix
-    figure.subplots_adjust(left=0.14 if selected else 0.14, right=0.80, bottom=0.12, top=0.96)
+    figure.subplots_adjust(left=0.14, right=0.80, bottom=0.12, top=0.96)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/regenerate_pages_images.py` at line 183, In the
figure.subplots_adjust call, simplify the left argument by removing the
redundant conditional expression and use the constant 0.14 directly; leave the
other layout parameters unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@dataClasses.py`:
- Around line 64-68: Update fullSerialize so its try block performs the intended
serialization operation instead of pass, ensuring the method returns the
serialized values and preserves the AttributeError fallback that builds a list
from self.keys(). Verify the Tallies behavior continues to produce [[5], [4],
[3], []].
- Line 4: Remove the test-only import of isnum from dataClasses.py and provide
the helper locally or through an appropriate shared utility module. Update all
isnum usages in dataClasses.py to reference the relocated definition, without
changing its behavior.

In `@docs/vsebreakdown.html`:
- Line 1: Remove the stray “Star” text before the <!doctype html> declaration in
docs/vsebreakdown.html, ensuring the doctype is the first document content so
standards-mode rendering is preserved.

In `@methods.py`:
- Around line 2-8: Update the NumPy imports in methods.py by replacing the
invalid numpy.core.fromqnumeric mean import with mean imported directly from
numpy; leave the other imports unchanged.
- Around line 273-275: Remove the trailing periods from the doctest output
examples associated with Srv().results and the output at the second documented
location, leaving the list values unchanged so doctest comparisons match the
actual returned lists.
- Around line 788-792: Remove the `assert o1s[1] < o1s[2]` statement in the
semifinalist scoring logic, preserving the surrounding
`r2s[semifinalists[o1s[0]]]` adjustment and allowing valid doctest ballots such
as `n1s=[2,1,1]` to proceed without enforcing this invalid ordering invariant.

In `@scripts/regenerate_pages_images.py`:
- Around line 8-20: Move the scripts.recalculate_irv_pages import, including
DEFAULT_WORKERS and recalculate, below the ROOT calculation and sys.path.insert
bootstrap in regenerate_pages_images.py so direct script execution resolves the
module correctly.

In `@sodaTest.py`:
- Around line 316-323: Update the score adjustment in the scores method’s final
loop so the approval value is multiplied by self.n - 1 as a grouped expression,
preserving the existing accumulation behavior for each j.

In `@stratFunctions.py`:
- Line 64: Update the chooser initialization around __init__ so a zero-argument
OssChooser or LazyChooser receives a valid default subChoosers collection before
any dereference. Preserve explicitly provided subChoosers and ensure the
no-argument paths used by dataClasses and vse remain runtime-safe.

In `@voterModels.py`:
- Around line 267-270: Remove the trailing period from the expected output in
the DimModel doctest for dm.dimWeights, leaving the assertion as the list
representation [1, 0.5] so it matches Python repr output.
- Around line 2-8: Update the import block in voterModels.py to import std from
numpy alongside mean, preserving the existing public name used by the module’s
doctests.

---

Outside diff comments:
In `@mydecorators.py`:
- Line 166: Update the argument-count check in curried to use the Python 3 code
object attribute self.func.__code__.co_argcount instead of the obsolete
self.func.func_code.co_argcount, preserving the existing comparison and currying
behavior.

---

Nitpick comments:
In @.trunk/configs/ruff.toml:
- Around line 2-5: The Ruff configuration currently ignores B006 despite
mutable-default issues remaining in methods.py:getLeast,
dataClasses.py:CandidateWithCount.__init__, sodaTest.py:ElectionCounts.__init__,
sodaTest.py:beaters, and sodaTest.py:growFrom. Clean up those mutable defaults
using appropriate per-call initialization, then remove B006 from the ignore list
while keeping B008 and E501 ignored.

In @.trunk/trunk.yaml:
- Line 37: Update the Python runtime entry in Trunk’s configuration from
python@3.14.4 to a version within the project’s declared >=3.10,<3.13 range,
such as python@3.12.x, keeping the Python lint tooling aligned with the
supported interpreter matrix.

In `@pyproject.toml`:
- Around line 12-13: Remove the duplicate doctest collection by updating the
tests.py load_tests integration for vse, voterModels, stratFunctions, methods,
and dataClasses, or guard it when running under pytest; retain --doctest-modules
as the sole pytest collection path while preserving unittest compatibility if
required.

In `@scripts/regenerate_pages_images.py`:
- Line 183: In the figure.subplots_adjust call, simplify the left argument by
removing the redundant conditional expression and use the constant 0.14
directly; leave the other layout parameters unchanged.

In `@sodaTest.py`:
- Around line 11-12: Update the argument unpacking near
inspect.getfullargspec(func) to avoid binding the unused _varkw value, and
change the kwargs['exclude'] access in the surrounding function to use a default
empty list when the key is absent.
- Around line 75-85: Update the ElectionCounts.__init__ parameter cantWin to
avoid a mutable list default, using a None sentinel and initializing a fresh
list inside the constructor when no value is provided. Preserve caller-supplied
cantWin values and apply the same fix to the other mutable default parameters in
the nearby constructors identified by the review.

In `@voterModels.py`:
- Line 1: Update the zip calls in Electorate.socUtils and DimVoter.fromDims to
use strict=True instead of strict=False, preserving loud failure on mismatched
voter, candidate, dimension-weight, or caring-vector lengths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c36090d-2d30-4457-8be7-c578e7b5282e

📥 Commits

Reviewing files that changed from the base of the PR and between 47edbd5 and ec63879.

⛔ Files ignored due to path filters (5)
  • docs/5vse.png is excluded by !**/*.png
  • docs/5vse_small.png is excluded by !**/*.png
  • docs/vse.png is excluded by !**/*.png
  • docs/vsestrat.png is excluded by !**/*.png
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (22)
  • .trunk/configs/.yamllint.yaml
  • .trunk/configs/ruff.toml
  • .trunk/trunk.yaml
  • dataClasses.py
  • docs/404.html
  • docs/VSEbasic.md
  • docs/index.md
  • docs/irv-simulation.md
  • docs/stratbreakdown.html
  • docs/stratstuff.html
  • docs/vse-graph.html
  • docs/vsebreakdown.html
  • methods.py
  • mydecorators.py
  • pyproject.toml
  • scripts/recalculate_irv_pages.py
  • scripts/regenerate_pages_images.py
  • sodaTest.py
  • stratFunctions.py
  • tests.py
  • voterModels.py
  • vse.py

Comment thread dataClasses.py Outdated
Comment thread dataClasses.py
Comment thread docs/vsebreakdown.html Outdated
@@ -1,47 +1,2123 @@
Star<!DOCTYPE html>
Star<!doctype html>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Remove the stray Star prefix before the doctype.

Star becomes visible document content and causes the doctype to be ignored, potentially triggering quirks-mode rendering.

Proposed fix
-Star<!doctype html>
+<!doctype html>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Star<!doctype html>
<!doctype html>
🧰 Tools
🪛 HTMLHint (1.9.2)

[error] 1-1: Doctype must be declared before any non-comment content.

(doctype-first)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/vsebreakdown.html` at line 1, Remove the stray “Star” text before the
<!doctype html> declaration in docs/vsebreakdown.html, ensuring the doctype is
the first document content so standards-mode rendering is preserved.

Source: Linters/SAST tools

Comment thread methods.py
Comment thread methods.py
Comment on lines 273 to 275
>>> Srv().results([[0,4,3,1,2]] * 5 + [[1,4,3,2,1]] * 4 + [[2,3,4,0,1]] * 6)
[1.0666666666666667, 3.6, 3.4, 0.8666666666666667, 1.3333333333333333]
[1.0666666666666667, 3.6, 3.4, 0.8666666666666667, 1.3333333333333333].
"""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

wc -l methods.py
echo '--- lines 260-285 ---'
sed -n '260,285p' methods.py
echo '--- lines 620-640 ---'
sed -n '620,640p' methods.py
echo '--- doctest references ---'
rg -n "doctest|DocTest|__test__|pytest\.doctest|collect" methods.py

Repository: electionscience/vse-sim

Length of output: 2016


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path('methods.py')
text = p.read_text()
for needle in [
    "Srv().results([[0,4,3,1,2]] * 5 + [[1,4,3,2,1]] * 4 + [[2,3,4,0,1]] * 6)",
    "[1.0666666666666667, 3.6, 3.4, 0.8666666666666667, 1.3333333333333333].",
    "[1, 2, 3, 0].",
]:
    print(needle, '=>', needle in text)
PY

Repository: electionscience/vse-sim

Length of output: 344


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n --hidden --glob '!.git' --glob '!node_modules' --glob '!dist' --glob '!build' \
  "doctest|pytest\.mark\.doctest|--doctest|addopts|python -m doctest|DocTestFinder|DocFileSuite" .

Repository: electionscience/vse-sim

Length of output: 995


Remove the trailing periods from these doctest outputs

  • methods.py:273-275: [1.0666666666666667, 3.6, 3.4, 0.8666666666666667, 1.3333333333333333].[1.0666666666666667, 3.6, 3.4, 0.8666666666666667, 1.3333333333333333]
  • methods.py:632-633: [1, 2, 3, 0].[1, 2, 3, 0]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@methods.py` around lines 273 - 275, Remove the trailing periods from the
doctest output examples associated with Srv().results and the output at the
second documented location, leaving the list values unchanged so doctest
comparisons match the actual returned lists.

Comment thread scripts/regenerate_pages_images.py
Comment thread sodaTest.py
Comment thread stratFunctions.py
Comment thread voterModels.py
Comment thread voterModels.py Outdated
@fsargent
fsargent force-pushed the 07-13-chore_lint_this_project_to_an_inch_of_its_life branch 2 times, most recently from 557d975 to bc6ba2d Compare July 13, 2026 20:31
@fsargent
fsargent changed the base branch from codex/fix-irv-tabulation to main July 13, 2026 20:32
@fsargent
fsargent force-pushed the 07-13-chore_lint_this_project_to_an_inch_of_its_life branch from bc6ba2d to dab8178 Compare July 13, 2026 20:33
@fsargent
fsargent force-pushed the 07-13-chore_lint_this_project_to_an_inch_of_its_life branch from dab8178 to 80475fd Compare July 13, 2026 20:33
@fsargent
fsargent merged commit 95cbfef into main Jul 13, 2026
3 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