-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
celes_initialField: pol index doesn't update when polarization changes #20
Comments
I see your point, and I'm afraid it applies to a bunch of other properties as well. Probably, the intended way to go would be to implement a protected |
maybe adding something like this would work?
|
So, a dependent variable would not work? |
yes, I believe the change you proposed would work. Moreover, I guess that even if this is certainly not an expensive calculation, the main overhead comes from repeatedly calling a function (possibly thousands of times in a simulation, I guess), rather than just reading a variable. |
Yet another way is a |
I might be wrong, but I think I've removed every single I know the As an unrelated example: suppose one wants to run a series of simulations with varying |
Well, I am still not familiar with the system objects. But in the "old" way you would either have Note that set methods are automatically called when the user changes a property, so you cannot bypass them. Calling the class constructor with input check each time a property is changed seems OK to me, too - if there is a way to achieve that. |
I would avoid |
right now, the user accesses the polarization property ("TE" or "TM") and the hidden pol property is automatically set during intialization. The problem is, that if the polarization is changed later, one needs to call the setPolIdx method again. It would be good if this happens automatically.
I would suggest to change the pol property to a dependent property and rename the setPolIdx to get.pol method. Then, pol is updated when polarization is updated. @lpattelli, does this conflict with how you intended the initialization to happen?
The text was updated successfully, but these errors were encountered: