diff --git a/AUTHORS b/AUTHORS index 4d7af39c..dd9fd338 100644 --- a/AUTHORS +++ b/AUTHORS @@ -58,6 +58,11 @@ year of their first commit. GitHub handle is optional. - Thomas Heavey (@theavey) - Andrej Berg (@andrejberg) + +2020 +---- + +- Yury Polyachenko (@polyachenkoya) We gratefully acknowledge code fixes contributed by @quantifiedcode-bot from Quantified Code https://www.quantifiedcode.com diff --git a/CHANGES b/CHANGES index 037b5f81..90050e86 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ CHANGELOG for GromacsWrapper ============================== +2020-xx-xx 0.8.1 + +* fixed: xvg._decimate used python-2.0-specific func_name() + 2019-xx-xx 0.8.1 orbeckst diff --git a/gromacs/fileformats/xvg.py b/gromacs/fileformats/xvg.py index ad54eb26..a6271788 100644 --- a/gromacs/fileformats/xvg.py +++ b/gromacs/fileformats/xvg.py @@ -1079,9 +1079,13 @@ def _decimate(self, func, a, maxpoints, **kwargs): out[i], out[0] = func(t, a[i], bins=maxpoints, **kwargs) if maxpoints == self.maxpoints_default: # only warn if user did not set maxpoints + 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, func.func_name), + % (ny, maxpoints, maxpoints, funcname), category=AutoCorrectionWarning) return out