diff --git a/package/AUTHORS b/package/AUTHORS index 960e078a627..93dcb47b8a8 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -151,6 +151,7 @@ Chronological list of authors - Nicholas Craven - Mieczyslaw Torchala - Haochuan Chen + - Karthikeyan Singaravelan 2021 - Aditya Kamath diff --git a/package/CHANGELOG b/package/CHANGELOG index 590a7fb5fbc..e4be7bb036c 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -16,12 +16,13 @@ The rules for this file: ??/??/?? tylerjereddy, richardjgowers, IAlibay, hmacdope, orbeckst, cbouy, lilyminium, daveminh, jbarnoud, yuxuanzhuang, VOD555, ianmkenney, calcraven,xiki-tempula, mieczyslaw, manuel.nuno.melo, PicoCentauri, - hanatok, rmeli, aditya-kamath + hanatok, rmeli, aditya-kamath, tirkarthi * 2.0.0 Fixes - * atommethods(_get_prev/next_residues_by_resid) returns empty residue group when given empty residue group (Issue #3089) + * atommethods (_get_prev/next_residues_by_resid) returns empty residue group + when given empty residue group (Issue #3089) * MOL2 files without bonds can now be read and written (Issue #3057) * Write `CONECT` record only once in multi-model PDB files (Issue #3018) * Add '.nc' as a recognised extension for the NCDFWriter (Issue #3030) @@ -76,6 +77,7 @@ Fixes (Issue #2934) * Fix tests for analysis.bat that could fail when run in parallel and that would create a test artifact (Issue #2979, PR #2981) + * Fix syntax warning over comparison of literals using is (Issue #3066) Enhancements * Added automatic selection class generation for TopologyAttrs, diff --git a/package/MDAnalysis/analysis/legacy/x3dna.py b/package/MDAnalysis/analysis/legacy/x3dna.py index 35f8e317bce..6b519f1e77a 100644 --- a/package/MDAnalysis/analysis/legacy/x3dna.py +++ b/package/MDAnalysis/analysis/legacy/x3dna.py @@ -423,7 +423,7 @@ def plot(self, **kwargs): ax.set_xlabel(r"Nucleic Acid Number") param = self.profiles.values()[0].dtype.names[k] if param in ["Shear", "Stretch", "Stagger", "Rise", "Shift", "Slide"]: - ax.set_ylabel("{0!s} ($\AA$)".format((param))) + ax.set_ylabel(r"{!s} ($\AA$)".format(param)) else: ax.set_ylabel("{0!s} (deg)".format((param))) ax.figure.savefig("{0!s}.png".format((param))) diff --git a/testsuite/MDAnalysisTests/lib/test_util.py b/testsuite/MDAnalysisTests/lib/test_util.py index 1f16feb7760..6e00870217d 100644 --- a/testsuite/MDAnalysisTests/lib/test_util.py +++ b/testsuite/MDAnalysisTests/lib/test_util.py @@ -1474,7 +1474,7 @@ def test_static_variables(self): @static_variables(foo=0, bar={'test': x}) def myfunc(): - assert myfunc.foo is 0 + assert myfunc.foo == 0 assert type(myfunc.bar) is type(dict()) if 'test2' not in myfunc.bar: myfunc.bar['test2'] = "a" @@ -1488,14 +1488,14 @@ def myfunc(): y = myfunc() assert y is x - assert x[0] is 1 - assert myfunc.bar['test'][0] is 1 + assert x[0] == 1 + assert myfunc.bar['test'][0] == 1 assert myfunc.bar['test2'] == "a" x = [0] y = myfunc() assert y is not x - assert myfunc.bar['test'][0] is 2 + assert myfunc.bar['test'][0] == 2 assert myfunc.bar['test2'] == "aa" @@ -1536,7 +1536,7 @@ def outer(group): assert atoms.isunique with pytest.warns(None) as w: x = outer(atoms) - assert x is 0 + assert x == 0 assert not w.list # Check that a warning is raised for a group with duplicates: @@ -1548,7 +1548,7 @@ def outer(group): # Assert that the "warned" state is restored: assert warn_if_not_unique.warned is False # Check correct function execution: - assert x is 0 + assert x == 0 # Only one warning must have been raised: assert len(w) == 1 # For whatever reason pytest.warns(DuplicateWarning, match=msg) @@ -1602,7 +1602,7 @@ def outer(group): # Assert that the "warned" state is restored: assert warn_if_not_unique.warned is False # Check correct function execution: - assert x is 0 + assert x == 0 # Only one warning must have been raised: assert len(w) == 1 assert w[0].message.args[0] == msg