Skip to content

Refactor SimpolPhaseTransfer #452

@K20shores

Description

@K20shores

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 to self._instance.
  • gas_phase_species and aerosol_phase_species accept Python Species or (float, Species), converting to/from C++ _ReactionComponent.
  • Validate B as 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

Tasks

  • Remove _SimpolPhaseTransfer inheritance.
  • Initialize self._instance inside __init__.
  • Forward attribute access/mutation to self._instance with properties.
  • Implement validation for B on set.
  • Refactor serialize() to instance method with Python attributes.
  • Update code that calls serialize() 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