-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix logical errors and typos in Spec equilibrium object #457
base: master
Are you sure you want to change the base?
Conversation
|
||
if self.oita_profile is not None: | ||
si.oita[0:self.nvol+1] = self.oita_profile.get(np.arange(0, self.nvol)) | ||
si.oita[0:self.nvol+1] = self.oita_profile.get(np.arange(0, self.nvol+1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvol+1 is the correct size here, compare to:
I think the other iota sizes in spec wrapper must be adjusted.
I noticed, that parts of the codebase assume all profiles to be the same size (mvol), in this example according to the error message simsopt/src/simsopt/mhd/profiles.py Lines 93 to 98 in 9fc2c36
or here, where volume_current_profile is simply overwritten in the vacuum region for freeboundary runs, so although nvol elements are used, the profile has to be at least mvol in size:simsopt/src/simsopt/mhd/spec.py Lines 1001 to 1019 in 9fc2c36
while other parts create different sizes for different profiles. simsopt/src/simsopt/mhd/spec.py Lines 766 to 781 in 9fc2c36
What is the intended design @smiet ? I think variable size will result in stricter error handling, whereas having all profiles the same size makes them easier to switch out, iterate over, etc. On the other hand, having the same size might confuse users about which elements actually affect the result. |
Also @smiet , shouldn't iota profiles be |
There were a few bugs in the Spec equilibrium object that I spotted:
raise
clause was omitted, so they didn't take effectsi.iota[0:self.nvol+1]
andsi.oita[0:self.nvol+1]
had the wrong shapeas_spec
compared tuple to list and always raised