Skip to content
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

Add a View menu, improve grid plotting #176

Merged
merged 10 commits into from
Jan 29, 2024
Merged

Add a View menu, improve grid plotting #176

merged 10 commits into from
Jan 29, 2024

Conversation

bendudson
Copy link
Contributor

@bendudson bendudson commented Jan 22, 2024

Updates the gui options, and triggers a replotting of the grid.

Some plotting settings are in the Preferences dialog. The View menu and preferences dialog are now kept in sync.

Fixed the plot_grid keep_limits functionality, so that the xlim and ylim settings are preserved when replotting.

  • Updated manual
  • Updated doc/whats-new.md with a summary of the changes

Updates the gui options, and triggers a replotting of the grid.

Some plotting settings are in the Preferences dialog. The View menu
and preferences dialog are now kept in sync.

Fixed the plot_grid keep_limits functionality, so that the xlim and
ylim settings are preserved when replotting.
Uses wall intersection to calculate which cells are outside the wall,
and compute a penalty mask that can be used for immersed boundaries.

Also improve plotting.
@bendudson
Copy link
Contributor Author

The main purpose of all this was to make grid generation issues easier to diagnose visually, and to be able to calculate and plot a penalty_mask variable for imposing penalization boundaries in BOUT++ models.
240123-hypnotoad

@bendudson bendudson changed the title WIP: Add a View menu, improve grid plotting Add a View menu, improve grid plotting Jan 23, 2024
Makes plotting in post-processing easier.
Should update the reference grid, but for now ignore variables
Document new features and output variables.
@bendudson bendudson requested a review from johnomotani January 26, 2024 16:25
Copy link
Collaborator

@johnomotani johnomotani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bendudson, looks good to me.

One remaining problem - there is (I think) a bug in Qt.py's --convert feature, which means that on this branch the gui is not working unless PySide2 is installed. The hypnotoad_mainWindow.py file (generated by pyside2-uic) now contains

from PySide2.QtCore import *

But the --convert feature only does this:

        line = line.replace("from PySide2 import", "from Qt import QtCompat,")
        line = line.replace("QtWidgets.QApplication.translate",
                            "QtCompat.translate")

I guess this should be raised as an issue on Qt.py, but the short-term fix would be to edit hypnotoad_mainWindow.py to use the Qt.py equivalent of the PySide2 import (whatever that is). Or we could just require PySide2, but that's probably more work than sticking with Qt.py.

bendudson and others added 4 commits January 28, 2024 17:15
Co-authored-by: John Omotani <john.omotani@ukaea.uk>
Co-authored-by: John Omotani <john.omotani@ukaea.uk>
Same version as now used in Github CI.
Copy link
Collaborator

@johnomotani johnomotani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me now!

@bendudson bendudson merged commit d8e6be6 into master Jan 29, 2024
21 checks passed
@bendudson bendudson deleted the gui-views branch January 29, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants