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 name to structure tree view #60

Merged
merged 2 commits into from
Aug 23, 2023
Merged

add name to structure tree view #60

merged 2 commits into from
Aug 23, 2023

Conversation

alessandrofelder
Copy link
Member

@alessandrofelder alessandrofelder commented Aug 3, 2023

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
We'd like to see the names of the structures in the tree view, not just the acronyms

What does this PR do?
Alternative, simpler-to-implement solution to a toggle between structure acronyms and names: acronyms are always shown, and names can be shown/hidden with a checkbox.

For the more difficult implementation

  • make the model editable by reimplementingsetData (but make sure the user can't edit)
    or
  • replace model entirely anytime things are toggled. This would work OK if we managed to remember the expanded indices, but this is tricky because we are left with dangling pointers on model replacement. See an attempt at this on
    the complex-structure-tree-view branch.

References

Closes #47

How has this PR been tested?

Tests for the new checkbox functionality have been added.

Is this a breaking change?

Nope.

Does this PR require an update to the documentation?

Nope

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@alessandrofelder
Copy link
Member Author

alessandrofelder commented Aug 11, 2023

needs to be rebased onto #67

[Edit] done ✔️

@alessandrofelder alessandrofelder self-assigned this Aug 11, 2023
@alessandrofelder alessandrofelder added the enhancement New feature or request label Aug 11, 2023
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.19% 🎉

Comparison is base (adf5ce6) 97.32% compared to head (21ad9eb) 97.51%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
+ Coverage   97.32%   97.51%   +0.19%     
==========================================
  Files           7        7              
  Lines         299      322      +23     
==========================================
+ Hits          291      314      +23     
  Misses          8        8              
Files Changed Coverage Δ
brainrender_napari/brainrender_widget.py 100.00% <100.00%> (ø)
brainrender_napari/widgets/structure_view.py 93.33% <100.00%> (+0.41%) ⬆️

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

@alessandrofelder alessandrofelder marked this pull request as ready for review August 23, 2023 12:33
Copy link
Member

@adamltyson adamltyson left a comment

Choose a reason for hiding this comment

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

Ideally the user could toggle between acronym/name, but this is much better anyway. Happy to merge.

@adamltyson
Copy link
Member

Sorry just seen the issues tracking progress on this.

@adamltyson adamltyson merged commit fe43511 into main Aug 23, 2023
11 checks passed
@alessandrofelder alessandrofelder deleted the simple-structure-names branch August 23, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Toggle between name and acronyms in structure tree view
2 participants