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

Layout axes remain the same after update_plot methods is called #904

Merged
merged 6 commits into from
Oct 29, 2024

Conversation

AndresOrtegaGuerrero
Copy link
Member

This address this issue #903

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 67.09%. Comparing base (15f46b0) to head (7d1a91b).
Report is 114 commits behind head on main.

Files with missing lines Patch % Lines
src/aiidalab_qe/common/bandpdoswidget.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #904      +/-   ##
==========================================
- Coverage   67.15%   67.09%   -0.06%     
==========================================
  Files          51       51              
  Lines        4707     4711       +4     
==========================================
  Hits         3161     3161              
- Misses       1546     1550       +4     
Flag Coverage Δ
python-3.11 ?
python-3.9 67.09% <0.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@superstar54
Copy link
Member

Hi @AndresOrtegaGuerrero , should we reset the axis range every time the plot updates? Maybe in some cases, when we change the plot setting, the axis range should be updated.

Another issue (not related to this PR), when I change the flat parameters, the screen flash a lot:

qeapp-flat-bands-falsh.mp4

In the flat band case, is it possible to update the data instead of re-drawing the plot?

@AndresOrtegaGuerrero
Copy link
Member Author

AndresOrtegaGuerrero commented Oct 28, 2024

Hi @AndresOrtegaGuerrero , should we reset the axis range every time the plot updates? Maybe in some cases, when we change the plot setting, the axis range should be updated.

Another issue (not related to this PR), when I change the flat parameters, the screen flash a lot:

qeapp-flat-bands-falsh.mp4
In the flat band case, is it possible to update the data instead of re-drawing the plot?

To answer the first question , we have the reset axis button from plotly that does this function.

The second question , we do a replot since we have to widget a BandsPdosWidget (meant for qe app) and the BandsPdosPlotly , that kinda resemble the bandsplot-widget from the past that just receives a dictionary with the info.

For a new thinckness i need to re-loop and re compute contribution per band.

For the flashing , i think is that each time we mode the widget it is triggering the replot .... maybe i could add like a time to react ?

@superstar54
Copy link
Member

For a new thinckness i need to re-loop and re compute contribution per band.

If the number of data is the same, then it is possible to only update the data instead of re-plot the image. I did this in the XPS plot, as shown here:

if len(self.g.data) == len(data):

You can look at it in the future when you have time.

@AndresOrtegaGuerrero
Copy link
Member Author

@superstar54 Thank you! , regarding the flashing , what about adding like a debounce of 0.5 sec (or less) ?

Regarding the updating the plot , so i will try to find a way to avoid repeating a re-loops. Maybe in a different PR ?

@superstar54
Copy link
Member

Hi @AndresOrtegaGuerrero , yes, Okay to merge the PR. You can implement the update in a future PR when you have time.

@AndresOrtegaGuerrero AndresOrtegaGuerrero merged commit ef677e7 into main Oct 29, 2024
12 checks passed
@AndresOrtegaGuerrero AndresOrtegaGuerrero deleted the bandswidget_no_reset_zoom branch October 29, 2024 10:30
edan-bainglass pushed a commit to edan-bainglass/aiidalab-qe that referenced this pull request Oct 31, 2024
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.

Changing the fat bands thickness should not reset zoom
2 participants