Split discrete mechanisms and initializers into distinct configuration classes and calibrated mechanisms. - #123
Split discrete mechanisms and initializers into distinct configuration classes and calibrated mechanisms.#123copybara-service[bot] wants to merge 1 commit into
Conversation
5c2e6ff to
1cfaa9b
Compare
209e9ff to
c7db08e
Compare
…n classes and calibrated mechanisms. PiperOrigin-RevId: 961394253
c7db08e to
15f63f9
Compare
MuhammadNiazAli
left a comment
There was a problem hiding this comment.
The init.py restructuring is consistent each mechanism module (aim, aim_gdp, direct, independent, mst, swift) now exports both the base class and its *Config counterpart, and the backwards-compat aliases correctly flip direction (e.g. AIMMechanism = AIMConfig instead of the old AIMConfig = AIMMechanism). That matches the pattern shown in in_memory_api.md, where old call sites now pass discrete_mechanisms.MSTConfig() instead of MSTMechanism() so existing code referencing the old *Mechanism names will keep working, just now pointing at the config object rather than a mechanism instance.
One thing worth double-checking (not visible in what I've seen so far): now that XMechanism aliases to XConfig, any code doing isinstance(x, XMechanism) or relying on XMechanism-specific methods that aren't on XConfig would silently break. Worth confirming there's no such usage internally.
I've only seen init.py and a small unrelated snippet of aim.py (_worst_approximated) this is a 29-file PR, so holding off on approval until I see the actual Config/mechanism class definitions in aim.py, mst.py, etc., where the real logic split happens.
Split discrete mechanisms and initializers into distinct configuration classes and calibrated mechanisms.