From 9a7924cf7f0ed8ea9528007bd6dce7205d9ea09e Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Tue, 28 Oct 2025 01:38:17 -0400 Subject: [PATCH 1/3] chore: remove noqas introduced during skpkg --- docs/source/conf.py | 6 +++--- src/diffpy/srxplanar/selfcalibrate.py | 3 ++- src/diffpy/srxplanar/srxplanarconfig.py | 3 ++- src/diffpy/srxplanar/version.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b86e8e3..c5cdd24 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# diffpy.srxplanar documentation build configuration file, created by # noqa: E501 +# diffpy.srxplanar documentation build configuration file, created by # sphinx-quickstart on Thu Jan 30 15:49:41 2014. # # This file is execfile()d with the current directory set to its @@ -22,11 +22,11 @@ try: fullversion = version("diffpy.srxplanar") except Exception: - fullversion = "No version found. The correct version will appear in the released version." # noqa: E501 + fullversion = "No version found. The correct version will appear in the released version." # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the -# documentation root, use Path().resolve() to make it absolute, like shown here. # noqa: E501 +# documentation root, use Path().resolve() to make it absolute, like shown here. # sys.path.insert(0, str(Path(".").resolve())) sys.path.insert(0, str(Path("../..").resolve())) sys.path.insert(0, str(Path("../../src").resolve())) diff --git a/src/diffpy/srxplanar/selfcalibrate.py b/src/diffpy/srxplanar/selfcalibrate.py index 2c3ea7b..b6f28dc 100644 --- a/src/diffpy/srxplanar/selfcalibrate.py +++ b/src/diffpy/srxplanar/selfcalibrate.py @@ -1,3 +1,4 @@ +import importlib from functools import partial import numpy as np @@ -6,7 +7,7 @@ rcParams["backend"] = "Qt4Agg" try: - import PySide # noqa: F401 + importlib.import_module("PySide") rcParams["backend.qt4"] = "PySide" import matplotlib.pyplot as plt diff --git a/src/diffpy/srxplanar/srxplanarconfig.py b/src/diffpy/srxplanar/srxplanarconfig.py index 0f8b5fe..b616587 100644 --- a/src/diffpy/srxplanar/srxplanarconfig.py +++ b/src/diffpy/srxplanar/srxplanarconfig.py @@ -505,7 +505,8 @@ class SrXplanarConfig(ConfigBase): - """Config class, based on ConfigBase class in diffpy.srxconfutils.""" + """Config class, based on ConfigBase class in + diffpy.srxconfutils.""" # Text to display before the argument help _description = _description diff --git a/src/diffpy/srxplanar/version.py b/src/diffpy/srxplanar/version.py index 3523646..0cdb9ed 100644 --- a/src/diffpy/srxplanar/version.py +++ b/src/diffpy/srxplanar/version.py @@ -7,7 +7,7 @@ # File coded by: Xiaohao Yang, Simon Billinge, Billinge Group members. # # See GitHub contributions for a more detailed list of contributors. -# https://github.com/diffpy/diffpy.srxplanar/graphs/contributors # noqa: E501 +# https://github.com/diffpy/diffpy.srxplanar/graphs/contributors # # See LICENSE.rst for license information. # From 075314c53a699c95ea05a86026bac4a8929c50da Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Tue, 28 Oct 2025 01:38:59 -0400 Subject: [PATCH 2/3] chore: add news file --- news/remove-noqa.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/remove-noqa.rst diff --git a/news/remove-noqa.rst b/news/remove-noqa.rst new file mode 100644 index 0000000..8aaa013 --- /dev/null +++ b/news/remove-noqa.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news added: Removed noqa comments + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From bfd86da27cb83facb994a4c4013b505a2dc1851b Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Tue, 28 Oct 2025 13:21:33 -0400 Subject: [PATCH 3/3] chore: use backend=qtagg to let matplotlib autodetect pyside6 if theyre installed --- src/diffpy/srxplanar/selfcalibrate.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/diffpy/srxplanar/selfcalibrate.py b/src/diffpy/srxplanar/selfcalibrate.py index b6f28dc..136aedc 100644 --- a/src/diffpy/srxplanar/selfcalibrate.py +++ b/src/diffpy/srxplanar/selfcalibrate.py @@ -1,25 +1,17 @@ -import importlib from functools import partial import numpy as np -from matplotlib import rcParams from scipy.optimize import leastsq, minimize -rcParams["backend"] = "Qt4Agg" try: - importlib.import_module("PySide") + from matplotlib import rcParams - rcParams["backend.qt4"] = "PySide" + rcParams["backend"] = "QtAgg" import matplotlib.pyplot as plt mplenabled = True except ImportError: - try: - import matplotlib.pyplot as plt - - mplenabled = True - except ImportError: - mplenabled = False + mplenabled = False def halfcut(