Skip to content

Refactor AqueousEquilibrium #445

@K20shores

Description

@K20shores

Refactor AqueousEquilibrium in musica.mechanism_configuration to use composition instead of inheritance from _AqueousEquilibrium.

Acceptance Criteria

  • The class no longer inherits from _AqueousEquilibrium.
  • The internal C++ instance is held in self._instance.
  • All properties (name, aerosol_phase, aerosol_phase_water, reactants, products, A, C, k_reverse, other_properties) delegate to or update self._instance.
  • Reactants and products use Python Species and Phase objects on the Python side and convert to/from C++ _ReactionComponent.
  • The serialize() method is converted from a static method to an instance method, operating solely on Python-visible data.
  • Public interface exposes only Python-native types, no direct C++ inheritance.

Ideas

Tasks

  • Remove inheritance from _AqueousEquilibrium.
  • Add self._instance initialized to _AqueousEquilibrium() inside __init__.
  • Forward all attribute access and mutations to self._instance via properties.
  • Convert reactants and products to Python objects on get, convert to C++ objects on set.
  • Change serialize() to an instance method accessing Python-side data.
  • Remove static serialize() method and update callers accordingly.

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