diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e46f3b94..98e9ffbf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: main: strategy: matrix: - python: ['3.8', '3.9', '3.10', '3.11'] + python: ['3.9', '3.10', '3.11', '3.12', '3.13'] runs-on: ubuntu-latest name: Python ${{ matrix.python }} steps: diff --git a/gamera/gui/gui_util.py b/gamera/gui/gui_util.py index 7d334b62..3a3ec8bf 100644 --- a/gamera/gui/gui_util.py +++ b/gamera/gui/gui_util.py @@ -232,8 +232,8 @@ def code_block(name, arguments, options, content, lineno, def docstring_to_html(docstring): try: - corrected = docstring.replace("*args", "\*args") - corrected = corrected.replace("**kwargs", "\*\*kwargs") + corrected = docstring.replace("*args", r"\*args") + corrected = corrected.replace("**kwargs", r"\*\*kwargs") html = docutils.core.publish_string(corrected, writer_name="html") except Exception as e: html = '''
%s

%s
''' % (docstring, str(e)) diff --git a/gamera/io.py b/gamera/io.py index dd2b8f6d..cbcadabc 100644 --- a/gamera/io.py +++ b/gamera/io.py @@ -229,7 +229,7 @@ def getstrings (namepattern,verbose=1): def getcsv (namepatterns, delimiter='\t', verbose=1): - """ + r""" Loads a list of lists from text files (specified by a UNIX-style wildcard filename pattern) and converts all numeric values to floats. Uses the glob module for filename pattern conversion. Loaded filename diff --git a/gamera/plugins/contour.py b/gamera/plugins/contour.py index af8fe8cc..02c3d905 100644 --- a/gamera/plugins/contour.py +++ b/gamera/plugins/contour.py @@ -78,8 +78,8 @@ class contour_samplepoints(PluginFunction): equidistant on the contour. *contour*: - when 0 (\"outer_projection\"), the points returned by *contour_left* etc. - are used; when 1 (\"full_contour\") the points returned by *outline(1)* + when 0 ("outer_projection"), the points returned by *contour_left* etc. + are used; when 1 ("full_contour") the points returned by *outline(1)* are used. In addition to the points determined by the percentage argument the result @@ -108,7 +108,7 @@ def __call__(self, percentage=25, contourtype=0): __call__ = staticmethod(__call__) class contour_pavlidis(PluginFunction): - """ + r""" Returns a point list of the outer contour trace found with Pavlidis' algorithm (T. Pavlidis: *Algorithms for Grapics and Image Processing.* pp. 129-165, Springer, 1982). diff --git a/gamera/plugins/edgedetect.py b/gamera/plugins/edgedetect.py index a007159f..f67eb94a 100644 --- a/gamera/plugins/edgedetect.py +++ b/gamera/plugins/edgedetect.py @@ -148,9 +148,9 @@ def __call__(self, mark_both=False): class outline(PluginFunction): """ - Traces the outline of the image. When *which* is 0 (\"outer\"), + Traces the outline of the image. When *which* is 0 ("outer"), the result is obtained by dilating the image and then XOR'ing the - result with the original; when *which* is 1 (\"inner\"), the result + result with the original; when *which* is 1 ("inner"), the result is obtained by eroding the image and then XOR'ing the result with the original. """ diff --git a/gamera/plugins/features.py b/gamera/plugins/features.py index bca3c972..3c179240 100644 --- a/gamera/plugins/features.py +++ b/gamera/plugins/features.py @@ -57,7 +57,7 @@ class moments(Feature): center of gravity on *x* and *y* axis normalized by width and height, respectively. The following seven entries are the *normalized central moments* (*u20,u02,u11,u30,u12,u21,u03*). For their - definition, see Gonzalez, Woods: \"Digital Image Processing\", + definition, see Gonzalez, Woods: "Digital Image Processing", Prentice Hall, second edition (2002). +---------------------------+ @@ -230,7 +230,7 @@ class compactness(Feature): class volume16regions(Feature): """ Divides the image into a 4 x 4 grid of 16 regions and calculates - the volume within each. This feature is also known as \"zoning\" method. + the volume within each. This feature is also known as "zoning" method. +---------------------------+ | **Invariant to:** | @@ -246,7 +246,7 @@ class volume16regions(Feature): class volume64regions(Feature): """ Divides the image into an 8 x 8 grid of 64 regions and calculates - the volume within each. This feature is also known as \"zoning\" method. + the volume within each. This feature is also known as "zoning" method. +---------------------------+ | **Invariant to:** | @@ -272,8 +272,8 @@ class zernike_moments(Feature): The present implementation normalizes the Zernike moments by division with the zeroeth geometric moment *m00*, which results in an approximate scale invariance according to - S. Belkasim, E. Hassan, T. Obeidi: \"Explicit invariance of Cartesian - Zernike moments.\" Pattern Recognition Letters 28, pp. 1969-1980 (2007) + S. Belkasim, E. Hassan, T. Obeidi: "Explicit invariance of Cartesian + Zernike moments." Pattern Recognition Letters 28, pp. 1969-1980 (2007) The return values are the absolute values of *A20, A22, A31, A33, A40, A42, A44, A51, A53, A54, A60, A62, A64, A66*. @@ -307,8 +307,8 @@ class zernike_moments_plugin(PluginFunction): The present implementation normalizes the Zernike moments by division with the zeroeth geometric moment *m00*, which results in an approximate scale invariance according to - S. Belkasim, E. Hassan, T. Obeidi: \"Explicit invariance of Cartesian - Zernike moments.\" Pattern Recognition Letters 28, pp. 1969-1980 (2007) + S. Belkasim, E. Hassan, T. Obeidi: "Explicit invariance of Cartesian + Zernike moments." Pattern Recognition Letters 28, pp. 1969-1980 (2007) The return values are the absolute values of *A20, A22, A31, A33, A40, A42, A44, A51, A53, A54, A60, A62, A64, A66*. diff --git a/gamera/plugins/geometry.py b/gamera/plugins/geometry.py index 73b520bb..f8b9c8fd 100644 --- a/gamera/plugins/geometry.py +++ b/gamera/plugins/geometry.py @@ -223,7 +223,7 @@ class graph_color_ccs(PluginFunction): Reference: C. Dalitz, T. Bolten, O. Christion: - `\"Color Visualization of 2D Segmentations.\"`__ + `"Color Visualization of 2D Segmentations."`__ International Conference on Information Visualization Theory and Applications (IVAPP), pp. 567-572 (2013) @@ -357,7 +357,7 @@ class max_empty_rect(PluginFunction): ``RuntimeError`` is thrown. The coordinates of the returned rectangle are relative to the upper left corner of the image. -Reference: D. Vandevoorde: `\"The Maximal Rectangle Problem.\"`__ Dr. Dobb's, +Reference: D. Vandevoorde: `"The Maximal Rectangle Problem."`__ Dr. Dobb's, April 1998. .. __: http://www.drdobbs.com/database/184410529 diff --git a/gamera/plugins/image_utilities.py b/gamera/plugins/image_utilities.py index 9231cfe9..2f690b6e 100644 --- a/gamera/plugins/image_utilities.py +++ b/gamera/plugins/image_utilities.py @@ -291,8 +291,8 @@ class diff_images(PluginFunction): Returns a color image representing the difference of two images following the conventions of a number of Unix diff visualization tools, such as CVS web. Pixels in both images are black. Pixels - in 'self' but not in the given image (\"deleted\" pixels) are red. - Pixels in the given image but not in self (\"inserted\" pixels) + in 'self' but not in the given image ("deleted" pixels) are red. + Pixels in the given image but not in self ("inserted" pixels) are green. """ category = "Combine" diff --git a/gamera/plugins/listutilities.py b/gamera/plugins/listutilities.py index 3728ebdc..272af40f 100644 --- a/gamera/plugins/listutilities.py +++ b/gamera/plugins/listutilities.py @@ -113,7 +113,7 @@ class median_py(PluginFunction): class kernel_density(PluginFunction): """Computes the kernel density for *values* at the specified -*x*-positions. Reference: S.J. Sheather: \"Density Estimation.\" +*x*-positions. Reference: S.J. Sheather: "Density Estimation." Statistical Science 19 pp. 588-597 (2004). Arguments: diff --git a/gamera/plugins/pagesegmentation.py b/gamera/plugins/pagesegmentation.py index 84d0321b..d6148711 100644 --- a/gamera/plugins/pagesegmentation.py +++ b/gamera/plugins/pagesegmentation.py @@ -444,12 +444,12 @@ class textline_reading_order(PluginFunction): the following criteria for the pairwise order of two lines: - line *a* comes before line *b* when *a* is totally to the left - of *b* (order \"column before row\") + of *b* (order "column before row") - line *a* comes before *b* when both overlap horizontally and *a* is above *b* (order within a column) - In the reference `\"High Performance Document Analysis\"`__ + In the reference `"High Performance Document Analysis"`__ by T.M. Breuel (Symposium on Document Image Understanding, USA, pp. 209-218, 2003), an additional constraint is made for the first criterion by demanding diff --git a/gamera/plugins/threshold.py b/gamera/plugins/threshold.py index 36f9f916..9f791d14 100644 --- a/gamera/plugins/threshold.py +++ b/gamera/plugins/threshold.py @@ -238,8 +238,8 @@ def __call__(image, smoothness=0.2, max_block_size=512, min_block_size=64, class soft_threshold(PluginFunction): """ - Does a greyscale transformation that \"smears out\" the threshold *t* by a - choosable amount *sigma*. This has the effect of a \"soft\" thresholding. + Does a greyscale transformation that "smears out" the threshold *t* by a + choosable amount *sigma*. This has the effect of a "soft" thresholding. Each grey value *x* is transformed to *F(x,t,sigma)*, where *F* is the CDF probability distribution with mean *t* and variance @@ -257,7 +257,7 @@ class soft_threshold(PluginFunction): .. __: #otsu-find-threshold - Reference: C. Dalitz: `\"Soft Thresholding for Visual Image Enhancement.\"`__ + Reference: C. Dalitz: `"Soft Thresholding for Visual Image Enhancement."`__ Technischer Bericht Nr. 2014-01, Hochschule Niederrhein, Fachbereich Elektrotechnik und Informatik, 2014 @@ -281,7 +281,7 @@ class soft_threshold_find_sigma(PluginFunction): determined such that *F(m,t,sigma)* = 0.99, where *m* is the mean grey value of all pixels with a grey value greater than *t*. - Reference: C. Dalitz: `\"Soft Thresholding for Visual Image Enhancement.\"`__ + Reference: C. Dalitz: `"Soft Thresholding for Visual Image Enhancement."`__ Technischer Bericht Nr. 2014-01, Hochschule Niederrhein, Fachbereich Elektrotechnik und Informatik, 2014 diff --git a/gamera/pstat.py b/gamera/pstat.py index dc4fd2e7..ab61f454 100644 --- a/gamera/pstat.py +++ b/gamera/pstat.py @@ -392,7 +392,7 @@ def linexor (listoflists,columnlist,valuelist): def linedelimited (inlist,delimiter): - """ + r""" Returns a string composed of elements in inlist, with each element separated by 'delimiter.' Used by function writedelimited. Use '\t' for tab-delimiting. @@ -488,7 +488,7 @@ def makestr (x): def printcc (lst,extra=2): - """ + r""" Prints a list of lists in columns, customized by the max size of items within the columns (max size of items in col, plus 'extra' number of spaces). Use 'dashes' or '\\n' in the list-of-lists to print dashes or blank lines, diff --git a/gamera/ruleengine.py b/gamera/ruleengine.py index 1fa1a21d..b96cedb8 100644 --- a/gamera/ruleengine.py +++ b/gamera/ruleengine.py @@ -25,7 +25,7 @@ from gamera import group, util from .fudge import Fudge -"""This module provides tools for applying graph-rewriting rules to a +r"""This module provides tools for applying graph-rewriting rules to a set of glyphs. It would seem nice to invent a completely new language for this task