-
Notifications
You must be signed in to change notification settings - Fork 3
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
Gui options #25
Gui options #25
Conversation
Only options defined in TokamakEquilibrium.default_options make sense to set, so do not allow option names in options table to be edited.
4cbf1e3
to
a44ba67
Compare
Means the gui can modify a reference to the TokamakEquilibrium's user_options object, so we can modify the options after self.eq is constructed.
"_magic" is an internal implementation detail of the Options class, so should not be modified by the user.
Call self.update_options_form() after setting self.options=self.eq.user_options.
a44ba67
to
87257f4
Compare
Resulted from mistake when rebasing changes
@ZedThree could you mention the preferences dialog in |
The preferences dialog is "hand built", that is, it's not created automatically from the I did this only because there's currently a small number of options. If we want to have lots of options here, this is where we want something like: https://github.com/learnpyqt/pyqtconfig Also, it doesn't save settings between runs. That's a wishlist item :) |
If a self.mesh object has already been created in the gui, delete it when loading a new geqdsk file, since we create a new self.eq, so the existing self.mesh is invalid. Also move statements out of the try/except block in read_geqdsk() that do not need to be in there.
Removes code duplication
Plot window is now redrawn when the preferences dialog is closed. Also refactored the plotting into a single method to remove code duplicaction. |
Changing an option value no longer updates the equlibrium. I've been testing with a disconnected double null, and changing |
I think the issue here is that when the |
Previously would be some blank rows.
Store the HypnotoadGui options in a dict, which contains only values read from an input file or set by the user. This means that defaults can be kept, and regenerated when the equilibrium or mesh objects are recreated, since values changed by defaults in the internal options of the equilibrium or mesh are not stored.
Previously passing an empty string caused a crash. Now reset the option to its default value. Might be better to keep the old value, but don't see a simple way of doing that.
Calls base Equilibrium class's updateOptions() and also updates some more defaults.
Otherwise there are multiple layers that might contain an option, which can cause problems when for example we want to do something like 'del eq.user_options[key]'.
Need to only ever call the Equilibrium method, never a method of a subclass.
As discussed on Slack, |
Adds a checkbox in the GUI's Preferences dialog which if checked saves all options when writing the options to YAML.
Should not make a difference, but deepcopy is safer than shallow copy.
@johnomotani I hope 1d6f758 is ok, I was getting things like I like how default options are displayed now. 3662725 removes |
Looks good to me! Thanks @ZedThree |
UseOptions
objects to store options inHypnotoadGui
. This means we can directly modify theuser_options
of theTokamakEquilibrium
object when settings are changed.doc/whats-new.md
with a summary of the changes