Skip to content

Refactor pcPIE into an mPIE compatibility wrapper - #108

Merged
ShantanuKodgirwar merged 2 commits into
PtyLab:mainfrom
cliulucien:remove_redundant_engines
Sep 30, 2026
Merged

ShantanuKodgirwar merged 2 commits into
PtyLab:mainfrom
cliulucien:remove_redundant_engines

Conversation

@cliulucien

Copy link
Copy Markdown
Contributor

What and why

This PR removes the duplicated pcPIE engine implementation and replaces it
with a lightweight compatibility wrapper around mPIE.

The current pcPIE implementation largely duplicates mPIE, including the
regularized object/probe updates and momentum acceleration. Position correction
is already implemented generically in BaseEngine and can be enabled in
mPIE through params.positionCorrectionSwitch.

To reduce duplicated reconstruction logic, pcPIE now inherits from mPIE
instead of maintaining a separate engine implementation.

Backward compatibility is preserved for existing code using:

  • Engines.pcPIE
  • the legacy momentum parameter names betaM and stepM

These legacy parameters are mapped to the corresponding mPIE parameters
feedbackM and frictionM.

How it was tested

Added compatibility tests verifying that:

  • Engines.pcPIE remains available
  • pcPIE inherits from mPIE
  • legacy betaM and stepM attributes correctly map to
    feedbackM and frictionM

If the legacy module shim is retained, the direct import path

from PtyLab.Engines.pcPIE import pcPIE

is also tested for backward compatibility.

All added tests pass.

Notes

pcPIE is retained as a compatibility interface, while the actual
reconstruction logic is now provided by mPIE.

Position correction remains controlled through
params.positionCorrectionSwitch and is implemented by the shared
BaseEngine.positionCorrection() functionality.

This reduces duplicated engine code while keeping existing user-facing API
calls functional.

@cliulucien
cliulucien marked this pull request as draft September 30, 2026 15:32
@cliulucien
cliulucien marked this pull request as ready for review September 30, 2026 15:36
@ShantanuKodgirwar
ShantanuKodgirwar merged commit 7dfc428 into PtyLab:main Sep 30, 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.

2 participants