-
Notifications
You must be signed in to change notification settings - Fork 487
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
[enhancement] add pytests for matplotlib #914
[enhancement] add pytests for matplotlib #914
Conversation
Codecov Report
@@ Coverage Diff @@
## main #914 +/- ##
==========================================
+ Coverage 87.91% 89.21% +1.30%
==========================================
Files 17 17
Lines 4443 4443
==========================================
+ Hits 3906 3964 +58
+ Misses 537 479 -58
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@karl-richter I transferred all plotting-related test functions to the test_plotting and parametrized both backends. Would be great if you can review the changes since you are well familiar with the plotting functionalities. Thank you! @Kevin-Chen0 I marked this PR for the upcoming sprint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good to me!
The only thing we should consider performance wise - does it really make sense to run the same test twice? since technically all parameters are the same and only the output is visualized using two frameworks we could also loop through the plottling backends within the tests. This should technically be faster. However, the current method provides more visibility. Not sure if you have discussed this with oskar yet.
@karl-richter thanks a lot for your feedback, definitely a valid point regarding the performance. I discussed with @ourownstory about this. Since the code between the plotly and matplotlib functions differs at some places, it would be great to have it checked/ covered. If we decide to drop one of the backends or see the need for increasing the performance by reducing the tests, we can do so by simply dropping the matplotlib parameter in the tests. |
Hi Leonie, can you take a look and see why the model / metrics (pull_request) is failing? You can sync up with @judussoari and @karl-richter about this. |
@Kevin-Chen0 the metric test currently fails in all my pull request. However, there is already a fix on the cml repo iterative/cml#1228. As soon as this PR will be deployed, the error will resolve. |
@@ -24,10 +24,13 @@ | |||
LR = 1.0 | |||
|
|||
PLOT = False | |||
# plot tests cover both plotting backends |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering whether you can use matplotlib.isinteractive()
from PR #960 instead of having a PLOT
variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kevin-Chen0 Thanks for bringing up the idea. Yes, I can add the matplotlib.isinteractive()
. Should we fully remove the PLOT variable? Then we would not have a manual switch to turn the plotting out/on anymore. Would it be an idea to add the matplotlib.isinteractive()
to the if queries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karl-richter would be great to quickly have your opinion on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have matplotlib.isinteractive()
, then we should remove the PLOT variables in the tests, as it is hardcoded as False by default for the test. @karl-richter thoughts?
…isinger/neural_prophet into matplotlib_pytests
…isinger/neural_prophet into matplotlib_pytests
@karl-richter would be amazing if you could merge this PR. Please, wait for the PR#844 to be merged (by @noxan). In this order, we will have an easier time with merge conflicts. Thank you! |
Problem
pytests in test_plotting() only cover plotly and do not cover matplotlib plotting backend.
Solution
Adapt all existing pytests to cover the plotly and matplotlib plotting backend.