Skip to content

Switch from black to ruff format#577

Merged
MaxGhenis merged 1 commit intomainfrom
switch-to-ruff-format
Mar 6, 2026
Merged

Switch from black to ruff format#577
MaxGhenis merged 1 commit intomainfrom
switch-to-ruff-format

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • Replace black with ruff>=0.9.0 in dev dependencies
  • Remove [tool.black] section from pyproject.toml (use ruff defaults, line-length 88)
  • Update Makefile format target: black . -l 79 -> ruff format .
  • Update CI lint workflow to use ruff format --check . instead of the black-action
  • Reformat all files with ruff format
  • Add changelog fragment

Test plan

  • ruff format --check . passes (all 153 files formatted)
  • CI lint workflow passes with the new ruff check

🤖 Generated with Claude Code

Replace black with ruff as the code formatter across pyproject.toml,
Makefile, and CI workflows. Reformat all files with ruff defaults.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MaxGhenis MaxGhenis merged commit 21e8e9a into main Mar 6, 2026
6 checks passed
@MaxGhenis MaxGhenis deleted the switch-to-ruff-format branch March 6, 2026 13:31
baogorek added a commit that referenced this pull request Mar 6, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Mar 6, 2026
* Fix enhanced CPS OOM by using half-sample ExtendedCPS

The switch from CPS_2024 (frac=0.5) to CPS_2024_Full (frac=1) in commit
1e8d6e1 doubled the household count to 111k, making the 2913-column
calibration loss matrix 2.6 GB and causing OOM on 28 GB machines.

- Add ExtendedCPS_2024_Half using CPS_2024 (frac=0.5) with its own H5
- Point EnhancedCPS_2024 at the half-sample input (~56k households)
- Free loss_matrix and sim objects earlier in the calibration pipeline
- Convert loss matrix to float32 before reweighting

The full ExtendedCPS_2024 (111k households) is preserved unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Widen poverty rate test threshold to 30% and reformat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Reformat with ruff (CI switched from black to ruff in #577)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix CI checkpoint cache invalidation on code changes

Scope checkpoint paths by commit SHA so new commits rebuild from scratch
instead of restoring stale H5 files from previous builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Cache get_current_commit() and move gc import to top-level

- Add @functools.cache to avoid repeated subprocess calls for the same
  commit SHA during a single build (~10+ calls reduced to 1)
- Move inline `import gc` to top of loss.py for consistency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Max Ghenis <mghenis@gmail.com>
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