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
Python3 #127
Python3 #127
Conversation
The Python 2.7 tests fail because of
The Python 3 tests have problems installing Gromacs. I am looking into 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.
@kain88-de can you think of a replacement for six.long()
– it does not exist in the installed six.
The DataFrame.sort()
error has been fixed in develop so this should be ok with a rebase. The Gromacs installation issues were raised in Becksteinlab/conda-gromacs-5.1.2#9 and Becksteinlab/conda-gromacs-5.1.2#10 (for Gromacs 5.1.2) and Becksteinlab/conda-gromacs-4.6.7#3 and Becksteinlab/conda-gromacs-4.6.7#4 (for 4.6.7).
gromacs/cbook.py
Outdated
@@ -974,7 +975,7 @@ def edit_txt(filename, substitutions, newname=None): | |||
else: | |||
logger.debug("Deleting line %r", line) | |||
|
|||
target.seek(0L) | |||
target.seek(six.long(0)) |
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.
six.long()
does not exist in six
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.
In [4]: six.long
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-daab08199c2e> in <module>()
----> 1 six.long
AttributeError: 'module' object has no attribute 'long'
In [5]: six.__version__
Out[5]: '1.11.0'
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 think we actually need the longs... so I am removing them.
gromacs/cbook.py
Outdated
@@ -1040,7 +1041,7 @@ def remove_molecules_from_topology(filename, **kwargs): | |||
continue # remove by skipping | |||
target.write(line) | |||
if autogenerated and n_removed > 0: | |||
target.seek(0L) | |||
target.seek(six.long(0)) |
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.
six.long()
does not exist in six
gromacs/run.py
Outdated
@@ -332,7 +333,7 @@ def check_mdrun_success(logfile): | |||
except IOError: | |||
return None | |||
try: | |||
log.seek(-1024L, 2) | |||
log.seek(six.long(-1024), 2) |
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.
six.long()
does not exist in six
If it works without the longs I would not use them anymore. Looks like the challenge now is python3 for your gromacs packages. I'm not sure what you mean by the DataFrame.sort issue. |
Some tests used DataFrame.sort(), which does not exist anymore. But I fixed that.
As you said, the Gromacs conda packages are the issue. The Gromacs devs are interested in creating their own conda packages but until that happens I still have to do something. When we hacked together our Gromacs conda packages we did not know about conda-forge but we should probably have invested the time to learn about it---it would be super-convenient if conda-forge could build the packages.
…--
Oliver Beckstein
email: orbeckst@gmail.com
Am Apr 30, 2018 um 23:43 schrieb Max Linke ***@***.***>:
If it works without the longs I would not use them anymore. Looks like the challenge now is python3 for your gromacs packages. I'm not sure what you mean by the DataFrame.sort issue.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
oh yeah this was replaced by about the gromacs packages. Are there some emails about this on the mailing list? We do have some good contacts conda-forge to help out with this. |
No, that wasn't a public discussion. I can email you offline if you like. |
you can email me offline thanks. |
Codecov Report
@@ Coverage Diff @@
## develop #127 +/- ##
===========================================
+ Coverage 48.14% 48.28% +0.13%
===========================================
Files 24 24
Lines 4831 4836 +5
Branches 731 733 +2
===========================================
+ Hits 2326 2335 +9
+ Misses 2352 2341 -11
- Partials 153 160 +7
Continue to review full report at Codecov.
|
yay so python3 is running for at least one gromacs version |
Ok so with the new packages from bioconda the tests seem to run. There are still failures but there is progress. |
@ianmkenney has the same problem with Gromacs 2018 on conda in PR #130. |
most things are done now. Some string handling issues are left. |
@orbeckst this now sets all failing jobs to be allowed to fail. The old tests still work. Would you like to merge this as is? The last issues are with string handling but that might be better handled by someone who has used GromacsWrapper more then I did (I only needed the xvg reader once) |
I'd like to get the Python 3/Gromacs 4.6.5 tests to pass so that this PR really fixes #44. I'll try to look at it over the next few days. |
I'm down to three errors now. The last ones fail when gromacs is rerun for amber forcefield. So something internally is messed up. Fixing these errors is not a lot more difficult then pocking in the debugger and some light googling. |
ok so yeah string handling fixes for python3 have broken python2 -.- |
d2d8693
to
9d20ea3
Compare
@ianmkenney do you know why the last three tests fail? |
I have no idea why these |
I would need some help to investigate those errors. It would be helpful to know the exact gromacs commands that are executed for this test in python 2.7 and 3.6. Without knowing the library it's not straightforward to understand the program flow that is happening. |
@ianmkenney did you have a chance to fixup the gromacs errors? |
@kain88-de I haven't had much time to look at this issue, I can take a look in the next couple of weeks hopefully |
Given our sluggish pace of development on GW (and the general "wild west coding" attitude in this project ;-) ) I would go ahead and merge and immediately raise an issue for Python 3.x correctness. It would be nice to merge with everything passing (#127 (comment)) but at least it will allow us to move forward. Any objections? |
I don't mind if you want to merge this. Just keep in mind I don't have much
time nor expertise to fix things in this project.
…On Mon, Jul 30, 2018 at 10:19 PM Oliver Beckstein ***@***.***> wrote:
Given our sluggish pace of development on GW (and the general "wild west
coding" attitude in this project ;-) ) I would go ahead and merge and
immediately raise an issue for Python 3.x correctness. It would be nice to
merge with everything passing (#127 (comment)
<#127 (comment)>)
but at least it will allow us to move forward.
Any objections?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#127 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEGnVv9MOUSMVZYELvZX_B3o57if-p_5ks5uL2pVgaJpZM4TlNNC>
.
|
I totally understand. |
there are still some Grompp errors I don't know about
Code used to have 0L and -1024L but this is not supported in Py3 and it does not seem to be necessary in Py2 as shown in the docs https://docs.python.org/2/library/stdtypes.html#file.seek
- use binary mode reading and writing when necessary - replace map operator - explicit list - fix run - fix pickling - .... and more
I am rewriting the history to clean up the commits. I will force-push to your branch and then merge. |
except for two unit tests everything passes. Most changes should be harmless except for the tool registry, could be I broke that. But changing a dict during iteration isn't allowed in python 3 anymore.
fixes #44