Skip to content

Clean package-source Ruff static-analysis findings #606

Description

@shawcharles

I noticed a small set of package-source Ruff/static-analysis findings that can be cleaned without changing public API or estimator behaviour.

Current prepared scope:

  • declare the ResolvedSurveyDesign forward reference in diff_diff/bootstrap_utils.py under TYPE_CHECKING, removing the package F821 failures;
  • remove three no-placeholder f-strings in diff_diff/power.py;
  • remove an invalid # noqa: WPS433 marker in diff_diff/spillover.py that Ruff warns about because WPS433 is not a configured Ruff rule;
  • remove audited unused locals reported as F841 where the value has no downstream use.

Explicitly out of scope:

  • no public API re-export cleanup;
  • no TROP import-order / E402 changes;
  • no broad import sorting;
  • no honest_did.py mathematical variable renames for E741;
  • no CI gate.

Validation run locally:

  • python -m ruff check diff_diff --select F821,F541,F841,W --output-format=concise
  • python3.9 -m py_compile over the touched source files
  • PYTHONPATH=. DIFF_DIFF_BACKEND=python pytest tests/test_bootstrap_utils.py tests/test_bootstrap_chunking.py -q
  • PYTHONPATH=. DIFF_DIFF_BACKEND=python pytest tests/test_power.py tests/test_methodology_power.py tests/test_spillover.py tests/test_honest_did.py tests/test_methodology_honest_did.py tests/test_imputation.py tests/test_methodology_imputation.py tests/test_prep_dgp_reversible.py tests/test_staggered_rc.py tests/test_staggered.py tests/test_chaisemartin_dhaultfoeuille.py tests/test_dcdh_heterogeneity_cell_period_coverage.py -q

Would you accept a narrow PR with that boundary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions