You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I easy get the parameters split out into the parameter groups they exists as?
model.parameters() just give me the full dict for all parameters, but how do I get the same dicts for each parameter group instead?
I can get the groups by using the children on the 'parameters', those nodes have no properties however?!?
display(n.children())
print(n.properties())
p = n.children()[0]
print(p.name())
print(p.properties())
As far as I can tell, this is all expected behavior. As in: It works as documented. So I guess you wish the high-level Python API would support this use case. Which it doesn't: It simply returns all parameters, it doesn't let you narrow it down to specific groups. Though you've already figured out how to use the low-level Comsol Java API to accomplish that.
Those nodes have no properties because the Comsol API does not treat parameter names like properties. This is why you have to call java.varnames() instead of java.properties().
I guess if you're looking to change the Python API, we could discuss adding an optional argument group=None (or something) to Model.parameters(). I don't see any harm in that.
How can I easy get the parameters split out into the parameter groups they exists as?
model.parameters()
just give me the full dict for all parameters, but how do I get the same dicts for each parameter group instead?I can get the groups by using the children on the 'parameters', those nodes have no properties however?!?
display(n.children()) print(n.properties()) p = n.children()[0] print(p.name()) print(p.properties())
gives:
The text was updated successfully, but these errors were encountered: