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

[MRG] Added plot sets functionality #746

Merged
merged 6 commits into from
Apr 19, 2024

Conversation

kmilo9999
Copy link
Collaborator

@kmilo9999 kmilo9999 commented Apr 5, 2024

  • Added plot sets to the Layout templates
  • Added logic to 'Make Figure' button to handle data depended layouts
    solves GUI plot sets #711
    drive-dipole
    drive-spikes
    dipole-layers
    dipole-spectrogram
    drive-dipole-spectrogram
    psd-layers
    image

@kmilo9999 kmilo9999 requested a review from gtdang April 5, 2024 19:02
@kmilo9999
Copy link
Collaborator Author

@gtdang give it a quick review and let me know your thoughts

@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 92.62%. Comparing base (d28ddb7) to head (e9ec917).
Report is 2 commits behind head on master.

❗ Current head e9ec917 differs from pull request most recent head 327a3a6. Consider uploading reports for the commit 327a3a6 to get more accurate results

Files Patch % Lines
hnn_core/gui/_viz_manager.py 86.84% 5 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #746      +/-   ##
==========================================
- Coverage   92.67%   92.62%   -0.06%     
==========================================
  Files          27       27              
  Lines        4928     4961      +33     
==========================================
+ Hits         4567     4595      +28     
- Misses        361      366       +5     

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

@kmilo9999 kmilo9999 marked this pull request as draft April 5, 2024 21:51
@kmilo9999 kmilo9999 linked an issue Apr 9, 2024 that may be closed by this pull request
@kmilo9999 kmilo9999 changed the title [WIP] Added plot sets functionality [ENH] Added plot sets functionality Apr 10, 2024
@kmilo9999 kmilo9999 marked this pull request as ready for review April 10, 2024 18:40
Copy link
Collaborator

@gtdang gtdang left a comment

Choose a reason for hiding this comment

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

Looking good Camilo. Left some suggestions and questions.

hnn_core/gui/_viz_manager.py Outdated Show resolved Hide resolved
hnn_core/gui/_viz_manager.py Outdated Show resolved Hide resolved
hnn_core/gui/_viz_manager.py Outdated Show resolved Hide resolved
hnn_core/gui/_viz_manager.py Outdated Show resolved Hide resolved
hnn_core/gui/gui.py Show resolved Hide resolved
@kmilo9999 kmilo9999 requested a review from gtdang April 11, 2024 21:11
@jasmainak
Copy link
Collaborator

@gtdang I let you iterate with @kmilo9999 and merge when happy!

Don't forget to update whats_new and would recommend keeping the commit history clean (< 10 commits)

@@ -87,6 +144,11 @@ def check_sim_plot_types(
target_selection.value = 'None'


def check_template_type_is_data_dependant(template_name):
Copy link
Collaborator

Choose a reason for hiding this comment

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

public function with no docstring

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to private

@@ -87,6 +144,11 @@ def check_sim_plot_types(
target_selection.value = 'None'


def _check_template_type_is_data_dependant(template_name):
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have a unit test

Copy link
Contributor

Choose a reason for hiding this comment

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

@kmilo9999 do you think this is sufficiently covered by the current unit tests? It's a pretty trivial function so I'll leave it to your judgement

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kmilo9999 do you think this is sufficiently covered by the current unit tests? It's a pretty trivial function so I'll leave it to your judgement

Yes, the unit test already covers this function inside the gui.viz_manager.make_fig_button call.

@kmilo9999
Copy link
Collaborator Author

@gtdang @ntolley Please review the test I included in test_gui.py about checking the creation of plots with using the new templates.

Copy link
Collaborator

@gtdang gtdang left a comment

Choose a reason for hiding this comment

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

Thanks Camilo. This is looking really great! Make sure to update the whats_new.rst file mentioning this new feature.

hnn_core/tests/test_gui.py Show resolved Hide resolved
hnn_core/gui/_viz_manager.py Show resolved Hide resolved
hnn_core/gui/_viz_manager.py Outdated Show resolved Hide resolved
@kmilo9999 kmilo9999 requested a review from gtdang April 13, 2024 00:56
Copy link
Collaborator

@gtdang gtdang left a comment

Choose a reason for hiding this comment

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

Suggested slight change to the what's new text to be more specific.

doc/whats_new.rst Show resolved Hide resolved
@kmilo9999 kmilo9999 requested a review from gtdang April 15, 2024 16:03
Copy link
Collaborator

@gtdang gtdang left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@kmilo9999
Copy link
Collaborator Author

Awesome. Let me clean the commit history before merging with main

@kmilo9999
Copy link
Collaborator Author

@gtdang This one is ready to go! 👍

@kmilo9999
Copy link
Collaborator Author

@gtdang I added the Dipole-Spike plot. Review it if you want. It is ready to go.

@gtdang gtdang changed the title [ENH] Added plot sets functionality [MRG] Added plot sets functionality Apr 15, 2024
@gtdang
Copy link
Collaborator

gtdang commented Apr 15, 2024

@ntolley
This is ready to merge if you're OK with it.

@ntolley
Copy link
Contributor

ntolley commented Apr 16, 2024

@kmilo9999 it seems like there are rebase conflicts? Happy to merge once those are fixed (i.e. running git rebase master on the most recent version of the master branch, and fixing the merge conflicts).

We can discuss in our Thursday meeting if there's too many conflicts

STY: fixed typos in comments
…re in the dropdown

DOC: Fixing gui layout template name

STY: Fixing typo in a function naming
MAINT: changed new functions to private. Adding grid specs for new data templates
STY: Fixed typo in test docustring

MAINT: pythonizing for loop on list of tuples

DOC: Added plot sets feature to whats_new.rst

docs: Removed ipywidgets version and added note pointing to GUI installation section.
@kmilo9999
Copy link
Collaborator Author

@kmilo9999 it seems like there are rebase conflicts? Happy to merge once those are fixed (i.e. running git rebase master on the most recent version of the master branch, and fixing the merge conflicts).

We can discuss in our Thursday meeting if there's too many conflicts

It was a small conflict in the whats_new.rst file. I resolved and it should be ready to merge after checks.

@rythorpe
Copy link
Contributor

Something weird happened in your rebase @kmilo9999 . It appears that 501d82b got added to your commit history, which is from a previous PR.

@jasmainak
Copy link
Collaborator

@kmilo9999 please fetch master branch again and rebase ... it will get rid of the weird commits

Comment on lines 49 to 50
- Added kwargs options to `plot_spikes_hist` for adjusting the histogram plots
of spiking activity, by `Abdul Samad Siddiqui`_ in :gh:`732`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This shouldn't be in your PR ... it's already down below

@kmilo9999
Copy link
Collaborator Author

@ntolley It should be ready to merge.

Copy link
Contributor

@ntolley ntolley left a comment

Choose a reason for hiding this comment

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

Great work @kmilo9999!! This is going to be a superl feature for the GUI

@ntolley ntolley merged commit 00e2c9c into jonescompneurolab:master Apr 19, 2024
9 checks passed
@gtdang gtdang linked an issue Jul 26, 2024 that may be closed by this pull request
@gtdang gtdang deleted the feat-plot-sets branch August 29, 2024 17:30
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.

GUI: Creating figures with no data throws multiple exceptions GUI plot sets
6 participants