Skip to content

Refactor CondensedPhaseArrhenius #443

@K20shores

Description

@K20shores

Refactor CondensedPhaseArrhenius in musica.mechanism_configuration to use composition instead of inheritance from _CondensedPhaseArrhenius.

Acceptance Criteria

  • The class no longer inherits from _CondensedPhaseArrhenius.
  • The internal C++ instance is held in self._instance.
  • All properties (e.g., A, B, C, etc.) delegate to or update the internal C++ object.
  • Reactants and products use Python Species and Phase objects.
  • serialize() works as an instance method and operates entirely on Python-visible data.
  • Public interface reflects only Python-native types.

Ideas

  • Use the wrapper pattern from tuvx.py as a guide.
  • Consider creating helper functions for conversion between Species/Phase and _ReactionComponent.
  • Use @property decorators for clean delegation.

Tasks

  • Replace class CondensedPhaseArrhenius(_CondensedPhaseArrhenius) with class CondensedPhaseArrhenius.
  • Construct the C++ _CondensedPhaseArrhenius instance inside __init__ and assign to self._instance.
  • Forward all attributes and logic to self._instance using property methods where needed.
  • Ensure reactants, products, aerosol_phase, and aerosol_phase_water use Python Species and Phase objects.
  • Update the serialize() method to access only Python-visible data.
  • Remove the @staticmethod pattern from serialize; support instance method serialization.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions