-
Notifications
You must be signed in to change notification settings - Fork 667
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
Fix #2590: Created new axes for plot of persistence_length. #2591
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2591 +/- ##
===========================================
+ Coverage 91.00% 91.02% +0.02%
===========================================
Files 174 174
Lines 23550 23617 +67
Branches 3083 3083
===========================================
+ Hits 21431 21498 +67
Misses 1497 1497
Partials 622 622
Continue to review full report at Codecov.
|
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.
Thanks @ss62171, looks good. Could you add a small test that it's not plotting on the current axes if ax
is not provided, and update CHANGELOG?
small test like do i have to test on my jupyter notebook and then attach screenshot or some other way? |
Sorry for the late reply @ss62171. Could you please add a test in |
@lilyminium is it |
@ss62171 Yes it's |
@lilyminium is this fine? |
da4772e
to
6594e76
Compare
|
||
def test_current_axes(self, p_run): | ||
ax2 = p_run.plot() | ||
fig, ax = plt.subplots() |
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.
Thanks for changing this -- however, because you create this after you call .plot()
, again, the test will always pass but for the wrong reasons. You want to test that .plot()
does not get your current axes that you have already created before calling .plot()
.
bb29e09
to
b31498d
Compare
@lilyminium I ran this test in my jupyter-notebook and it's working fine but as soon as i test this using pytest it's failing. Is there any build required for test or something else. Attached is screenshot of jupyter-notebook. |
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.
@ss62171 Your changes look great! Travis is failing due to an unrelated error -- I guess we'll need to fix that first.
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.
Almost all good, just some small comments.
package/CHANGELOG
Outdated
@@ -65,9 +65,11 @@ Fixes | |||
argument. The directives parsed into bonds, angles, impropers, and dihedrals now | |||
match TPRParser. (PR #2408) | |||
* Added parmed to setup.py | |||
* PersistenceLength.plot() now grab new axes if current axes not provided (Issue #2590) |
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.
Put it under Enhancements, I wouldn't call it a "fix" – it improves the user experience but the problem did not lead to wrong results or crashes.
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.
Also add your gitgub handle at the end of the author list for "0.21" (if you are not there already)
@lilyminium any idea like how to resolve this since I'm assuming this needs to be done for every parameter passed to the function. |
…persistence_axes
71b26b5
to
05950ca
Compare
@ss62171 sorry for the long silence. Can you try merging the latest develop into this branch? I think this issue was fixed recently. |
…persistence_axes
f4ee126
to
ea17ce3
Compare
@orbeckst after merging my branch to latest develop it still fails the test but in my jupyter-notebook it's working fine. |
off topic, am i late for draft proposal for GSOC? |
Which test is failing? By the way, editing comments is confusing: in my email I see a figure of a plot that clearly shows wrong behavior and then I come to the issue and see a screen shot from a notebook without a plot. Let's keep things less confusing: Just post a new issue. If you feel you must edit an issue, cross out what you don't want, add text saying "EDIT" or "UPDATE" and write the new thing to keep context. Remember, that people interact with the issue tracker in many different ways and for many core developers it's through the email messages, not the web interface. Right now I have no idea what the problem is. Can you please explain clearly? |
If it's off-topic then that's an excellent question for the mailing list. UPDATE: see https://groups.google.com/d/msg/mdnalysis-devel/4_ke-xNO-bU/2xZE02lsAwAJ |
So basically PersistenceLength.plot() grabs the current axes instead of creating a new figure,so you can end up with it plotting over something else unintentionally like in this attached figure Hence i created new axes if no axes are passed to PersistenceLength.Plot() and added test for same. This test passes on my local notebook as shown in attached pic but failed on pytest (due to some upgrade in it's version). I merged my branch with latest develop branch but still same behavior is shown.
As @lilyminium suggested this is somewhat unrelated error.Now I am stuck at how to resolve this failing of travis. |
All tests passed 👍 so it does not look like as if the "unrelated test error" #2591 (comment) is still present. |
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.
You deleted CHANGELOG, please bring it back.
Please also address my remaining comment. Or if you think that my comment does not make sense, start a discussion.
If you haven't done so already:
- add an entry to CHANGELOG
- add yourself to AUTHORS
package/CHANGELOG
Outdated
@@ -1,2226 +0,0 @@ | |||
# -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*- |
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.
You must have deleted CHANGELOG by accident. Bring it back!!!!
Yeah that 'unrelated error' is resolved however I added a test that is failing via pytest. But testing this using jupyter-notebook it seems to work. Here I am attaching pics of pytest output and my local jupyter-notebook for reference. I hope this clears my issue :) |
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.
CHANGELOG got messed up, see comments. Please restore it. Check the diff to develop (e.g., looking at Files changed – you should only see the changes that directly relate to your PR.)
package/CHANGELOG
Outdated
@@ -16,21 +16,11 @@ The rules for this file: | |||
mm/dd/yy richardjgowers, kain88-de, lilyminium, p-j-smith, bdice, joaomcteixeira, | |||
PicoCentauri, davidercruz, jbarnoud, RMeli, IAlibay, mtiberti, CCook96, | |||
Yuan-Yu, xiki-tempula, HTian1997, Iv-Hristov, hmacdope, AnshulAngaria, | |||
ss62171, Luthaf, yuxuanzhuang, abhishandy, mlnance, shfrz, orbeckst, | |||
wvandertoorn |
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.
do not delete lines from CHANGELOG
Your test appears to be passing on Travis and that's the primary concern when we run the tests because we know that the environment is set up correctly on Travis (and AppVeyor). Maybe you're not using a developer installation or you didn't reinstall your updated code. What you're showing indicates that you pick up the correct code in your Jupyter Notebook but not when you run pytest. Perhaps pytest isn't installed in the same virtual environment... whatever it is, follow the User Guide instructions. I am also not sure if you should be running pytest inside the package/ directory. This could be a problem. |
Tests passed using pytest. |
@orbeckst can I import CHANGELOG file from develop branch to my branch? |
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 good now @ss62171, thanks! Please add your GitHub username to CHANGELOG and your name to AUTHORS.
@lilyminium already done. |
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 don’t see your username in CHANGELOG and AUTHORS. Everything else looks good.
@orbeckst this is my 2nd PR, i already added my name in AUTHORS and username in CHANGELOG during my 1st PR. Do i need to add it again? |
@ss62171 , apologies, I must have overlooked your previous additions to CHANGELOG and AUTHORS – of course you'll only have to add these once. I approved the PR. @lilyminium will do the rest. |
Oops, I missed your earlier contribution @ss62171. Thanks for the fix! |
Fixes #2590 : New axes are created if ax is not passed already.
Changes made in this Pull Request:
PR Checklist