Bump to v1.5.0
This PR fix conflicts with recent changes to master. These mainly regards plot (only other change concerns mod_grad_axis, which I updated to match the new internal gradient representation).
Specifically, seq.plot() now returns a "SeqPlot" object, which contains the figure handles. In addition to enable re-usability like #308 did, it improves interactivity (which requires the optional mpcursors package, added as optional dependency). Some examples below:
Standard behavior The standard seq.plot() behaviour is preserved:
Code also supports the overlay of multiple plots, as
fig = seq1.plot(time_range=[0.0, 0.012], plot_now=False)
seq2.plot(time_range=[0.0, 0.012], overlay=fig)
resulting in:
New features In addition, following MATLAB toolbox, this class now supports stacked plots:
seq.plot(time_range=[0.0, 0.012], stacked=True)
When mplcursors is installed, we can also datatips by clicking on the waveforms:
we can also add a moving hairline following the cursor by setting show_guides=True:
seq.plot(time_range=[0.0, 0.012], show_guides=True)
which also works when stacked=True (not shown).
The code is also compatible with the recent SoftDelay extension:
For the moment, I disabled tests. I would like to discuss it before re-enabling (@schuenke): this version replace the optional fig1, fig2 arguments of seq.plot() with "overlay" (a SeqPlot object). In some of the test case, we create the empty figure handles and then fill it in plot(). Do we really want this feature? I figured that the "overlay" argument is more oriented towards overlaying existing plots, rather than filling empty handles. Current SeqPlot has fig1, fig2, ax1 and ax2 as attributes, so user can still access them and customize it if they need to. What do you think?
EDIT: I also added an optional PySide6 dependency to address #268 @btasdelen
Coverage Report
| Tests | Skipped | Failures | Errors | Time |
|---|---|---|---|---|
| 1366 | 21 :zzz: | 0 :x: | 0 :fire: | 3m 26s :stopwatch: |
P.S: not sure why it failed pre-commit workflow, it did pass locally:
Merging mcencini:v1.5.0_dev into imr-framework:v1.5.0_dev and afterwards imr-framework:v1.5.0_dev into imr-framework:master seems complicated. Especially, because imr-framework:v1.5.0_dev is not up to date and to be able to review the changes in this PR, we would need to update and solve the conflics in imr-framework:v1.5.0_dev anyway.
If your branch includes all changes, I suggest we change the target branch of this PR directly to imr-framework:master, no?
Sure! Sorry, I hope it is better now
P.S: not sure why it failed pre-commit workflow, it did pass locally:
I think I fixed this already at some point. Might got lost during some manual merging?! GitHub is super slow for me atm, I will have a look at it later.
P.S: not sure why it failed pre-commit workflow, it did pass locally:
I think I fixed this already at some point. Might got lost during some manual merging?! GitHub is super slow for me atm, I will have a look at it later.
Not sure why, but now correctly raises the errors - which I fixed - also locally. Anyway, I did not want to digress from the scope of PR
Merging
mcencini:v1.5.0_devintoimr-framework:v1.5.0_devand afterwardsimr-framework:v1.5.0_devintoimr-framework:masterseems complicated. Especially, becauseimr-framework:v1.5.0_devis not up to date and to be able to review the changes in this PR, we would need to update and solve the conflics inimr-framework:v1.5.0_devanyway.If your branch includes all changes, I suggest we change the target branch of this PR directly to
imr-framework:master, no?
Okay, I didn't realize that most of the code has been reviewed already. Not sure whats the best and easiest way here. Because imr-framework:v1.5.0_dev hasn't been updated in between, it's kind of messy at the moment. And I cannot resolve any merge conflicts because of permission issues on your fork.
Maybe we leave it as it is and try to structure it a bit better the next time. @sairamgeethanath wanted to review the changes anyway, no? So maybe it's not to bad to review some of the code a second time.
Merging
mcencini:v1.5.0_devintoimr-framework:v1.5.0_devand afterwardsimr-framework:v1.5.0_devintoimr-framework:masterseems complicated. Especially, becauseimr-framework:v1.5.0_devis not up to date and to be able to review the changes in this PR, we would need to update and solve the conflics inimr-framework:v1.5.0_devanyway. If your branch includes all changes, I suggest we change the target branch of this PR directly toimr-framework:master, no?Okay, I didn't realize that most of the code has been reviewed already. Not sure whats the best and easiest way here. Because
imr-framework:v1.5.0_devhasn't been updated in between, it's kind of messy at the moment. And I cannot resolve any merge conflicts because of permission issues on your fork.Maybe we leave it as it is and try to structure it a bit better the next time. @sairamgeethanath wanted to review the changes anyway, no? So maybe it's not to bad to review some of the code a second time.
Apologies, I thought that merging master into mcencini:v1.5.0_dev - which was up-to-date with imr-framework:v1.5.0_dev - would be enough to avoid mess. For the future, should I have updated imr-framework:v1.5.0_dev directly instead (even though I am not sure I have the permission)?
Anyway, it is not bad for sure to have some additional review, in case something slipped in the previous round. Thanks again!
I don't have the perfect overview over the different branches on the different forks, but always updating the dev branch after master was updated would have been the easiest and cleanest way I guess. This would better separate your modifications from other modifications and thus simplify the review process.
Independent of the branch structure, I realized that for example the changes from #308 are not taken into account in your code. It's not obvious, because the plot function was moved into a separate file, but for example the unification of the subplot naming and handling is completely reverted, same for the plot_type parameter, which appears again in your docstring although it's not a parameter anymore. Would also be great to have the init parameters documented in the __init__ method instead of the class docstring itself. Maybe you can have a look at this again and try to merge the changes from #308 into your code.
I am happy to also review everything afterwards.
And don't get me wrong please: IMO it's great work that you have been doing (!!!), but we should make sure that we include all previous adjustments and try to steadily increase the code and documentation quality.
I apologize if I am missing something about #308, but I had another look and I am not sure I understand what I am missing - besides the changes to support the new format (phase_ppm, freq_ppm), plot stack and interactivity (data tips and moving hairline), the rest of the code in the private
_seq_plot()function seems to follow the recent changes. I also do not see any remainingplot_type(which I previously mistakenly left before opening this PR). Would you kindly point me towards the right direction? Thanks again for you support, I really appreciate it!
Sorry, my mistake. Was checking the code offline and obviously I was on an outdated branch. In the online version, it looks good 👍
I will just review the code changes in this PR directly and post individual comments, so that you and others don't have to wait for me reviewing the 60 files.
