Fix for show_complex interaction with scalebar dict#690
Fix for show_complex interaction with scalebar dict#690edwinsupple wants to merge 2 commits intopy4dstem:devfrom
Conversation
…th defaults" This reverts commit 34a9658.
|
Thanks @edwinsupple for the PR. If I recall correctly #673 broke a number of other downstream visualization functions used in the Taking a step back, it's not obvious to me popping kwargs is the way to go? A simpler approach for #672 could perhaps be to check whether the user passed any scalebar options, and if so and the array to be plotted has their own calibrations, to simply extract the array ( |
|
@gvarnavi there are a lot of instances where Looking at this more, I think the issue may be that my initial PR did not handle None correctly. I was focused on the first line in the docstring about adding a scalebar when a DiffractionSlice or RealSlice is passed and missed the bit about not adding a scalebar when an array is passed. I will go back and work on this more, if you have a test case or two I can try let me know. |
|
Indeed, I added those haha -- the purpose of that is to allow compatibility with different function call structures and impose opinionated defaults in the downstream functions. To be quite honest, the objection here is on the way kwargs get handled in Which is why the suggestion was a minimally-invasive "hack" to achieve your effect w/o touching the entangled kwargs mess. |
See #673 and #689.
show_complexincorrectly assigned None tofigsizewhen popping it from the kwargs resulting in broken plotting due to interaction withscalebar, it now assigns a default figsize as is typical for other show type functions. I did not find the same issue in the other show functions. @smribet please let me know if you have a case where this is still broken.