-
Notifications
You must be signed in to change notification settings - Fork 206
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 __setattr__()
method to AxesManager
's signal_axes
and navigation_axes
#2756
base: RELEASE_next_minor
Are you sure you want to change the base?
Add __setattr__()
method to AxesManager
's signal_axes
and navigation_axes
#2756
Conversation
__setitem__()
method to AxesManager
's signal_axes
and navigation_axes
__setattr__()
method to AxesManager
's signal_axes
and navigation_axes
This is WIP. I will complete it once I get feedback on the syntax and functionality. Some notes:
So, should convenience win over orthodoxy? If no, can you come up with an orthodox and equally convenient syntax? |
Codecov Report
@@ Coverage Diff @@
## RELEASE_next_minor #2756 +/- ##
======================================================
+ Coverage 77.69% 77.73% +0.04%
======================================================
Files 203 203
Lines 30627 30652 +25
Branches 6670 6676 +6
======================================================
+ Hits 23796 23828 +32
+ Misses 5051 5043 -8
- Partials 1780 1781 +1
Continue to review full report at Codecov.
|
This will be indeed very convenient and this would nicely replace the following usage (which I do quite regularly): for axis, name in zip(s.axes_manager.signal_axes, ("x", "y")):
axis.name = name If we want to keep it standard (not changing s.axes_manager.navigation_axes[:].name = ("x", "y") Regarding |
The goal is to ease the task of setting up the axes attributes, see below for an example.
The syntax is inspired by (but different from) https://matplotlib.org/stable/users/whats_new.html#axes-spines-access-shortcuts
Progress of the PR
upcoming_changes
folder (seeupcoming_changes/README.rst
),Minimal example of the bug fix or the new feature