Closed Artemkth closed 4 months ago
This is because the .coupling
property is converted to a Python dict
with no way for Matlab to register any changes.
Ideally we should change the code so that the nips.coupling.rdip = 10
syntax works but this either requires:
@RichardWaiteSTFC - I'm inclined towards option 1, but what do you think?
@Artemkth for now you can use this very clunky work-around, which sets the properties in Matlab, and then re-exports the class back to Python.
coupling = nips.coupling
coupling['rdip'] = 10
m.assignin('base', 'nips', nips)
m.assignin('base', 'coupling', coupling)
nips = m.evalin('base', "subsasgn(nips, struct('type','.','subs','coupling'), coupling')")
nips.coupling['rdip']
The final line should print array([[10.]])
.
It is unclear how to set parameters like 'rdip' in python. Trying to change the element of a dictionary doesn't propagate into backend:
this example outputs '[[0.]]' instead of expected '[[10.]]'.
The standard way of accessing it like examples do
isn't available either.