From 960c43d4b965997f24084fe3c66cb529bbc568e5 Mon Sep 17 00:00:00 2001 From: Stuart Prescott Date: Sat, 16 Jan 2021 01:26:32 +1100 Subject: [PATCH 1/5] Be explicit in file preprocessing --- docs/sphinx-docs/build_sphinx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sphinx-docs/build_sphinx.py b/docs/sphinx-docs/build_sphinx.py index 0d731abc50..cb9023a1f7 100755 --- a/docs/sphinx-docs/build_sphinx.py +++ b/docs/sphinx-docs/build_sphinx.py @@ -70,14 +70,14 @@ def inplace_change(filename, old_string, new_string): # Thanks to http://stackoverflow.com/questions/4128144/replace-string-within-file-contents s=open(filename).read() if old_string in s: - print('Changing "{old_string}" to "{new_string}"'.format(**locals())) + print('Changing "{old_string}" to "{new_string}" in {filename}'.format(**locals())) s=s.replace(old_string, new_string) f=open(filename, 'w') f.write(s) f.flush() f.close() else: - print('No occurrences of "{old_string}" found.'.format(**locals())) + print('No occurrences of "{old_string}" found in {filename}.'.format(**locals())) def _remove_dir(dir_path): """Removes the given directory.""" From 5355c9bb94b8aa5c1ed4a8de2841946cc7d1828c Mon Sep 17 00:00:00 2001 From: Stuart Prescott Date: Sat, 16 Jan 2021 01:26:50 +1100 Subject: [PATCH 2/5] Add Gamma to list of unicode characters for LaTeX --- docs/sphinx-docs/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sphinx-docs/source/conf.py b/docs/sphinx-docs/source/conf.py index 32172bcea9..d49bf86097 100644 --- a/docs/sphinx-docs/source/conf.py +++ b/docs/sphinx-docs/source/conf.py @@ -228,6 +228,7 @@ \newcommand{\gt}{>} % HTML needs \gt rather than > \renewcommand{\AA}{\text{\r{A}}} % Allow \AA in math mode \DeclareUnicodeCharacter {212B} {\AA} % Angstrom +\DeclareUnicodeCharacter {0393} {\ensuremath{\Gamma}} % Gamma \DeclareUnicodeCharacter {00B7} {\ensuremath{\cdot}} % cdot \DeclareUnicodeCharacter {00B0} {\ensuremath{^\circ}} % degrees """ From aefd856bc68fae9b7c9de003fb2f44c04357da73 Mon Sep 17 00:00:00 2001 From: Stuart Prescott Date: Sat, 16 Jan 2021 01:27:48 +1100 Subject: [PATCH 3/5] Fix incorrect use of 'is' comparison --- src/sas/qtgui/Calculators/DataOperationUtilityPanel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sas/qtgui/Calculators/DataOperationUtilityPanel.py b/src/sas/qtgui/Calculators/DataOperationUtilityPanel.py index f2c4afb1dc..e1c7d817e4 100644 --- a/src/sas/qtgui/Calculators/DataOperationUtilityPanel.py +++ b/src/sas/qtgui/Calculators/DataOperationUtilityPanel.py @@ -267,7 +267,7 @@ def onInputCoefficient(self): if self.txtNumber.isModified(): input_to_check = str(self.txtNumber.text()) - if input_to_check is None or input_to_check is '': + if input_to_check is None or input_to_check == '': msg = 'DataOperation: Number requires a float number' logging.warning(msg) self.txtNumber.setStyleSheet(BG_RED) From be75b27146d03d34bdcfd3951d7ab8f4bc3dcc16 Mon Sep 17 00:00:00 2001 From: Stuart Prescott Date: Sat, 16 Jan 2021 01:28:16 +1100 Subject: [PATCH 4/5] Fix incorrect assertion --- src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py b/src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py index e7e10d4539..7badb1d122 100644 --- a/src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py +++ b/src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py @@ -549,7 +549,7 @@ def getTabByName(self, name): """ Returns the tab with with attribute name *name* """ - assert(name, str) + assert isinstance(name, str) for tab in self.tabs: if tab.modelName() == name: return tab From 5c4fa83b3db1494b51600e0038876c34f9e9f4e3 Mon Sep 17 00:00:00 2001 From: Stuart Prescott Date: Sat, 16 Jan 2021 01:28:47 +1100 Subject: [PATCH 5/5] Fix typo in comment --- src/sas/sascalc/fit/Loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sas/sascalc/fit/Loader.py b/src/sas/sascalc/fit/Loader.py index f2a99877e4..255e0345fe 100644 --- a/src/sas/sascalc/fit/Loader.py +++ b/src/sas/sascalc/fit/Loader.py @@ -1,6 +1,6 @@ from __future__ import print_function -# class Loader to load any king of file +# class Loader to load any kind of file #import wx #import string import numpy as np