Conversation
- Updated type hints across multiple files to replace `List`, `Dict`, and `Tuple` with their built-in equivalents `list`, `dict`, and `tuple`. - Cleaned up unnecessary imports and whitespace in `schedule_solver.py`, `stim_to_shatter_url.py`, `basis.py`, `cli.py`, `visualiser.py`, and various example scripts. - Ensured consistency in type hinting for function signatures and variable declarations.
…fficiency and readability; remove obsolete visualisation file.
There was a problem hiding this comment.
Pull request overview
This PR primarily applies Ruff-driven formatting/type-modernization across the Python codebase and adds/adjusts documentation/comments, while also making a few small refactors in scheduling/visualisation and example CLIs.
Changes:
- Modernize type annotations to built-in generics (e.g.,
list[...],dict[...]) and reformat code for consistency. - Tidy imports/structure and add/adjust docstrings/comments across several modules.
- Minor refactors in tableau visualisation, memory experiment building, pruning, and surface/colour code builders (mostly readability/consistency).
Reviewed changes
Copilot reviewed 69 out of 69 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Adds Ruff as a dependency; adjusts setuptools package discovery path. |
| examples/surface_unrotated_hex.py | Reformats and modernizes typing in example CLI. |
| examples/surface_unrotated_grid.py | Reformats and modernizes typing in example CLI. |
| examples/colour_square_superdense.py | Reformats and modernizes typing in example CLI. |
| examples/colour_square_deg4.py | Reformats and modernizes typing in example CLI. |
| examples/colour_hex_d3.py | Reformats and modernizes typing in example CLI. |
| examples/bb144_deg5_tableau.py | Reformats CLI and avoids unused variables. |
| examples/bb_288_hex.py | Reformats and modernizes typing in example CLI. |
| examples/bb_288_deg5.py | Reformats and modernizes typing in example CLI. |
| examples/bb_144_hex.py | Reformats and adds a few clarifying comments. |
| examples/bb_144_deg5.py | Reformats and modernizes typing in example CLI. |
| ACID/src/acid/tableau_visualiser/visualiser.py | Type-modernization and formatting of tableau visualiser implementation. |
| ACID/src/acid/tableau_visualiser/cli.py | Type-modernization and formatting of tableau visualiser CLI. |
| ACID/src/acid/tableau_visualiser/basis.py | Type-modernization and formatting of basis helpers. |
| ACID/src/acid/tableau_visualiser/init.py | Removes trailing whitespace/blank line. |
| ACID/src/acid/stim_to_shatter_url.py | Import order + formatting tweaks. |
| ACID/src/acid/solver/prune.py | Type-modernization and formatting of pruning logic. |
| ACID/src/acid/solver/init.py | Removes trailing whitespace/blank line. |
| ACID/src/acid/scheduling/template_factory.py | Type-modernization and formatting of template factory. |
| ACID/src/acid/scheduling/enumeration.py | Type-modernization and import cleanup for enumeration. |
| ACID/src/acid/scheduling/init.py | Removes trailing whitespace/blank line. |
| ACID/src/acid/pauli.py | Type-modernization and small formatting refactors. |
| ACID/src/acid/memory_experiment/single_detectors.py | Type-modernization and formatting of detector planning. |
| ACID/src/acid/memory_experiment/schedule_index.py | Type-modernization and formatting of schedule indexing. |
| ACID/src/acid/memory_experiment/registry.py | Type-modernization and formatting of detector registry. |
| ACID/src/acid/memory_experiment/rec_log.py | Type-modernization and formatting of measurement log. |
| ACID/src/acid/memory_experiment/observables.py | Type-modernization and formatting of observable planning. |
| ACID/src/acid/memory_experiment/noise.py | Type-modernization and small no-op return cleanups. |
| ACID/src/acid/memory_experiment/experiment.py | Refactors builder variable naming + type-modernization/formatting. |
| ACID/src/acid/memory_experiment/embedding_utils.py | Type-modernization and small formatting refactors. |
| ACID/src/acid/memory_experiment/builder.py | Type-modernization and formatting of Stim builder. |
| ACID/src/acid/memory_experiment/init.py | Reorders exports and formatting. |
| ACID/src/acid/gf2_utils.py | Type-modernization and formatting; updates helper naming/comments. |
| ACID/src/acid/gap_distance.py | Type-modernization and formatting of GAP interaction. |
| ACID/src/acid/embedding.py | Type-modernization and adds docstring to embedding class. |
| ACID/src/acid/device.py | Type-modernization and formatting of device visualisation helpers. |
| ACID/src/acid/defects/quasi.py | Type-modernization and adds docstring to QuasiStabiliser. |
| ACID/src/acid/defects/init.py | Removes trailing whitespace/blank line. |
| ACID/src/acid/codes/toric/builder.py | Type-modernization and formatting of toric builder. |
| ACID/src/acid/codes/toric/init.py | Removes trailing whitespace/blank line. |
| ACID/src/acid/codes/surface/unrotated_hex.py | Type-modernization, formatting, and minor logic cleanup. |
| ACID/src/acid/codes/surface/unrotated_grid.py | Type-modernization and formatting of grid builder. |
| ACID/src/acid/codes/surface/unrotated_grid_square_edges.py | Type-modernization and formatting of square-edges builder. |
| ACID/src/acid/codes/surface/init.py | Removes trailing whitespace/blank line. |
| ACID/src/acid/codes/colour/square.py | Type-modernization and formatting of colour-square builder. |
| ACID/src/acid/codes/colour/hex.py | Type-modernization and formatting of colour-hex builder. |
| ACID/src/acid/codes/colour/init.py | Reorders imports/exports and formatting. |
| ACID/src/acid/codes/bb/midcycle.py | Type-modernization and added docstrings/comments. |
| ACID/src/acid/codes/bb/builder_deg5.py | Type-modernization and formatting of deg5 builder. |
| ACID/src/acid/codes/bb/algebra.py | Type-modernization and added docstring. |
| ACID/src/acid/codes/bb/init.py | Removes trailing whitespace/blank line. |
| ACID/src/acid/base_code.py | Type-modernization and formatting of base code dataclasses. |
| ACID/src/acid/analysis/schedule.py | Type-modernization and formatting of schedule analysis. |
| ACID/src/acid/analysis/report.py | Type-modernization and formatting of report writer. |
| ACID/src/acid/analysis/gauge_fix_nkd.py | Type-modernization and formatting of gauge-fix analysis. |
| ACID/src/acid/analysis/init.py | Removes trailing whitespace/blank line. |
| ACID/src/acid/init.py | Reorders __all__ entries and formatting. |
Comments suppressed due to low confidence (1)
pyproject.toml:21
ruffis a formatter/linter and typically not a runtime dependency of theacidpackage. Keeping it in[project].dependenciesforces all consumers to install it even when they don't need formatting tooling; consider moving it to an optional "dev" extra (or removing it from runtime dependencies entirely).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+137
to
+139
| sections: list[ | ||
| tuple[CommutingPauliBasis, AntiCommutingPauliBasis], list[int] | ||
| ] = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ruff format and some extra docs