-
Notifications
You must be signed in to change notification settings - Fork 54
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
func.func_name is not used in Python 3 #183
Comments
Why do you need to run 2to3? GW runs in Python 3 as well as in 2. Or do you have a particular issue with Python 3, i.e., does XVG fail in some way? If so, raise an issue for that specific bug, please. |
I do have an issue with XVG, yes. As I wrote in the initial git-post, XVG
has func_name, but there is no such a thing in 3.0, but there is a
fun.__name__ instead.
…On Sat, Jul 25, 2020, 02:24 Oliver Beckstein ***@***.***> wrote:
Why do you need to run 2to3? GW runs in Python 3 as well as in 2. Or do
you have a particular issue with Python 3, i.e., does XVG fail in some way?
If so, raise an issue for that specific bug, please.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#183 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJB7VUSABOZRTCH4FYYQSVTR5IJZVANCNFSM4PGUS36A>
.
|
Ok: need to change GromacsWrapper/gromacs/fileformats/xvg.py Line 1084 in 79e5594
try:
funcname = func.func_name # Python 2
except AttributeError:
funcname = func.__name__ # Python 3
warnings.warn("Plot had %d datapoints > maxpoints = %d; decimated to %d regularly "
"spaced points from the histogrammed data with %s()."
% (ny, maxpoints, maxpoints, funcname),
category=AutoCorrectionWarning) |
OK, thanks! done.
…On Tue, Jul 28, 2020 at 12:50 PM Oliver Beckstein ***@***.***> wrote:
Ok: need to change
https://github.com/Becksteinlab/GromacsWrapper/blob/79e5594fd2af8e3f4c04f7d1af8b23bf93ccc113/gromacs/fileformats/xvg.py#L1084
to
try:
funcname = func.func_name # Python 2
except AttributeError:
funcname = func.__name__ # Python 3
warnings.warn("Plot had %d datapoints > maxpoints = %d; decimated to %d regularly "
"spaced points from the histogrammed data with %s()."
% (ny, maxpoints, maxpoints, funcname),
category=AutoCorrectionWarning)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#183 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJB7VUU5Q4LGTK7XHKZMWUDR52NN7ANCNFSM4PGUS36A>
.
|
orbeckst
pushed a commit
that referenced
this issue
Jul 29, 2020
* fix #183 * gromacs/fileformats/xvg.py: func_name support for python 3.0 added * AUTHORS and CHANGES updated
orbeckst
added a commit
that referenced
this issue
Sep 3, 2020
- close #190 - add @PolyachenkoYA to CHANGES - add note for fix in PR #186 - reference #183
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
File
fileformats/xvg.py
hasfunc_name
which was replaced withfunc.__name__
in python 3.0.I thought it would be safer to run 2to3 on all files so I ran
2to3 -w ./*
in
~/anaconda3/lib/python3.7/site-packages/gromacs
and it failed withImportError: cannot import name 'namedtuple' from 'collections' (/home/ypolyach/anaconda3/lib/python3.7/site-packages/gromacs/collections.py)
. Turns out python has https://docs.python.org/3/library/collections.html so2to3
fails to run in a directory which has acollections.py
in it.So, the problem:
2to3
must be run on some files ingromacs/*
but it fails because ofcollections.py
naming.The text was updated successfully, but these errors were encountered: