-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Refactor HenrysLaw
in musica.mechanism_configuration
to use composition instead of inheritance from _HenrysLaw
.
Acceptance Criteria
- The class no longer inherits from
_HenrysLaw
. - The internal C++ instance is held in
self._instance
. - All properties (
name
,gas_phase
,gas_phase_species
,aerosol_phase
,aerosol_phase_water
,aerosol_phase_species
,other_properties
) delegate to or updateself._instance
. gas_phase_species
andaerosol_phase_species
use PythonSpecies
or(float, Species)
and convert to/from C++_ReactionComponent
.serialize()
is converted from static method to instance method, operating only on Python-visible data.- Public interface exposes only Python-native types with no direct C++ inheritance.
Ideas
- Follow the wrapper pattern from
tuvx.py
. - Use helper functions or properties for clean conversion between Python and C++ types.
- Use
@property
decorators to forward attributes. - Refactor
serialize()
as an instance method, removing static method usage.
Tasks
- Remove
_HenrysLaw
inheritance. - Initialize
self._instance
as_HenrysLaw()
inside__init__
. - Forward all attribute access and mutation to
self._instance
via properties. - Convert
gas_phase_species
andaerosol_phase_species
between Python and C++ representations on set/get. - Refactor
serialize()
to instance method accessing Python-visible data only. - Update call sites for serialization accordingly.
Metadata
Metadata
Assignees
Labels
No labels