-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Refactor Species
in musica.mechanism_configuration
to use composition instead of inheritance from _Species
.
Acceptance Criteria
- Species no longer inherits from _Species.
- Internal C++ instance stored in
self._instance
. - All properties (name, HLC_298K_mol_m3_Pa, HLC_exponential_factor_K, diffusion_coefficient_m2_s, N_star, molecular_weight_kg_mol, density_kg_m3, tracer_type, other_properties) delegate to or update
self._instance
. serialize()
refactored as an instance method using only Python-visible data.- Public interface exposes only Python-native types.
- Remove static method pattern from
serialize()
.
Ideas
- Use wrapper pattern from
tuvx.py
for encapsulating the C++ instance. - Implement property getters/setters for all attributes forwarding to
self._instance
. - Handle
other_properties
properly during serialization. - Refactor
serialize()
to instance method that accesses Python attributes only.
Tasks
- Replace
class Species(_Species)
withclass Species
. - Instantiate
_Species
in__init__
and assign toself._instance
. - Forward attribute access and mutation to
self._instance
via properties. - Convert
serialize()
to instance method, relying solely on Python attributes. - Ensure
other_properties
serialized correctly.
Metadata
Metadata
Assignees
Labels
No labels