Skip to content

Conversation

@paulQM
Copy link
Collaborator

@paulQM paulQM commented Jan 12, 2026

NOTE:

This node is not on main, but has been reviewed and is functioning well

Fix pylint errors for CZ conditional phase error amplification calibration

Summary

This PR fixes all pylint errors in the CZ conditional phase error amplification calibration module to ensure pre-commit checks pass.

Changes Made

1. calibration_utils/cz_conditional_phase_error_amp/analysis.py

  • ✅ Added missing module docstring
  • ✅ Refactored _fit_full_amp() function to reduce argument count (6 → 4) by combining smooth_rows_sigma and smooth_cols_sigma into a smooth_config dictionary parameter
  • ✅ Simplified boolean comparisons:
    • n == 0not n
    • denom != 0denom

2. calibration_utils/cz_conditional_phase_error_amp/__init__.py

  • ✅ Added missing module docstring

3. calibration_utils/cz_conditional_phase_error_amp/parameters.py

  • ✅ Added missing module docstring
  • ✅ Added class docstrings for NodeSpecificParameters and Parameters
  • ✅ Fixed long lines (135/120 and 126/120 chars) by breaking docstrings across multiple lines

4. calibration_utils/cz_conditional_phase_error_amp/plotting.py

  • ✅ Added missing module docstring

5. calibrations/CZ_calibration_fixed_couplers/20b_cz_conditional_phase_error_amp.py

  • ✅ Added missing module docstring (placed before # %% comment for pylint compliance)
  • ✅ Added function docstrings for custom_param() and save_results()
  • ✅ Simplified boolean comparison: (n_op & 1) == 0not (n_op & 1)
  • ✅ Added # pylint: disable=too-many-statements for create_qua_program() function (complex QUA program generation that is difficult to refactor)
  • ✅ Fixed long lines in description docstring by breaking them across multiple lines

Testing

  • ✅ All pylint checks now pass
  • ✅ Pre-commit hooks pass successfully
  • ✅ No functional changes - only code quality improvements

Notes

  • The _fit_full_amp() function signature change is backward compatible as the new smooth_config parameter has a default value that matches the previous behavior
  • The create_qua_program() function was marked with a pylint disable comment rather than refactored, as it's a complex QUA program generation function that would require significant restructuring

Copy link

@sebastianorbell-qm sebastianorbell-qm left a comment

Choose a reason for hiding this comment

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

All good

@paulQM paulQM merged commit 6faef51 into KAVR_12182025 Jan 13, 2026
3 checks passed
@paulQM paulQM deleted the chore/styx-precommit-CZ-error-amp branch January 13, 2026 08:30
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.

3 participants