-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Refactor SimpolPhaseTransfer in musica.mechanism_configuration to use composition instead of inheritance from _SimpolPhaseTransfer.
Acceptance Criteria
- Class no longer inherits from
_SimpolPhaseTransfer. - Holds internal C++ instance in
self._instance. - Attributes (
name,gas_phase,gas_phase_species,aerosol_phase,aerosol_phase_species,B,other_properties) delegate toself._instance. gas_phase_speciesandaerosol_phase_speciesaccept PythonSpeciesor(float, Species), converting to/from C++_ReactionComponent.- Validate
Bas list of length 4. serialize()converted to instance method using only Python-visible data.- Public interface exposes only Python-native types without direct C++ inheritance.
Ideas
- Follow
tuvx.pywrapper pattern. - Use
@propertydecorators for attribute delegation and conversion. - Refactor
serialize()as instance method. - Use helper functions for Python-C++ conversion of reaction components.
- Do the work similar to Refactor CondensedPhaseArrhenius to use composition instead of inheritance #461 Refactor Arrhenius class to use composition instead of inheritance #462, Refactor Troe class from inheritance to composition pattern #466, Refactor Branched class to use composition instead of inheritance #467, Refactor AqueousEquilibrium to use composition instead of inheritance #475, Refactor Tunneling class to use composition instead of inheritance #476
Tasks
- Remove
_SimpolPhaseTransferinheritance. - Initialize
self._instanceinside__init__. - Forward attribute access/mutation to
self._instancewith properties. - Implement validation for
Bon set. - Refactor
serialize()to instance method with Python attributes. - Update code that calls
serialize()accordingly.
Reactions are currently unavailable