瀏覽代碼

Update to Black 21.5b1 (#1605)

* Apply Black to 3 previously excluded files (due to now resolved bugs in Black).
* Black now modifies one-line docstrings which have leading or trailing spaces.
* Remove empty docstrings (remove, replace by pass, replace by text).
* Add Python 3.9 to target versions.
* Properly exclude bin and dist dirs.
* Add first line to test data function docstring to have a better docstring.
* Exclude pygrass/utils which contains an R-string lowercased to r in Black 21.5b1.
Vaclav Petras 3 年之前
父節點
當前提交
bac519d645
共有 45 個文件被更改,包括 1108 次插入1081 次删除
  1. 1 1
      .github/workflows/black.yml
  2. 1 1
      gui/wxpython/animation/mapwindow.py
  3. 1 1
      gui/wxpython/core/gconsole.py
  4. 2 2
      gui/wxpython/core/render.py
  5. 1 1
      gui/wxpython/datacatalog/catalog.py
  6. 1 1
      gui/wxpython/datacatalog/infomanager.py
  7. 1 1
      gui/wxpython/gui_core/gselect.py
  8. 3 3
      gui/wxpython/iclass/frame.py
  9. 0 1
      gui/wxpython/iscatt/dialogs.py
  10. 821 816
      gui/wxpython/lmgr/layertree.py
  11. 1 1
      gui/wxpython/nviz/animation.py
  12. 1 1
      gui/wxpython/psmap/dialogs.py
  13. 1 1
      gui/wxpython/psmap/utils.py
  14. 1 1
      gui/wxpython/rlisetup/wizard.py
  15. 2 2
      gui/wxpython/vnet/dialogs.py
  16. 2 2
      gui/wxpython/vnet/vnet_data.py
  17. 1 1
      gui/wxpython/vnet/widgets.py
  18. 2 2
      gui/wxpython/wxgui.py
  19. 1 1
      imagery/i.atcorr/create_iwave.py
  20. 2 2
      lib/init/grass.py
  21. 0 2
      man/parser_standard_options.py
  22. 8 9
      pyproject.toml
  23. 100 82
      python/grass/imaging/images2gif.py
  24. 6 6
      python/grass/imaging/images2swf.py
  25. 48 39
      python/grass/pygrass/raster/category.py
  26. 1 1
      python/grass/pygrass/raster/segment.py
  27. 2 1
      python/grass/pygrass/utils.py
  28. 0 1
      python/grass/pygrass/vector/geometry.py
  29. 0 1
      python/grass/pygrass/vector/table.py
  30. 1 1
      python/grass/temporal/temporal_algebra.py
  31. 1 1
      python/grass/temporal/temporal_granularity.py
  32. 22 22
      python/grass/temporal/testsuite/unittests_temporal_algebra.py
  33. 7 7
      python/grass/temporal/testsuite/unittests_temporal_algebra_grs.py
  34. 6 6
      python/grass/temporal/testsuite/unittests_temporal_algebra_mixed_stds.py
  35. 17 17
      python/grass/temporal/testsuite/unittests_temporal_conditionals.py
  36. 13 13
      python/grass/temporal/testsuite/unittests_temporal_raster_algebra.py
  37. 3 3
      python/grass/temporal/testsuite/unittests_temporal_vector_algebra.py
  38. 1 1
      raster/r.contour/testsuite/testrc.py
  39. 1 1
      raster/r.reclass/testsuite/test_r_reclass.py
  40. 5 5
      scripts/i.pansharpen/i.pansharpen.py
  41. 12 12
      temporal/t.rast.algebra/testsuite/test_raster_algebra.py
  42. 2 2
      temporal/t.vect.algebra/testsuite/test_vector_algebra.py
  43. 3 3
      vector/v.extract/testsuite/test_v_extract.py
  44. 2 2
      vector/v.select/testsuite/test_v_select.py
  45. 1 1
      vector/v.vect.stats/testsuite/test_vect_stats.py

+ 1 - 1
.github/workflows/black.yml

@@ -20,7 +20,7 @@ jobs:
       - name: Install
       - name: Install
         run: |
         run: |
           python -m pip install --upgrade pip
           python -m pip install --upgrade pip
-          pip install black==20.8b1
+          pip install black==21.5b1
 
 
       - name: Run Black
       - name: Run Black
         run: |
         run: |

+ 1 - 1
gui/wxpython/animation/mapwindow.py

@@ -213,7 +213,7 @@ class AnimationWindow(BufferedWindow):
         self.UpdateDrawing()
         self.UpdateDrawing()
 
 
     def ClearOverlay(self):
     def ClearOverlay(self):
-        """Clear overlay (legend) """
+        """Clear overlay (legend)"""
         Debug.msg(3, "AnimationWindow.ClearOverlay()")
         Debug.msg(3, "AnimationWindow.ClearOverlay()")
         self._overlay = None
         self._overlay = None
         self.bitmap_overlay = None
         self.bitmap_overlay = None

+ 1 - 1
gui/wxpython/core/gconsole.py

@@ -355,7 +355,7 @@ gIgnoredCmdRun, EVT_IGNORED_CMD_RUN = NewEvent()
 
 
 
 
 class GConsole(wx.EvtHandler):
 class GConsole(wx.EvtHandler):
-    """"""
+    """Backend for command execution, esp. interactive command execution"""
 
 
     def __init__(self, guiparent=None, giface=None, ignoredCmdPattern=None):
     def __init__(self, guiparent=None, giface=None, ignoredCmdPattern=None):
         """
         """

+ 2 - 2
gui/wxpython/core/render.py

@@ -352,7 +352,7 @@ class Layer(object):
         self.renderMgr.Abort()
         self.renderMgr.Abort()
 
 
     def GetRenderMgr(self):
     def GetRenderMgr(self):
-        """Get render manager """
+        """Get render manager"""
         return self.renderMgr
         return self.renderMgr
 
 
     def Clean(self):
     def Clean(self):
@@ -857,7 +857,7 @@ class Map(object):
         self.renderMgr = RenderMapMgr(self)
         self.renderMgr = RenderMapMgr(self)
 
 
     def GetRenderMgr(self):
     def GetRenderMgr(self):
-        """Get render manager """
+        """Get render manager"""
         return self.renderMgr
         return self.renderMgr
 
 
     def GetProjInfo(self):
     def GetProjInfo(self):

+ 1 - 1
gui/wxpython/datacatalog/catalog.py

@@ -52,7 +52,7 @@ class DataCatalog(wx.Panel):
         name="catalog",
         name="catalog",
         **kwargs,
         **kwargs,
     ):
     ):
-        """Panel constructor  """
+        """Panel constructor"""
         self.showNotification = Signal("DataCatalog.showNotification")
         self.showNotification = Signal("DataCatalog.showNotification")
         self.parent = parent
         self.parent = parent
         self.baseTitle = title
         self.baseTitle = title

+ 1 - 1
gui/wxpython/datacatalog/infomanager.py

@@ -101,7 +101,7 @@ class DataCatalogInfoManager:
         self.infoBar.ShowMessage(message, wx.ICON_INFORMATION, buttons)
         self.infoBar.ShowMessage(message, wx.ICON_INFORMATION, buttons)
 
 
     def _text_from_reason_id(self, reason_id):
     def _text_from_reason_id(self, reason_id):
-        """ Get string for infobar message based on the reason."""
+        """Get string for infobar message based on the reason."""
         last_used_mapset_path = gisenv()["LAST_MAPSET_PATH"]
         last_used_mapset_path = gisenv()["LAST_MAPSET_PATH"]
         reason = None
         reason = None
         if reason_id == "non-existent":
         if reason_id == "non-existent":

+ 1 - 1
gui/wxpython/gui_core/gselect.py

@@ -2662,7 +2662,7 @@ class VectorCategorySelect(wx.Panel):
         return True
         return True
 
 
     def _chckMap(self):
     def _chckMap(self):
-        """Check if selected map in 'input' widget is the same as selected map in lmgr """
+        """Check if selected map in 'input' widget is the same as selected map in lmgr"""
         if self._isMapSelected():
         if self._isMapSelected():
             layerList = self.giface.GetLayerList()
             layerList = self.giface.GetLayerList()
             layerSelected = layerList.GetSelectedLayer()
             layerSelected = layerList.GetSelectedLayer()

+ 3 - 3
gui/wxpython/iclass/frame.py

@@ -547,7 +547,7 @@ class IClassMapFrame(DoubleMapFrame):
         return "0:0:0"
         return "0:0:0"
 
 
     def OnZoomMenu(self, event):
     def OnZoomMenu(self, event):
-        """Popup Zoom menu """
+        """Popup Zoom menu"""
         zoommenu = Menu()
         zoommenu = Menu()
         # Add items to the menu
         # Add items to the menu
 
 
@@ -586,7 +586,7 @@ class IClassMapFrame(DoubleMapFrame):
         zoommenu.Destroy()
         zoommenu.Destroy()
 
 
     def OnZoomToTraining(self, event):
     def OnZoomToTraining(self, event):
-        """Set preview display to match extents of training display """
+        """Set preview display to match extents of training display"""
 
 
         if not self.MapWindow == self.GetSecondWindow():
         if not self.MapWindow == self.GetSecondWindow():
             self.MapWindow = self.GetSecondWindow()
             self.MapWindow = self.GetSecondWindow()
@@ -599,7 +599,7 @@ class IClassMapFrame(DoubleMapFrame):
         self.Render(self.GetSecondWindow())
         self.Render(self.GetSecondWindow())
 
 
     def OnZoomToPreview(self, event):
     def OnZoomToPreview(self, event):
-        """Set preview display to match extents of training display """
+        """Set preview display to match extents of training display"""
 
 
         if not self.MapWindow == self.GetFirstWindow():
         if not self.MapWindow == self.GetFirstWindow():
             self.MapWindow = self.GetFirstWindow()
             self.MapWindow = self.GetFirstWindow()

+ 0 - 1
gui/wxpython/iscatt/dialogs.py

@@ -194,7 +194,6 @@ class AddScattPlotDialog(wx.Dialog):
             self.sel_bands_ids.pop(sel)
             self.sel_bands_ids.pop(sel)
 
 
     def OnAdd(self, event):
     def OnAdd(self, event):
-        """"""
         b_x = self.band_1_ch.GetSelection()
         b_x = self.band_1_ch.GetSelection()
         b_y = self.band_2_ch.GetSelection()
         b_y = self.band_2_ch.GetSelection()
 
 

File diff suppressed because it is too large
+ 821 - 816
gui/wxpython/lmgr/layertree.py


+ 1 - 1
gui/wxpython/nviz/animation.py

@@ -171,7 +171,7 @@ class Animation:
         self.stopSaving = True
         self.stopSaving = True
 
 
     def IsSaved(self):
     def IsSaved(self):
-        """"Test if animation has been saved (to images)"""
+        """Test if animation has been saved (to images)"""
         return self.animationSaved
         return self.animationSaved
 
 
     def SaveAnimationFile(self, path, prefix, format):
     def SaveAnimationFile(self, path, prefix, format):

+ 1 - 1
gui/wxpython/psmap/dialogs.py

@@ -3047,7 +3047,7 @@ class VPropertiesDialog(PsmapDialog):
         return panel
         return panel
 
 
     def OnLayer(self, event):
     def OnLayer(self, event):
-        """Change columns on layer change """
+        """Change columns on layer change"""
         if self.layerChoice.GetStringSelection() == self.currLayer:
         if self.layerChoice.GetStringSelection() == self.currLayer:
             return
             return
         self.currLayer = self.layerChoice.GetStringSelection()
         self.currLayer = self.layerChoice.GetStringSelection()

+ 1 - 1
gui/wxpython/psmap/utils.py

@@ -90,7 +90,7 @@ class Rect2DPS(Rect2D):
 
 
 
 
 class UnitConversion:
 class UnitConversion:
-    """ Class for converting units"""
+    """Class for converting units"""
 
 
     def __init__(self, parent=None):
     def __init__(self, parent=None):
         self.parent = parent
         self.parent = parent

+ 1 - 1
gui/wxpython/rlisetup/wizard.py

@@ -917,7 +917,7 @@ class DrawSampleFramePage(TitledPage):
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnExitPage)
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnExitPage)
 
 
     def SampleFrameChanged(self, region):
     def SampleFrameChanged(self, region):
-        """"Enables the next dialog when region is set"""
+        """Enables the next dialog when region is set"""
         if region:
         if region:
             self.tregion = region
             self.tregion = region
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)

+ 2 - 2
gui/wxpython/vnet/dialogs.py

@@ -611,7 +611,7 @@ class VNETDialog(wx.Dialog):
         self.Layout()
         self.Layout()
 
 
     def _updateDbMgrData(self):
     def _updateDbMgrData(self):
-        """Updates input/result tables page """
+        """Updates input/result tables page"""
         if self.notebook.GetSelection() == self.notebook.GetPageIndexByName(
         if self.notebook.GetSelection() == self.notebook.GetPageIndexByName(
             "inputDbMgr"
             "inputDbMgr"
         ):
         ):
@@ -1099,7 +1099,7 @@ class VNETDialog(wx.Dialog):
 
 
 class PtsList(PointsList):
 class PtsList(PointsList):
     def __init__(self, parent, vnet_mgr, id=wx.ID_ANY):
     def __init__(self, parent, vnet_mgr, id=wx.ID_ANY):
-        """ List with points for analysis"""
+        """List with points for analysis"""
         self.updateMap = True
         self.updateMap = True
         self.vnet_mgr = vnet_mgr
         self.vnet_mgr = vnet_mgr
         self.pts_data = self.vnet_mgr.GetPointsManager()
         self.pts_data = self.vnet_mgr.GetPointsManager()

+ 2 - 2
gui/wxpython/vnet/vnet_data.py

@@ -722,7 +722,7 @@ class VNETAnalysisParameters:
 
 
 class VNETAnalysesProperties:
 class VNETAnalysesProperties:
     def __init__(self):
     def __init__(self):
-        """Initializes parameters for different v.net.* modules """
+        """Initializes parameters for different v.net.* modules"""
         # initialization of v.net.* analysis parameters (data which
         # initialization of v.net.* analysis parameters (data which
         # characterizes particular analysis)
         # characterizes particular analysis)
 
 
@@ -994,7 +994,7 @@ class VectMap:
         self.DeleteRenderLayer()
         self.DeleteRenderLayer()
 
 
     def AddRenderLayer(self, cmd=None, colorsCmd=None):
     def AddRenderLayer(self, cmd=None, colorsCmd=None):
-        """Add map from map window layers to render """
+        """Add map from map window layers to render"""
 
 
         if not self.mapWin:
         if not self.mapWin:
             return False
             return False

+ 1 - 1
gui/wxpython/vnet/widgets.py

@@ -330,7 +330,7 @@ class PointsList(
             self.selectedkey = -1
             self.selectedkey = -1
 
 
     def ClearItem(self, event):
     def ClearItem(self, event):
-        """"Set all values to default in selected item of points list and uncheck it."""
+        """Set all values to default in selected item of points list and uncheck it."""
         if self.selected == wx.NOT_FOUND:
         if self.selected == wx.NOT_FOUND:
             return
             return
         index = self.selected
         index = self.selected

+ 2 - 2
gui/wxpython/wxgui.py

@@ -129,7 +129,7 @@ class GMApp(wx.App):
 
 
 
 
 def printHelp():
 def printHelp():
-    """ Print program help"""
+    """Print program help"""
     print("Usage:", file=sys.stderr)
     print("Usage:", file=sys.stderr)
     print(" python wxgui.py [options]", file=sys.stderr)
     print(" python wxgui.py [options]", file=sys.stderr)
     print("%sOptions:" % os.linesep, file=sys.stderr)
     print("%sOptions:" % os.linesep, file=sys.stderr)
@@ -138,7 +138,7 @@ def printHelp():
 
 
 
 
 def process_opt(opts, args):
 def process_opt(opts, args):
-    """ Process command-line arguments"""
+    """Process command-line arguments"""
     workspaceFile = None
     workspaceFile = None
     for o, a in opts:
     for o, a in opts:
         if o in ("-h", "--help"):
         if o in ("-h", "--help"):

+ 1 - 1
imagery/i.atcorr/create_iwave.py

@@ -328,7 +328,7 @@ def write_cpp(bands, values, sensor, folder):
 
 
 
 
 def main():
 def main():
-    """ control function """
+    """control function"""
 
 
     inputfile = sys.argv[1]
     inputfile = sys.argv[1]
 
 

+ 2 - 2
lib/init/grass.py

@@ -805,7 +805,7 @@ def set_defaults():
 
 
 
 
 def set_display_defaults():
 def set_display_defaults():
-    """ Predefine monitor size for certain architectures"""
+    """Predefine monitor size for certain architectures"""
     if os.getenv("HOSTTYPE") == "arm":
     if os.getenv("HOSTTYPE") == "arm":
         # small monitor on ARM (iPAQ, zaurus... etc)
         # small monitor on ARM (iPAQ, zaurus... etc)
         os.environ["GRASS_RENDER_HEIGHT"] = "320"
         os.environ["GRASS_RENDER_HEIGHT"] = "320"
@@ -2366,7 +2366,7 @@ def parse_cmdline(argv, default_gui):
 
 
 
 
 def validate_cmdline(params):
 def validate_cmdline(params):
-    """ Validate the cmdline params and exit if necessary. """
+    """Validate the cmdline params and exit if necessary."""
     if params.exit_grass and not params.create_new:
     if params.exit_grass and not params.create_new:
         fatal(_("Flag -e requires also flag -c"))
         fatal(_("Flag -e requires also flag -c"))
     if params.create_new and not params.mapset:
     if params.create_new and not params.mapset:

+ 0 - 2
man/parser_standard_options.py

@@ -111,8 +111,6 @@ def parse_options(lines, startswith="Opt"):
 
 
 
 
 class OptTable(object):
 class OptTable(object):
-    """"""
-
     def __init__(self, list_of_dict):
     def __init__(self, list_of_dict):
         self.options = list_of_dict
         self.options = list_of_dict
         self.columns = sorted(set([key for _, d in self.options for key in d.keys()]))
         self.columns = sorted(set([key for _, d in self.options for key in d.keys()]))

+ 8 - 9
pyproject.toml

@@ -1,6 +1,6 @@
 [tool.black]
 [tool.black]
 line-length = 88
 line-length = 88
-target-version = ['py36', 'py37', 'py38']
+target-version = ['py36', 'py37', 'py38', 'py39']
 include = '\.pyi?$'
 include = '\.pyi?$'
 exclude = '''
 exclude = '''
 (
 (
@@ -15,15 +15,14 @@ exclude = '''
         | _build
         | _build
         | buck-out
         | buck-out
         | build
         | build
-        | bin\.
-        | dist\.
+        | bin\..*
+        | dist\..*
     )/
     )/
     | python/grass/ctypes/
     | python/grass/ctypes/
-    # Bug in Black related to tab escape prevents these from being formatted correctly.
-    # https://github.com/psf/black/issues/1970
-    | python/grass/imaging/images2gif.py
-    | python/grass/pygrass/raster/category.py
-    # https://github.com/psf/black/issues/1629
-    | gui/wxpython/lmgr/layertree.py
+    # Bug in Black related to r-string prefix capitalization reformats
+    # a line in this file unnecessarily. File is however fully Black-formatted
+    # at the time of writing.
+    # https://github.com/psf/black/issues/1244
+    | python/grass/pygrass/utils.py
 )
 )
 '''
 '''

+ 100 - 82
python/grass/imaging/images2gif.py

@@ -69,6 +69,7 @@ import os
 try:
 try:
     import PIL
     import PIL
     from PIL import Image
     from PIL import Image
+
     pillow = True
     pillow = True
     try:
     try:
         PIL.__version__  # test if user has Pillow or PIL
         PIL.__version__  # test if user has Pillow or PIL
@@ -98,8 +99,9 @@ def get_cKDTree():
 # technically the first byte says how many bytes follow, after which that
 # technically the first byte says how many bytes follow, after which that
 # amount (max 255) follows)
 # amount (max 255) follows)
 
 
+
 def checkImages(images):
 def checkImages(images):
-    """ checkImages(images)
+    """checkImages(images)
     Check numpy images and correct intensity range etc.
     Check numpy images and correct intensity range etc.
     The same for all movie formats.
     The same for all movie formats.
 
 
@@ -131,11 +133,11 @@ def checkImages(images):
                 pass  # ok
                 pass  # ok
             elif im.ndim == 3:
             elif im.ndim == 3:
                 if im.shape[2] not in [3, 4]:
                 if im.shape[2] not in [3, 4]:
-                    raise ValueError('This array can not represent an image.')
+                    raise ValueError("This array can not represent an image.")
             else:
             else:
-                raise ValueError('This array can not represent an image.')
+                raise ValueError("This array can not represent an image.")
         else:
         else:
-            raise ValueError('Invalid image type: ' + str(type(im)))
+            raise ValueError("Invalid image type: " + str(type(im)))
 
 
     # Done
     # Done
     return images2
     return images2
@@ -151,8 +153,7 @@ def intToBin(i):
 
 
 
 
 class GifWriter:
 class GifWriter:
-    """Class that contains methods for helping write the animated GIF file.
-    """
+    """Class that contains methods for helping write the animated GIF file."""
 
 
     def getheaderAnim(self, im):
     def getheaderAnim(self, im):
         """Get animation header. To replace PILs getheader()[0]
         """Get animation header. To replace PILs getheader()[0]
@@ -183,7 +184,7 @@ class GifWriter:
             xy = (0, 0)
             xy = (0, 0)
 
 
         # Image separator,
         # Image separator,
-        bb = '\x2C'
+        bb = "\x2C"
 
 
         # Image position and size
         # Image position and size
         bb += intToBin(xy[0])  # Left position
         bb += intToBin(xy[0])  # Left position
@@ -193,19 +194,19 @@ class GifWriter:
 
 
         # packed field: local color table flag1, interlace0, sorted table0,
         # packed field: local color table flag1, interlace0, sorted table0,
         # reserved00, lct size111=7=2^(7 + 1)=256.
         # reserved00, lct size111=7=2^(7 + 1)=256.
-        bb += '\x87'
+        bb += "\x87"
 
 
         # LZW min size code now comes later, beginning of [image data] blocks
         # LZW min size code now comes later, beginning of [image data] blocks
         return bb
         return bb
 
 
-    def getAppExt(self, loops=float('inf')):
+    def getAppExt(self, loops=float("inf")):
         """Application extension. This part specifies the amount of loops.
         """Application extension. This part specifies the amount of loops.
         If loops is 0 or inf, it goes on infinitely.
         If loops is 0 or inf, it goes on infinitely.
 
 
         :param float loops:
         :param float loops:
         """
         """
 
 
-        if loops == 0 or loops == float('inf'):
+        if loops == 0 or loops == float("inf"):
             loops = 2 ** 16 - 1
             loops = 2 ** 16 - 1
             # bb = ""
             # bb = ""
             # application extension should not be used
             # application extension should not be used
@@ -217,7 +218,7 @@ class GifWriter:
             bb += "NETSCAPE2.0"
             bb += "NETSCAPE2.0"
             bb += "\x03\x01"
             bb += "\x03\x01"
             bb += intToBin(loops)
             bb += intToBin(loops)
-            bb += '\x00'  # end
+            bb += "\x00"  # end
         return bb
         return bb
 
 
     def getGraphicsControlExt(self, duration=0.1, dispose=2):
     def getGraphicsControlExt(self, duration=0.1, dispose=2):
@@ -239,13 +240,13 @@ class GifWriter:
         :param dispose:
         :param dispose:
         """
         """
 
 
-        bb = '\x21\xF9\x04'
+        bb = "\x21\xF9\x04"
         bb += chr((dispose & 3) << 2)  # low bit 1 == transparency,
         bb += chr((dispose & 3) << 2)  # low bit 1 == transparency,
         # 2nd bit 1 == user input , next 3 bits, the low two of which are used,
         # 2nd bit 1 == user input , next 3 bits, the low two of which are used,
         # are dispose.
         # are dispose.
         bb += intToBin(int(duration * 100))  # in 100th of seconds
         bb += intToBin(int(duration * 100))  # in 100th of seconds
-        bb += '\x00'  # no transparent color
-        bb += '\x00'  # end
+        bb += "\x00"  # no transparent color
+        bb += "\x00"  # end
         return bb
         return bb
 
 
     def handleSubRectangles(self, images, subRectangles):
     def handleSubRectangles(self, images, subRectangles):
@@ -262,7 +263,7 @@ class GifWriter:
             xy = subRectangles
             xy = subRectangles
             if xy is None:
             if xy is None:
                 xy = (0, 0)
                 xy = (0, 0)
-            if hasattr(xy, '__len__'):
+            if hasattr(xy, "__len__"):
                 if len(xy) == len(images):
                 if len(xy) == len(images):
                     xy = [xxyy for xxyy in xy]
                     xy = [xxyy for xxyy in xy]
                 else:
                 else:
@@ -285,7 +286,9 @@ class GifWriter:
                     tmp = im.convert()  # Make without palette
                     tmp = im.convert()  # Make without palette
                     a = np.asarray(tmp)
                     a = np.asarray(tmp)
                     if len(a.shape) == 0:
                     if len(a.shape) == 0:
-                        raise MemoryError("Too little memory to convert PIL image to array")
+                        raise MemoryError(
+                            "Too little memory to convert PIL image to array"
+                        )
                     images[i] = a
                     images[i] = a
 
 
             # Determine the sub rectangles
             # Determine the sub rectangles
@@ -295,7 +298,7 @@ class GifWriter:
         return images, xy
         return images, xy
 
 
     def getSubRectangles(self, ims):
     def getSubRectangles(self, ims):
-        """ getSubRectangles(ims)
+        """getSubRectangles(ims)
 
 
         Calculate the minimal rectangles that need updating each frame.
         Calculate the minimal rectangles that need updating each frame.
         Returns a two-element tuple containing the cropped images and a
         Returns a two-element tuple containing the cropped images and a
@@ -324,7 +327,7 @@ class GifWriter:
         for im in ims[1:]:
         for im in ims[1:]:
 
 
             # Get difference, sum over colors
             # Get difference, sum over colors
-            diff = np.abs(im-prev)
+            diff = np.abs(im - prev)
             if diff.ndim == 3:
             if diff.ndim == 3:
                 diff = diff.sum(2)
                 diff = diff.sum(2)
             # Get begin and end for both dimensions
             # Get begin and end for both dimensions
@@ -350,7 +353,7 @@ class GifWriter:
         return ims2, xy
         return ims2, xy
 
 
     def convertImagesToPIL(self, images, dither, nq=0):
     def convertImagesToPIL(self, images, dither, nq=0):
-        """ convertImagesToPIL(images, nq=0)
+        """convertImagesToPIL(images, nq=0)
 
 
         Convert images to Paletted PIL images, which can then be
         Convert images to Paletted PIL images, which can then be
         written to a single animaged GIF.
         written to a single animaged GIF.
@@ -364,11 +367,11 @@ class GifWriter:
                 images2.append(im)
                 images2.append(im)
             elif np and isinstance(im, np.ndarray):
             elif np and isinstance(im, np.ndarray):
                 if im.ndim == 3 and im.shape[2] == 3:
                 if im.ndim == 3 and im.shape[2] == 3:
-                    im = Image.fromarray(im, 'RGB')
+                    im = Image.fromarray(im, "RGB")
                 elif im.ndim == 3 and im.shape[2] == 4:
                 elif im.ndim == 3 and im.shape[2] == 4:
-                    im = Image.fromarray(im[:, :, :3], 'RGB')
+                    im = Image.fromarray(im[:, :, :3], "RGB")
                 elif im.ndim == 2:
                 elif im.ndim == 2:
-                    im = Image.fromarray(im, 'L')
+                    im = Image.fromarray(im, "L")
                 images2.append(im)
                 images2.append(im)
 
 
         # Convert to paletted PIL images
         # Convert to paletted PIL images
@@ -388,14 +391,14 @@ class GifWriter:
             # Adaptive PIL algorithm
             # Adaptive PIL algorithm
             AD = Image.ADAPTIVE
             AD = Image.ADAPTIVE
             for im in images:
             for im in images:
-                im = im.convert('P', palette=AD, dither=dither)
+                im = im.convert("P", palette=AD, dither=dither)
                 images2.append(im)
                 images2.append(im)
 
 
         # Done
         # Done
         return images2
         return images2
 
 
     def writeGifToFile(self, fp, images, durations, loops, xys, disposes):
     def writeGifToFile(self, fp, images, durations, loops, xys, disposes):
-        """ writeGifToFile(fp, images, durations, loops, xys, disposes)
+        """writeGifToFile(fp, images, durations, loops, xys, disposes)
 
 
         Given a set of images writes the bytes to the specified stream.
         Given a set of images writes the bytes to the specified stream.
         Requires different handling of palette for PIL and Pillow:
         Requires different handling of palette for PIL and Pillow:
@@ -447,8 +450,9 @@ class GifWriter:
                 # Gather info
                 # Gather info
                 data = getdata(im)
                 data = getdata(im)
                 imdes, data = data[0], data[1:]
                 imdes, data = data[0], data[1:]
-                graphext = self.getGraphicsControlExt(durations[frames],
-                                                      disposes[frames])
+                graphext = self.getGraphicsControlExt(
+                    durations[frames], disposes[frames]
+                )
                 # Make image descriptor suitable for using 256 local color palette
                 # Make image descriptor suitable for using 256 local color palette
                 lid = self.getImageDescriptor(im, xys[frames])
                 lid = self.getImageDescriptor(im, xys[frames])
 
 
@@ -458,7 +462,7 @@ class GifWriter:
                     fp.write(graphext)
                     fp.write(graphext)
                     fp.write(lid)  # write suitable image descriptor
                     fp.write(lid)  # write suitable image descriptor
                     fp.write(palette)  # write local color table
                     fp.write(palette)  # write local color table
-                    fp.write('\x08')  # LZW minimum size code
+                    fp.write("\x08")  # LZW minimum size code
                 else:
                 else:
                     # Use global color palette
                     # Use global color palette
                     fp.write(graphext)
                     fp.write(graphext)
@@ -492,7 +496,7 @@ def writeGif(filename, images, duration=0.1, repeat=True, **kwargs):
     """
     """
     if pillow:
     if pillow:
         # Pillow >= 3.4.0 has animated GIF writing
         # Pillow >= 3.4.0 has animated GIF writing
-        version = [int(i) for i in PIL.__version__.split('.')]
+        version = [int(i) for i in PIL.__version__.split(".")]
         if version[0] > 3 or (version[0] == 3 and version[1] >= 4):
         if version[0] > 3 or (version[0] == 3 and version[1] >= 4):
             writeGifPillow(filename, images, duration, repeat)
             writeGifPillow(filename, images, duration, repeat)
             return
             return
@@ -517,11 +521,25 @@ def writeGifPillow(filename, images, duration=0.1, repeat=True):
     quantized = []
     quantized = []
     for im in images:
     for im in images:
         quantized.append(im.quantize())
         quantized.append(im.quantize())
-    quantized[0].save(filename, save_all=True, append_images=quantized[1:], loop=loop, duration=duration * 1000)
-
-
-def writeGifVisvis(filename, images, duration=0.1, repeat=True, dither=False,
-                   nq=0, subRectangles=True, dispose=None):
+    quantized[0].save(
+        filename,
+        save_all=True,
+        append_images=quantized[1:],
+        loop=loop,
+        duration=duration * 1000,
+    )
+
+
+def writeGifVisvis(
+    filename,
+    images,
+    duration=0.1,
+    repeat=True,
+    dither=False,
+    nq=0,
+    subRectangles=True,
+    dispose=None,
+):
     """Write an animated gif from the specified images.
     """Write an animated gif from the specified images.
     Uses VisVis implementation. Unfortunately it produces corrupted GIF
     Uses VisVis implementation. Unfortunately it produces corrupted GIF
     with Pillow >= 3.4.0.
     with Pillow >= 3.4.0.
@@ -576,7 +594,7 @@ def writeGifVisvis(filename, images, duration=0.1, repeat=True, dither=False,
         loops = int(repeat)
         loops = int(repeat)
 
 
     # Check duration
     # Check duration
-    if hasattr(duration, '__len__'):
+    if hasattr(duration, "__len__"):
         if len(duration) == len(images):
         if len(duration) == len(images):
             duration = [d for d in duration]
             duration = [d for d in duration]
         else:
         else:
@@ -596,7 +614,7 @@ def writeGifVisvis(filename, images, duration=0.1, repeat=True, dither=False,
     # Check dispose
     # Check dispose
     if dispose is None:
     if dispose is None:
         dispose = defaultDispose
         dispose = defaultDispose
-    if hasattr(dispose, '__len__'):
+    if hasattr(dispose, "__len__"):
         if len(dispose) != len(images):
         if len(dispose) != len(images):
             raise ValueError("len(xy) doesn't match amount of images.")
             raise ValueError("len(xy) doesn't match amount of images.")
     else:
     else:
@@ -606,7 +624,7 @@ def writeGifVisvis(filename, images, duration=0.1, repeat=True, dither=False,
     images = gifWriter.convertImagesToPIL(images, dither, nq)
     images = gifWriter.convertImagesToPIL(images, dither, nq)
 
 
     # Write
     # Write
-    fp = open(filename, 'wb')
+    fp = open(filename, "wb")
     try:
     try:
         gifWriter.writeGifToFile(fp, images, duration, loops, xy, dispose)
         gifWriter.writeGifToFile(fp, images, duration, loops, xy, dispose)
     finally:
     finally:
@@ -629,7 +647,7 @@ def readGif(filename, asNumpy=True):
 
 
     # Check whether it exists
     # Check whether it exists
     if not os.path.isfile(filename):
     if not os.path.isfile(filename):
-        raise IOError('File not found: ' + str(filename))
+        raise IOError("File not found: " + str(filename))
 
 
     # Load file using PIL
     # Load file using PIL
     pilIm = PIL.Image.open(filename)
     pilIm = PIL.Image.open(filename)
@@ -662,7 +680,7 @@ def readGif(filename, asNumpy=True):
 
 
 
 
 class NeuQuant:
 class NeuQuant:
-    """ NeuQuant(image, samplefac=10, colors=256)
+    """NeuQuant(image, samplefac=10, colors=256)
 
 
     samplefac should be an integer number of 1 or higher, 1
     samplefac should be an integer number of 1 or higher, 1
     being the highest quality, but the slowest performance.
     being the highest quality, but the slowest performance.
@@ -745,11 +763,11 @@ class NeuQuant:
         self.NCYCLES = 100  # Number of learning cycles
         self.NCYCLES = 100  # Number of learning cycles
         self.NETSIZE = colors  # Number of colours used
         self.NETSIZE = colors  # Number of colours used
         self.SPECIALS = 3  # Number of reserved colours used
         self.SPECIALS = 3  # Number of reserved colours used
-        self.BGCOLOR = self.SPECIALS-1  # Reserved background colour
+        self.BGCOLOR = self.SPECIALS - 1  # Reserved background colour
         self.CUTNETSIZE = self.NETSIZE - self.SPECIALS
         self.CUTNETSIZE = self.NETSIZE - self.SPECIALS
         self.MAXNETPOS = self.NETSIZE - 1
         self.MAXNETPOS = self.NETSIZE - 1
 
 
-        self.INITRAD = self.NETSIZE/8  # For 256 colours, radius starts at 32
+        self.INITRAD = self.NETSIZE / 8  # For 256 colours, radius starts at 32
         self.RADIUSBIASSHIFT = 6
         self.RADIUSBIASSHIFT = 6
         self.RADIUSBIAS = 1 << self.RADIUSBIASSHIFT
         self.RADIUSBIAS = 1 << self.RADIUSBIASSHIFT
         self.INITBIASRADIUS = self.INITRAD * self.RADIUSBIAS
         self.INITBIASRADIUS = self.INITRAD * self.RADIUSBIAS
@@ -759,19 +777,19 @@ class NeuQuant:
         self.INITALPHA = 1 << self.ALPHABIASSHIFT  # biased by 10 bits
         self.INITALPHA = 1 << self.ALPHABIASSHIFT  # biased by 10 bits
 
 
         self.GAMMA = 1024.0
         self.GAMMA = 1024.0
-        self.BETA = 1.0/1024.0
+        self.BETA = 1.0 / 1024.0
         self.BETAGAMMA = self.BETA * self.GAMMA
         self.BETAGAMMA = self.BETA * self.GAMMA
 
 
         # The network itself
         # The network itself
-        self.network = np.empty((self.NETSIZE, 3), dtype='float64')
+        self.network = np.empty((self.NETSIZE, 3), dtype="float64")
         # The network itself
         # The network itself
-        self.colormap = np.empty((self.NETSIZE, 4), dtype='int32')
+        self.colormap = np.empty((self.NETSIZE, 4), dtype="int32")
 
 
-        self.netindex = np.empty(256, dtype='int32')  # For network lookup - really 256
+        self.netindex = np.empty(256, dtype="int32")  # For network lookup - really 256
 
 
         # Bias and freq arrays for learning
         # Bias and freq arrays for learning
-        self.bias = np.empty(self.NETSIZE, dtype='float64')
-        self.freq = np.empty(self.NETSIZE, dtype='float64')
+        self.bias = np.empty(self.NETSIZE, dtype="float64")
+        self.freq = np.empty(self.NETSIZE, dtype="float64")
 
 
         self.pixels = None
         self.pixels = None
         self.samplefac = samplefac
         self.samplefac = samplefac
@@ -810,11 +828,11 @@ class NeuQuant:
         return self.NETSIZE
         return self.NETSIZE
 
 
     def setUpArrays(self):
     def setUpArrays(self):
-        self.network[0, 0] = 0.0    # Black
+        self.network[0, 0] = 0.0  # Black
         self.network[0, 1] = 0.0
         self.network[0, 1] = 0.0
         self.network[0, 2] = 0.0
         self.network[0, 2] = 0.0
 
 
-        self.network[1, 0] = 255.0    # White
+        self.network[1, 0] = 255.0  # White
         self.network[1, 1] = 255.0
         self.network[1, 1] = 255.0
         self.network[1, 2] = 255.0
         self.network[1, 2] = 255.0
 
 
@@ -826,7 +844,7 @@ class NeuQuant:
 
 
         for i in range(self.SPECIALS, self.NETSIZE):
         for i in range(self.SPECIALS, self.NETSIZE):
             p = self.network[i]
             p = self.network[i]
-            p[:] = (255.0 * (i-self.SPECIALS)) / self.CUTNETSIZE
+            p[:] = (255.0 * (i - self.SPECIALS)) / self.CUTNETSIZE
 
 
             self.freq[i] = 1.0 / self.NETSIZE
             self.freq[i] = 1.0 / self.NETSIZE
             self.bias[i] = 0.0
             self.bias[i] = 0.0
@@ -836,40 +854,40 @@ class NeuQuant:
     def altersingle(self, alpha, i, b, g, r):
     def altersingle(self, alpha, i, b, g, r):
         """Move neuron i towards biased (b, g, r) by factor alpha"""
         """Move neuron i towards biased (b, g, r) by factor alpha"""
         n = self.network[i]  # Alter hit neuron
         n = self.network[i]  # Alter hit neuron
-        n[0] -= (alpha * (n[0] - b))
-        n[1] -= (alpha * (n[1] - g))
-        n[2] -= (alpha * (n[2] - r))
+        n[0] -= alpha * (n[0] - b)
+        n[1] -= alpha * (n[1] - g)
+        n[2] -= alpha * (n[2] - r)
 
 
     def geta(self, alpha, rad):
     def geta(self, alpha, rad):
         try:
         try:
             return self.a_s[(alpha, rad)]
             return self.a_s[(alpha, rad)]
         except KeyError:
         except KeyError:
-            length = rad * 2-1
-            mid = length/2
-            q = np.array(list(range(mid-1, -1, -1)) + list(range(-1, mid)))
-            a = alpha * (rad * rad - q * q)/(rad * rad)
+            length = rad * 2 - 1
+            mid = length / 2
+            q = np.array(list(range(mid - 1, -1, -1)) + list(range(-1, mid)))
+            a = alpha * (rad * rad - q * q) / (rad * rad)
             a[mid] = 0
             a[mid] = 0
             self.a_s[(alpha, rad)] = a
             self.a_s[(alpha, rad)] = a
             return a
             return a
 
 
     def alterneigh(self, alpha, rad, i, b, g, r):
     def alterneigh(self, alpha, rad, i, b, g, r):
-        if i-rad >= self.SPECIALS-1:
-            lo = i-rad
+        if i - rad >= self.SPECIALS - 1:
+            lo = i - rad
             start = 0
             start = 0
         else:
         else:
-            lo = self.SPECIALS-1
-            start = (self.SPECIALS-1 - (i-rad))
+            lo = self.SPECIALS - 1
+            start = self.SPECIALS - 1 - (i - rad)
 
 
         if i + rad <= self.NETSIZE:
         if i + rad <= self.NETSIZE:
             hi = i + rad
             hi = i + rad
-            end = rad * 2-1
+            end = rad * 2 - 1
         else:
         else:
             hi = self.NETSIZE
             hi = self.NETSIZE
-            end = (self.NETSIZE - (i + rad))
+            end = self.NETSIZE - (i + rad)
 
 
         a = self.geta(alpha, rad)[start:end]
         a = self.geta(alpha, rad)[start:end]
 
 
-        p = self.network[lo + 1:hi]
+        p = self.network[lo + 1 : hi]
         p -= np.transpose(np.transpose(p - np.array([b, g, r])) * a)
         p -= np.transpose(np.transpose(p - np.array([b, g, r])) * a)
 
 
     # def contest(self, b, g, r):
     # def contest(self, b, g, r):
@@ -901,7 +919,7 @@ class NeuQuant:
         bestpos = i + np.argmin(dists)
         bestpos = i + np.argmin(dists)
         biasdists = dists - self.bias[i:j]
         biasdists = dists - self.bias[i:j]
         bestbiaspos = i + np.argmin(biasdists)
         bestbiaspos = i + np.argmin(biasdists)
-        self.freq[i:j] *= (1-self.BETA)
+        self.freq[i:j] *= 1 - self.BETA
         self.bias[i:j] += self.BETAGAMMA * self.freq[i:j]
         self.bias[i:j] += self.BETAGAMMA * self.freq[i:j]
         self.freq[bestpos] += self.BETA
         self.freq[bestpos] += self.BETA
         self.bias[bestpos] -= self.BETAGAMMA
         self.bias[bestpos] -= self.BETAGAMMA
@@ -916,7 +934,7 @@ class NeuQuant:
 
 
     def learn(self):
     def learn(self):
         biasRadius = self.INITBIASRADIUS
         biasRadius = self.INITBIASRADIUS
-        alphadec = 30 + ((self.samplefac-1)/3)
+        alphadec = 30 + ((self.samplefac - 1) / 3)
         lengthcount = self.pixels.size
         lengthcount = self.pixels.size
         samplepixels = lengthcount / self.samplefac
         samplepixels = lengthcount / self.samplefac
         delta = samplepixels / self.NCYCLES
         delta = samplepixels / self.NCYCLES
@@ -943,16 +961,16 @@ class NeuQuant:
             step = NeuQuant.PRIME4
             step = NeuQuant.PRIME4
 
 
         i = 0
         i = 0
-        printed_string = ''
+        printed_string = ""
         while i < samplepixels:
         while i < samplepixels:
             if i % 100 == 99:
             if i % 100 == 99:
-                tmp = '\b' * len(printed_string)
-                printed_string = str((i + 1) * 100/samplepixels) + "%\n"
+                tmp = "\b" * len(printed_string)
+                printed_string = str((i + 1) * 100 / samplepixels) + "%\n"
                 print(tmp + printed_string)
                 print(tmp + printed_string)
             p = self.pixels[pos]
             p = self.pixels[pos]
-            r = (p >> 16) & 0xff
-            g = (p >> 8) & 0xff
-            b = (p) & 0xff
+            r = (p >> 16) & 0xFF
+            g = (p >> 8) & 0xFF
+            b = (p) & 0xFF
 
 
             if i == 0:  # Remember background colour
             if i == 0:  # Remember background colour
                 self.network[self.BGCOLOR] = [b, g, r]
                 self.network[self.BGCOLOR] = [b, g, r]
@@ -977,7 +995,7 @@ class NeuQuant:
                 if rad <= 1:
                 if rad <= 1:
                     rad = 0
                     rad = 0
 
 
-        finalAlpha = (1.0 * alpha)/self.INITALPHA
+        finalAlpha = (1.0 * alpha) / self.INITALPHA
         print("Finished 1D learning: final alpha = %1.2f!" % finalAlpha)
         print("Finished 1D learning: final alpha = %1.2f!" % finalAlpha)
 
 
     def fix(self):
     def fix(self):
@@ -1029,7 +1047,7 @@ class NeuQuant:
             for i in range(self.NETSIZE):
             for i in range(self.NETSIZE):
                 palette.extend(self.colormap[i][:3])
                 palette.extend(self.colormap[i][:3])
 
 
-            palette.extend([0] * (256-self.NETSIZE) * 3)
+            palette.extend([0] * (256 - self.NETSIZE) * 3)
 
 
             # a palette image to use for quant
             # a palette image to use for quant
             self.pimage = Image.new("P", (1, 1), 0)
             self.pimage = Image.new("P", (1, 1), 0)
@@ -1045,7 +1063,7 @@ class NeuQuant:
         if get_cKDTree():
         if get_cKDTree():
             return self.quantize_with_scipy(image)
             return self.quantize_with_scipy(image)
         else:
         else:
-            print('Scipy not available, falling back to slower version.')
+            print("Scipy not available, falling back to slower version.")
             return self.quantize_without_scipy(image)
             return self.quantize_without_scipy(image)
 
 
     def quantize_with_scipy(self, image):
     def quantize_with_scipy(self, image):
@@ -1057,13 +1075,13 @@ class NeuQuant:
         kdtree = cKDTree(self.colormap[:, :3], leafsize=10)
         kdtree = cKDTree(self.colormap[:, :3], leafsize=10)
         result = kdtree.query(px2)
         result = kdtree.query(px2)
         colorindex = result[1]
         colorindex = result[1]
-        print("Distance: %1.2f" % (result[0].sum()/(w * h)))
+        print("Distance: %1.2f" % (result[0].sum() / (w * h)))
         px2[:] = self.colormap[colorindex, :3]
         px2[:] = self.colormap[colorindex, :3]
 
 
         return Image.fromarray(px).convert("RGB").quantize(palette=self.paletteImage())
         return Image.fromarray(px).convert("RGB").quantize(palette=self.paletteImage())
 
 
     def quantize_without_scipy(self, image):
     def quantize_without_scipy(self, image):
-        """" This function can be used if no scipy is available.
+        """ " This function can be used if no scipy is available.
         It's 7 times slower though.
         It's 7 times slower though.
 
 
         :param image:
         :param image:
@@ -1088,16 +1106,16 @@ class NeuQuant:
 
 
     def inxsearch(self, r, g, b):
     def inxsearch(self, r, g, b):
         """Search for BGR values 0..255 and return colour index"""
         """Search for BGR values 0..255 and return colour index"""
-        dists = (self.colormap[:, :3] - np.array([r, g, b]))
+        dists = self.colormap[:, :3] - np.array([r, g, b])
         a = np.argmin((dists * dists).sum(1))
         a = np.argmin((dists * dists).sum(1))
         return a
         return a
 
 
 
 
-if __name__ == '__main__':
+if __name__ == "__main__":
     im = np.zeros((200, 200), dtype=np.uint8)
     im = np.zeros((200, 200), dtype=np.uint8)
-    im[10: 30, :] = 100
-    im[:, 80: 120] = 255
-    im[-50: -40, :] = 50
+    im[10:30, :] = 100
+    im[:, 80:120] = 255
+    im[-50:-40, :] = 50
 
 
     images = [im * 1.0, im * 0.8, im * 0.6, im * 0.4, im * 0]
     images = [im * 1.0, im * 0.8, im * 0.6, im * 0.4, im * 0]
-    writeGif('lala3.gif', images, duration=0.5, dither=0)
+    writeGif("lala3.gif", images, duration=0.5, dither=0)

+ 6 - 6
python/grass/imaging/images2swf.py

@@ -191,7 +191,7 @@ class BitArray:
             self._checkSize()
             self._checkSize()
 
 
     def Reverse(self):
     def Reverse(self):
-        """ In-place reverse. """
+        """In-place reverse."""
         tmp = self.data[: self._len].copy()
         tmp = self.data[: self._len].copy()
         self.data[: self._len] = np.flipud(tmp)
         self.data[: self._len] = np.flipud(tmp)
 
 
@@ -397,11 +397,11 @@ class Tag:
         self.tagtype = -1
         self.tagtype = -1
 
 
     def ProcessTag(self):
     def ProcessTag(self):
-        """ Implement this to create the tag. """
+        """Implement this to create the tag."""
         raise NotImplementedError()
         raise NotImplementedError()
 
 
     def GetTag(self):
     def GetTag(self):
-        """ Calls processTag and attaches the header. """
+        """Calls processTag and attaches the header."""
         self.ProcessTag()
         self.ProcessTag()
 
 
         # tag to binary
         # tag to binary
@@ -484,7 +484,7 @@ class ShowFrameTag(ControlTag):
 
 
 
 
 class SetBackgroundTag(ControlTag):
 class SetBackgroundTag(ControlTag):
-    """ Set the color in 0-255, or 0-1 (if floats given). """
+    """Set the color in 0-255, or 0-1 (if floats given)."""
 
 
     def __init__(self, *rgb):
     def __init__(self, *rgb):
         self.tagtype = 9
         self.tagtype = 9
@@ -621,7 +621,7 @@ class ShapeTag(DefinitionTag):
         self.wh = wh
         self.wh = wh
 
 
     def ProcessTag(self):
     def ProcessTag(self):
-        """ Returns a defineshape tag. with a bitmap fill """
+        """Returns a defineshape tag. with a bitmap fill"""
 
 
         bb = binary_type()
         bb = binary_type()
         bb += intToUint16(self.id)
         bb += intToUint16(self.id)
@@ -743,7 +743,7 @@ class ShapeTag(DefinitionTag):
 
 
 
 
 def buildFile(fp, taglist, nframes=1, framesize=(500, 500), fps=10, version=8):
 def buildFile(fp, taglist, nframes=1, framesize=(500, 500), fps=10, version=8):
-    """ Give the given file (as bytes) a header. """
+    """Give the given file (as bytes) a header."""
 
 
     # compose header
     # compose header
     bb = binary_type()
     bb = binary_type()

+ 48 - 39
python/grass/pygrass/raster/category.py

@@ -52,36 +52,35 @@ class Category(list):
 
 
     """
     """
 
 
-    def __init__(self, name, mapset='', mtype='CELL', *args, **kargs):
+    def __init__(self, name, mapset="", mtype="CELL", *args, **kargs):
         self.name = name
         self.name = name
         self.mapset = mapset
         self.mapset = mapset
         self.c_cats = libraster.Categories()
         self.c_cats = libraster.Categories()
         libraster.Rast_init_cats("", ctypes.byref(self.c_cats))
         libraster.Rast_init_cats("", ctypes.byref(self.c_cats))
         self._mtype = mtype
         self._mtype = mtype
-        self._gtype = None if mtype is None else RTYPE[mtype]['grass type']
+        self._gtype = None if mtype is None else RTYPE[mtype]["grass type"]
         super(Category, self).__init__(*args, **kargs)
         super(Category, self).__init__(*args, **kargs)
 
 
     def _get_mtype(self):
     def _get_mtype(self):
         return self._mtype
         return self._mtype
 
 
     def _set_mtype(self, mtype):
     def _set_mtype(self, mtype):
-        if mtype.upper() not in ('CELL', 'FCELL', 'DCELL'):
+        if mtype.upper() not in ("CELL", "FCELL", "DCELL"):
             raise ValueError(_("Raster type: {0} not supported".format(mtype)))
             raise ValueError(_("Raster type: {0} not supported".format(mtype)))
         self._mtype = mtype
         self._mtype = mtype
-        self._gtype = RTYPE[self.mtype]['grass type']
+        self._gtype = RTYPE[self.mtype]["grass type"]
 
 
-    mtype = property(fget=_get_mtype, fset=_set_mtype,
-                     doc="Set or obtain raster data type")
+    mtype = property(
+        fget=_get_mtype, fset=_set_mtype, doc="Set or obtain raster data type"
+    )
 
 
     def _get_title(self):
     def _get_title(self):
         return libraster.Rast_get_cats_title(ctypes.byref(self.c_cats))
         return libraster.Rast_get_cats_title(ctypes.byref(self.c_cats))
 
 
     def _set_title(self, newtitle):
     def _set_title(self, newtitle):
-        return libraster.Rast_set_cats_title(newtitle,
-                                             ctypes.byref(self.c_cats))
+        return libraster.Rast_set_cats_title(newtitle, ctypes.byref(self.c_cats))
 
 
-    title = property(fget=_get_title, fset=_set_title,
-                     doc="Set or obtain raster title")
+    title = property(fget=_get_title, fset=_set_title, doc="Set or obtain raster title")
 
 
     def __str__(self):
     def __str__(self):
         return self.__repr__()
         return self.__repr__()
@@ -103,7 +102,7 @@ class Category(list):
         cats = []
         cats = []
         for cat in self.__iter__():
         for cat in self.__iter__():
             cats.append(repr(cat))
             cats.append(repr(cat))
-        return "[{0}]".format(',\n '.join(cats))
+        return "[{0}]".format(",\n ".join(cats))
 
 
     def _chk_index(self, index):
     def _chk_index(self, index):
         if type(index) == str:
         if type(index) == str:
@@ -120,17 +119,18 @@ class Category(list):
                 label, min_cat = value
                 label, min_cat = value
                 value = (label, min_cat, None)
                 value = (label, min_cat, None)
             elif length < 2 or length > 3:
             elif length < 2 or length > 3:
-                raise TypeError('Tuple with a length that is not supported.')
+                raise TypeError("Tuple with a length that is not supported.")
         else:
         else:
-            raise TypeError('Only Tuple are supported.')
+            raise TypeError("Only Tuple are supported.")
         return value
         return value
 
 
     def __getitem__(self, index):
     def __getitem__(self, index):
         return super(Category, self).__getitem__(self._chk_index(index))
         return super(Category, self).__getitem__(self._chk_index(index))
 
 
     def __setitem__(self, index, value):
     def __setitem__(self, index, value):
-        return super(Category, self).__setitem__(self._chk_index(index),
-                                                 self._chk_value(value))
+        return super(Category, self).__setitem__(
+            self._chk_index(index), self._chk_value(value)
+        )
 
 
     def _get_c_cat(self, index):
     def _get_c_cat(self, index):
         """Returns i-th description and i-th data range from the list of
         """Returns i-th description and i-th data range from the list of
@@ -144,15 +144,19 @@ class Category(list):
                          RASTER_MAP_TYPE 	data_type
                          RASTER_MAP_TYPE 	data_type
                          )
                          )
         """
         """
-        min_cat = ctypes.pointer(RTYPE[self.mtype]['grass def']())
-        max_cat = ctypes.pointer(RTYPE[self.mtype]['grass def']())
-        lab = decode(libraster.Rast_get_ith_cat(ctypes.byref(self.c_cats),
-                                                index,
-                                                ctypes.cast(min_cat, ctypes.c_void_p),
-                                                ctypes.cast(max_cat, ctypes.c_void_p),
-                                                self._gtype))
+        min_cat = ctypes.pointer(RTYPE[self.mtype]["grass def"]())
+        max_cat = ctypes.pointer(RTYPE[self.mtype]["grass def"]())
+        lab = decode(
+            libraster.Rast_get_ith_cat(
+                ctypes.byref(self.c_cats),
+                index,
+                ctypes.cast(min_cat, ctypes.c_void_p),
+                ctypes.cast(max_cat, ctypes.c_void_p),
+                self._gtype,
+            )
+        )
         # Manage C function Errors
         # Manage C function Errors
-        if lab == '':
+        if lab == "":
             raise GrassError(_("Error executing: Rast_get_ith_cat"))
             raise GrassError(_("Error executing: Rast_get_ith_cat"))
         if max_cat.contents.value == min_cat.contents.value:
         if max_cat.contents.value == min_cat.contents.value:
             max_cat = None
             max_cat = None
@@ -171,12 +175,15 @@ class Category(list):
                          )
                          )
         """
         """
         max_cat = min_cat if max_cat is None else max_cat
         max_cat = min_cat if max_cat is None else max_cat
-        min_cat = ctypes.pointer(RTYPE[self.mtype]['grass def'](min_cat))
-        max_cat = ctypes.pointer(RTYPE[self.mtype]['grass def'](max_cat))
-        err = libraster.Rast_set_cat(ctypes.cast(min_cat, ctypes.c_void_p),
-                                     ctypes.cast(max_cat, ctypes.c_void_p),
-                                     label,
-                                     ctypes.byref(self.c_cats), self._gtype)
+        min_cat = ctypes.pointer(RTYPE[self.mtype]["grass def"](min_cat))
+        max_cat = ctypes.pointer(RTYPE[self.mtype]["grass def"](max_cat))
+        err = libraster.Rast_set_cat(
+            ctypes.cast(min_cat, ctypes.c_void_p),
+            ctypes.cast(max_cat, ctypes.c_void_p),
+            label,
+            ctypes.byref(self.c_cats),
+            self._gtype,
+        )
         # Manage C function Errors
         # Manage C function Errors
         if err == 1:
         if err == 1:
             return None
             return None
@@ -201,7 +208,7 @@ class Category(list):
 
 
     def reset(self):
     def reset(self):
         for i in range(len(self) - 1, -1, -1):
         for i in range(len(self) - 1, -1, -1):
-            del(self[i])
+            del self[i]
         libraster.Rast_init_cats("", ctypes.byref(self.c_cats))
         libraster.Rast_init_cats("", ctypes.byref(self.c_cats))
 
 
     def _read_cats(self):
     def _read_cats(self):
@@ -233,8 +240,9 @@ class Category(list):
                            )
                            )
         """
         """
         self.reset()
         self.reset()
-        err = libraster.Rast_read_cats(self.name, self.mapset,
-                                       ctypes.byref(self.c_cats))
+        err = libraster.Rast_read_cats(
+            self.name, self.mapset, ctypes.byref(self.c_cats)
+        )
         if err == -1:
         if err == -1:
             raise GrassError("Can not read the categories.")
             raise GrassError("Can not read the categories.")
         # copy from C struct to list
         # copy from C struct to list
@@ -259,8 +267,9 @@ class Category(list):
         :param category: Category class to be copied
         :param category: Category class to be copied
         :type category: Category object
         :type category: Category object
         """
         """
-        libraster.Rast_copy_cats(ctypes.byref(self.c_cats),     # to
-                                 ctypes.byref(category.c_cats))  # from
+        libraster.Rast_copy_cats(
+            ctypes.byref(self.c_cats), ctypes.byref(category.c_cats)  # to
+        )  # from
         self._read_cats()
         self._read_cats()
 
 
     def ncats(self):
     def ncats(self):
@@ -273,7 +282,7 @@ class Category(list):
         # TODO: add
         # TODO: add
         raise ImplementationError("set_cats_fmt() is not implemented yet.")
         raise ImplementationError("set_cats_fmt() is not implemented yet.")
 
 
-    def read_rules(self, filename, sep=':'):
+    def read_rules(self, filename, sep=":"):
         """Copy categories from a rules file, default separetor is ':', the
         """Copy categories from a rules file, default separetor is ':', the
         columns must be: min and/or max and label. ::
         columns must be: min and/or max and label. ::
 
 
@@ -290,7 +299,7 @@ class Category(list):
 
 
         """
         """
         self.reset()
         self.reset()
-        with open(filename, 'r') as f:
+        with open(filename, "r") as f:
             for row in f.readlines():
             for row in f.readlines():
                 cat = row.strip().split(sep)
                 cat = row.strip().split(sep)
                 if len(cat) == 2:
                 if len(cat) == 2:
@@ -302,7 +311,7 @@ class Category(list):
                     raise TypeError("Row length is greater than 3")
                     raise TypeError("Row length is greater than 3")
                 self.append((label, min_cat, max_cat))
                 self.append((label, min_cat, max_cat))
 
 
-    def write_rules(self, filename, sep=':'):
+    def write_rules(self, filename, sep=":"):
         """Copy categories from a rules file, default separetor is ':', the
         """Copy categories from a rules file, default separetor is ':', the
         columns must be: min and/or max and label. ::
         columns must be: min and/or max and label. ::
 
 
@@ -317,13 +326,13 @@ class Category(list):
         :param str filename: the name of file with categories rules
         :param str filename: the name of file with categories rules
         :param str sep: the separator used to divide values and category
         :param str sep: the separator used to divide values and category
         """
         """
-        with open(filename, 'w') as f:
+        with open(filename, "w") as f:
             cats = []
             cats = []
             for cat in self.__iter__():
             for cat in self.__iter__():
                 if cat[-1] is None:
                 if cat[-1] is None:
                     cat = cat[:-1]
                     cat = cat[:-1]
                 cats.append(sep.join([str(i) for i in cat]))
                 cats.append(sep.join([str(i) for i in cat]))
-            f.write('\n'.join(cats))
+            f.write("\n".join(cats))
 
 
     def sort(self):
     def sort(self):
         libraster.Rast_sort_cats(ctypes.byref(self.c_cats))
         libraster.Rast_sort_cats(ctypes.byref(self.c_cats))

+ 1 - 1
python/grass/pygrass/raster/segment.py

@@ -124,7 +124,7 @@ class Segment(object):
         libseg.Segment_flush(self.c_seg)
         libseg.Segment_flush(self.c_seg)
 
 
     def close(self):
     def close(self):
-        """Free memory allocated to segment and delete temp file.  """
+        """Free memory allocated to segment and delete temp file."""
         libseg.Segment_close(self.c_seg)
         libseg.Segment_close(self.c_seg)
 
 
     def release(self):
     def release(self):

+ 2 - 1
python/grass/pygrass/utils.py

@@ -497,7 +497,8 @@ def create_test_vector_map(map_name="test_vector"):
 
 
 
 
 def create_test_stream_network_map(map_name="streams"):
 def create_test_stream_network_map(map_name="streams"):
-    R"""
+    R"""Create test data
+
        This functions creates a vector map layer with lines that represent
        This functions creates a vector map layer with lines that represent
        a stream network with two different graphs. The first graph
        a stream network with two different graphs. The first graph
        contains a loop, the second can be used as directed graph.
        contains a loop, the second can be used as directed graph.

+ 0 - 1
python/grass/pygrass/vector/geometry.py

@@ -1346,7 +1346,6 @@ class Node(object):
 
 
 
 
 class Boundary(Line):
 class Boundary(Line):
-    """"""
 
 
     # geometry type
     # geometry type
     gtype = libvect.GV_BOUNDARY
     gtype = libvect.GV_BOUNDARY

+ 0 - 1
python/grass/pygrass/vector/table.py

@@ -899,7 +899,6 @@ class DBlinks(object):
         return (self.by_index(i) for i in range(self.num_dblinks()))
         return (self.by_index(i) for i in range(self.num_dblinks()))
 
 
     def __getitem__(self, item):
     def __getitem__(self, item):
-        """"""
         if isinstance(item, int):
         if isinstance(item, int):
             return self.by_index(item)
             return self.by_index(item)
         else:
         else:

+ 1 - 1
python/grass/temporal/temporal_algebra.py

@@ -2558,7 +2558,7 @@ class TemporalAlgebraParser(object):
         t[0] = t[1]
         t[0] = t[1]
 
 
     def p_paren_expr(self, t):
     def p_paren_expr(self, t):
-        """ expr : LPAREN expr RPAREN"""
+        """expr : LPAREN expr RPAREN"""
         t[0] = t[2]
         t[0] = t[2]
 
 
     def p_number(self, t):
     def p_number(self, t):

+ 1 - 1
python/grass/temporal/temporal_granularity.py

@@ -1195,7 +1195,7 @@ def gran_to_gran(from_gran, to_gran="days", shell=False):
 
 
 
 
 def gcd(a, b):
 def gcd(a, b):
-    """The Euclidean Algorithm """
+    """The Euclidean Algorithm"""
     a = abs(a)
     a = abs(a)
     b = abs(b)
     b = abs(b)
     while a:
     while a:

+ 22 - 22
python/grass/temporal/testsuite/unittests_temporal_algebra.py

@@ -124,7 +124,7 @@ class TestTemporalAlgebra(TestCase):
         cls.del_temp_region()
         cls.del_temp_region()
 
 
     def test_temporal_select1(self):
     def test_temporal_select1(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(expression="R = A : A", stdstype="strds", basename="r", overwrite=True)
         ta.parse(expression="R = A : A", stdstype="strds", basename="r", overwrite=True)
 
 
@@ -141,7 +141,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select2(self):
     def test_temporal_select2(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(expression="R = A : D", stdstype="strds", basename="r", overwrite=True)
         ta.parse(expression="R = A : D", stdstype="strds", basename="r", overwrite=True)
 
 
@@ -158,7 +158,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select3(self):
     def test_temporal_select3(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = A !: D", stdstype="strds", basename="r", overwrite=True
             expression="R = A !: D", stdstype="strds", basename="r", overwrite=True
@@ -177,7 +177,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select_operators1(self):
     def test_temporal_select_operators1(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = A {:,during} C",
             expression="R = A {:,during} C",
@@ -199,7 +199,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select_operators2(self):
     def test_temporal_select_operators2(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = A {:,equal|during} C",
             expression="R = A {:,equal|during} C",
@@ -300,7 +300,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_extent1(self):
     def test_temporal_extent1(self):
-        """Testing the temporal extent operators. """
+        """Testing the temporal extent operators."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = A {:,during,r} C",
             expression="R = A {:,during,r} C",
@@ -323,7 +323,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_extent2(self):
     def test_temporal_extent2(self):
-        """Testing the temporal extent operators. """
+        """Testing the temporal extent operators."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = A {:,during,d} C",
             expression="R = A {:,during,d} C",
@@ -346,7 +346,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_extent3(self):
     def test_temporal_extent3(self):
-        """Testing the temporal extent operators. """
+        """Testing the temporal extent operators."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = A {:,during,u} C",
             expression="R = A {:,during,u} C",
@@ -373,7 +373,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_hash1(self):
     def test_temporal_hash1(self):
-        """Testing the hash function in conditional statement. """
+        """Testing the hash function in conditional statement."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = if(A # D == 1, A)",
             expression="R = if(A # D == 1, A)",
@@ -396,7 +396,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_hash_operator1(self):
     def test_temporal_hash_operator1(self):
-        """Testing the hash operator function in conditional statement. """
+        """Testing the hash operator function in conditional statement."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = if(A {#,during} C == 1, A)",
             expression="R = if(A {#,during} C == 1, A)",
@@ -419,7 +419,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_hash_operator2(self):
     def test_temporal_hash_operator2(self):
-        """Testing the hash operator function in conditional statement. """
+        """Testing the hash operator function in conditional statement."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = if({during}, C {#,contains} A == 2, A)",
             expression="R = if({during}, C {#,contains} A == 2, A)",
@@ -442,7 +442,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_tmap_function1(self):
     def test_tmap_function1(self):
-        """Testing the tmap function. """
+        """Testing the tmap function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = tmap(singletmap)",
             expression="R = tmap(singletmap)",
@@ -465,7 +465,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_tmap_function2(self):
     def test_tmap_function2(self):
-        """Testing the tmap function. """
+        """Testing the tmap function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = A : tmap(singletmap)",
             expression="R = A : tmap(singletmap)",
@@ -488,7 +488,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_merge_function1(self):
     def test_merge_function1(self):
-        """Testing the merge function. """
+        """Testing the merge function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = merge(A,D)", stdstype="strds", basename="r", overwrite=True
             expression="R = merge(A,D)", stdstype="strds", basename="r", overwrite=True
@@ -508,7 +508,7 @@ class TestTemporalAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_merge_function2(self):
     def test_merge_function2(self):
-        """Testing the merge function. """
+        """Testing the merge function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = merge(A, B {!:,contains} A)",
             expression="R = merge(A, B {!:,contains} A)",
@@ -637,7 +637,7 @@ class TestTemporalAlgebraDryRun(TestCase):
         cls.del_temp_region()
         cls.del_temp_region()
 
 
     def test_merge_function1(self):
     def test_merge_function1(self):
-        """Testing the merge function. """
+        """Testing the merge function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         pc = ta.parse(
         pc = ta.parse(
             expression="R = merge(A, B {:,contains} A)",
             expression="R = merge(A, B {:,contains} A)",
@@ -651,7 +651,7 @@ class TestTemporalAlgebraDryRun(TestCase):
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
 
 
     def test_merge_function2(self):
     def test_merge_function2(self):
-        """Testing the merge function. """
+        """Testing the merge function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         pc = ta.parse(
         pc = ta.parse(
             expression="R = merge(A, B {!:,contains} A)",
             expression="R = merge(A, B {!:,contains} A)",
@@ -665,7 +665,7 @@ class TestTemporalAlgebraDryRun(TestCase):
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
 
 
     def test_merge_function3(self):
     def test_merge_function3(self):
-        """Testing the merge function. """
+        """Testing the merge function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         pc = ta.parse(
         pc = ta.parse(
             expression="R = merge(A, D {!:,equal} A)",
             expression="R = merge(A, D {!:,equal} A)",
@@ -679,7 +679,7 @@ class TestTemporalAlgebraDryRun(TestCase):
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
 
 
     def test_shift1(self):
     def test_shift1(self):
-        """Testing the shift function. """
+        """Testing the shift function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         pc = ta.parse(
         pc = ta.parse(
             expression='R = tshift(A, "3 days")',
             expression='R = tshift(A, "3 days")',
@@ -693,7 +693,7 @@ class TestTemporalAlgebraDryRun(TestCase):
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
 
 
     def test_shift2(self):
     def test_shift2(self):
-        """Testing the shift function. """
+        """Testing the shift function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         pc = ta.parse(
         pc = ta.parse(
             expression='R = tshift(A, "2 days") {:,during,l} C',
             expression='R = tshift(A, "2 days") {:,during,l} C',
@@ -707,7 +707,7 @@ class TestTemporalAlgebraDryRun(TestCase):
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
 
 
     def test_buffer1(self):
     def test_buffer1(self):
-        """Testing the shift function. """
+        """Testing the shift function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         pc = ta.parse(
         pc = ta.parse(
             expression='R = buff_t(A, "1 day") ',
             expression='R = buff_t(A, "1 day") ',
@@ -721,7 +721,7 @@ class TestTemporalAlgebraDryRun(TestCase):
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
         self.assertEqual(pc["STDS"]["stdstype"], "strds")
 
 
     def test_buff2(self):
     def test_buff2(self):
-        """Testing the shift function. """
+        """Testing the shift function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=False, dry_run=True)
         pc = ta.parse(
         pc = ta.parse(
             expression='R = buff_t(A, "1 day") {:,contains,l} C',
             expression='R = buff_t(A, "1 day") {:,contains,l} C',

+ 7 - 7
python/grass/temporal/testsuite/unittests_temporal_algebra_grs.py

@@ -143,7 +143,7 @@ class TestTemporalAlgebraGranularity(TestCase):
         cls.del_temp_region()
         cls.del_temp_region()
 
 
     def test_common_granularity_1(self):
     def test_common_granularity_1(self):
-        """Testing the common granularity function. """
+        """Testing the common granularity function."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = "R = A : B"
         expr = "R = A : B"
         ret = ta.setup_common_granularity(expression=expr)
         ret = ta.setup_common_granularity(expression=expr)
@@ -175,7 +175,7 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(D.get_granularity(), "1 month")
         self.assertEqual(D.get_granularity(), "1 month")
 
 
     def test_common_granularity_2(self):
     def test_common_granularity_2(self):
-        """Testing the common granularity function year to month samping. """
+        """Testing the common granularity function year to month samping."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = "R = A : C"
         expr = "R = A : C"
         ret = ta.setup_common_granularity(expression=expr)
         ret = ta.setup_common_granularity(expression=expr)
@@ -194,7 +194,7 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(D.get_granularity(), "1 month")
         self.assertEqual(D.get_granularity(), "1 month")
 
 
     def test_common_granularity_3(self):
     def test_common_granularity_3(self):
-        """Testing the common granularity function with gaps. """
+        """Testing the common granularity function with gaps."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = "R = A : D"
         expr = "R = A : D"
         ret = ta.setup_common_granularity(expression=expr)
         ret = ta.setup_common_granularity(expression=expr)
@@ -213,7 +213,7 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(D.get_granularity(), "1 month")
         self.assertEqual(D.get_granularity(), "1 month")
 
 
     def test_common_granularity_4(self):
     def test_common_granularity_4(self):
-        """Testing the common granularity function year to month with gaps. """
+        """Testing the common granularity function year to month with gaps."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = "R = C : D"
         expr = "R = C : D"
         ret = ta.setup_common_granularity(expression=expr)
         ret = ta.setup_common_granularity(expression=expr)
@@ -232,7 +232,7 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(D.get_granularity(), "1 month")
         self.assertEqual(D.get_granularity(), "1 month")
 
 
     def test_common_granularity_4(self):
     def test_common_granularity_4(self):
-        """Testing the common granularity function year to month with gaps. """
+        """Testing the common granularity function year to month with gaps."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = "R = C : D"
         expr = "R = C : D"
         ret = ta.setup_common_granularity(expression=expr)
         ret = ta.setup_common_granularity(expression=expr)
@@ -251,7 +251,7 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(D.get_granularity(), "1 month")
         self.assertEqual(D.get_granularity(), "1 month")
 
 
     def test_common_granularity_5(self):
     def test_common_granularity_5(self):
-        """Testing the common granularity function year to month with gaps. """
+        """Testing the common granularity function year to month with gaps."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = "R = A : C : D"
         expr = "R = A : C : D"
         ret = ta.setup_common_granularity(expression=expr)
         ret = ta.setup_common_granularity(expression=expr)
@@ -270,7 +270,7 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(D.get_granularity(), "1 month")
         self.assertEqual(D.get_granularity(), "1 month")
 
 
     def test_common_granularity_6(self):
     def test_common_granularity_6(self):
-        """Testing the common granularity function year to month with gaps. """
+        """Testing the common granularity function year to month with gaps."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = "R = if(start_month(A) > 2, A : C : D)"
         expr = "R = if(start_month(A) > 2, A : C : D)"
         ret = ta.setup_common_granularity(expression=expr)
         ret = ta.setup_common_granularity(expression=expr)

+ 6 - 6
python/grass/temporal/testsuite/unittests_temporal_algebra_mixed_stds.py

@@ -101,7 +101,7 @@ class TestTemporalAlgebraMixedDatasets(TestCase):
         cls.del_temp_region()
         cls.del_temp_region()
 
 
     def test_temporal_select_operators1(self):
     def test_temporal_select_operators1(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = A {:,during} stvds(C)",
             expression="R = A {:,during} stvds(C)",
@@ -136,7 +136,7 @@ class TestTemporalAlgebraMixedDatasets(TestCase):
         self.assertEqual(pc["STDS"]["stdstype"], "str3ds")
         self.assertEqual(pc["STDS"]["stdstype"], "str3ds")
 
 
     def test_temporal_select_operators2(self):
     def test_temporal_select_operators2(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = A {:,equal|during} stvds(C)",
             expression="R = A {:,equal|during} stvds(C)",
@@ -233,7 +233,7 @@ class TestTemporalAlgebraMixedDatasets(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_hash_operator1(self):
     def test_temporal_hash_operator1(self):
-        """Testing the hash operator function in conditional statement. """
+        """Testing the hash operator function in conditional statement."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = if(A {#,during} stvds(C) == 1, A)",
             expression="R = if(A {#,during} stvds(C) == 1, A)",
@@ -254,7 +254,7 @@ class TestTemporalAlgebraMixedDatasets(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_hash_operator2(self):
     def test_temporal_hash_operator2(self):
-        """Testing the hash operator function in conditional statement. """
+        """Testing the hash operator function in conditional statement."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = if({during}, stvds(C) {#,contains} A == 2, A)",
             expression="R = if({during}, stvds(C) {#,contains} A == 2, A)",
@@ -275,7 +275,7 @@ class TestTemporalAlgebraMixedDatasets(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_different_stds_handling1(self):
     def test_different_stds_handling1(self):
-        """Testing the handling of different stds types as output. """
+        """Testing the handling of different stds types as output."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = if({during}, stvds(C) {#,contains} str3ds(A) == 2, str3ds(A))",
             expression="R = if({during}, stvds(C) {#,contains} str3ds(A) == 2, str3ds(A))",
@@ -296,7 +296,7 @@ class TestTemporalAlgebraMixedDatasets(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_different_stds_handling2(self):
     def test_different_stds_handling2(self):
-        """Testing the handling of different stds types as output. """
+        """Testing the handling of different stds types as output."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True, dry_run=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True, dry_run=True)
         pc = ta.parse(
         pc = ta.parse(
             expression="R = if({during}, (stvds(C) {#,contains} str3ds(A)) == 2, str3ds(A))",
             expression="R = if({during}, (stvds(C) {#,contains} str3ds(A)) == 2, str3ds(A))",

+ 17 - 17
python/grass/temporal/testsuite/unittests_temporal_conditionals.py

@@ -145,7 +145,7 @@ class TestTemporalConditionals(TestCase):
         cls.del_temp_region()
         cls.del_temp_region()
 
 
     def test_temporal_condition_1(self):
     def test_temporal_condition_1(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(start_date(A) >= "2001-01-03", A)',
             expression='R = if(start_date(A) >= "2001-01-03", A)',
@@ -165,7 +165,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_2(self):
     def test_temporal_condition_2(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(expression="R = if(td(A) == 1, A)", basename="r", overwrite=True)
         ta.parse(expression="R = if(td(A) == 1, A)", basename="r", overwrite=True)
 
 
@@ -181,7 +181,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_3(self):
     def test_temporal_condition_3(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(td(A) == 1 || start_date(A) >= "2001-01-03", A)',
             expression='R = if(td(A) == 1 || start_date(A) >= "2001-01-03", A)',
@@ -201,7 +201,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_4(self):
     def test_temporal_condition_4(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(start_date(A) >= "2001-01-03", A)',
             expression='R = if(start_date(A) >= "2001-01-03", A)',
@@ -221,7 +221,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_5(self):
     def test_temporal_condition_5(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = if(start_day(A) <= 2, A)", basename="r", overwrite=True
             expression="R = if(start_day(A) <= 2, A)", basename="r", overwrite=True
@@ -239,7 +239,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_6(self):
     def test_temporal_condition_6(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(td(A) == 1 {||,during} start_date(C) < "2001-01-02", A)',
             expression='R = if(td(A) == 1 {||,during} start_date(C) < "2001-01-02", A)',
@@ -259,7 +259,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_7(self):
     def test_temporal_condition_7(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if({over},start_date(C) == "2001-01-02" {&&,contains} td(A) == 1, B)',
             expression='R = if({over},start_date(C) == "2001-01-02" {&&,contains} td(A) == 1, B)',
@@ -279,7 +279,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_condition_8(self):
     def test_temporal_condition_8(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(start_date(B) <= "2001-01-01" {||,over,|} td(E) == 2, B)',
             expression='R = if(start_date(B) <= "2001-01-01" {||,over,|} td(E) == 2, B)',
@@ -299,7 +299,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_condition_9(self):
     def test_temporal_condition_9(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(start_date(B) <= "2001-01-01" {&&,over,&} td(E) == 2, B)',
             expression='R = if(start_date(B) <= "2001-01-01" {&&,over,&} td(E) == 2, B)',
@@ -319,7 +319,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_condition_10(self):
     def test_temporal_condition_10(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(start_date(B) <= "2001-01-01" {||,over,|,r} td(E) == 2, E)',
             expression='R = if(start_date(B) <= "2001-01-01" {||,over,|,r} td(E) == 2, E)',
@@ -339,7 +339,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_condition_11(self):
     def test_temporal_condition_11(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(start_date(B) <= "2001-01-01" {&&,over,r} td(E) == 2, E)',
             expression='R = if(start_date(B) <= "2001-01-01" {&&,over,r} td(E) == 2, E)',
@@ -359,7 +359,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_condition_12(self):
     def test_temporal_condition_12(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(start_date(B) <= "2001-01-01" {&&,over,|,r} td(E) == 2, E)',
             expression='R = if(start_date(B) <= "2001-01-01" {&&,over,|,r} td(E) == 2, E)',
@@ -379,7 +379,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_conditional_13(self):
     def test_temporal_conditional_13(self):
-        """Testing the hash operator function in conditional statement. """
+        """Testing the hash operator function in conditional statement."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression="R = if({equal|during},td(B) == 2 {&&,contains} td(A) == 1, A)",
             expression="R = if({equal|during},td(B) == 2 {&&,contains} td(A) == 1, A)",
@@ -400,7 +400,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_else_1(self):
     def test_temporal_condition_else_1(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(start_date(A) <= "2001-01-03", A, D)',
             expression='R = if(start_date(A) <= "2001-01-03", A, D)',
@@ -420,7 +420,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_else_2(self):
     def test_temporal_condition_else_2(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if(td(D) == 1 && start_date(A) >= "2001-01-04", A, D)',
             expression='R = if(td(D) == 1 && start_date(A) >= "2001-01-04", A, D)',
@@ -440,7 +440,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_else_3(self):
     def test_temporal_condition_else_3(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if({during},td(B) == 2 {&&,contains} start_date(D) >= "2001-01-04", A, D)',
             expression='R = if({during},td(B) == 2 {&&,contains} start_date(D) >= "2001-01-04", A, D)',
@@ -460,7 +460,7 @@ class TestTemporalConditionals(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_condition_else_4(self):
     def test_temporal_condition_else_4(self):
-        """Testing the temporal select operator with equal relations. """
+        """Testing the temporal select operator with equal relations."""
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         ta.parse(
         ta.parse(
             expression='R = if({equal|over},start_date(B) <= "2001-01-01" {&&,over,|,r} td(E) == 2, E, B)',
             expression='R = if({equal|over},start_date(B) <= "2001-01-01" {&&,over,|,r} td(E) == 2, E, B)',

+ 13 - 13
python/grass/temporal/testsuite/unittests_temporal_raster_algebra.py

@@ -126,7 +126,7 @@ class TestTemporalRasterAlgebra(TestCase):
         cls.del_temp_region()
         cls.del_temp_region()
 
 
     def test_temporal_extent1(self):
     def test_temporal_extent1(self):
-        """Testing the temporal extent operators. """
+        """Testing the temporal extent operators."""
         ta = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         ta.parse(expression="R = A {:,during,r} C", basename="r", overwrite=True)
         ta.parse(expression="R = A {:,during,r} C", basename="r", overwrite=True)
 
 
@@ -608,7 +608,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(end, datetime.datetime(2001, 1, 4))
         self.assertEqual(end, datetime.datetime(2001, 1, 4))
 
 
     def test_tmap_function1(self):
     def test_tmap_function1(self):
-        """Testing the tmap function. """
+        """Testing the tmap function."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = tmap(singletmap)", basename="r", overwrite=True)
         tra.parse(expression="R = tmap(singletmap)", basename="r", overwrite=True)
 
 
@@ -625,7 +625,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_tmap_function2(self):
     def test_tmap_function2(self):
-        """Testing the tmap function. """
+        """Testing the tmap function."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = tmap(singletmap) + 1", basename="r", overwrite=True)
         tra.parse(expression="R = tmap(singletmap) + 1", basename="r", overwrite=True)
 
 
@@ -642,7 +642,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_map_function1(self):
     def test_map_function1(self):
-        """Testing the map function. """
+        """Testing the map function."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = map(singlemap) + A", basename="r", overwrite=True)
         tra.parse(expression="R = map(singlemap) + A", basename="r", overwrite=True)
 
 
@@ -659,7 +659,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_map_function2(self):
     def test_map_function2(self):
-        """Testing the map function. """
+        """Testing the map function."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R =  A * map(singlemap)", basename="r", overwrite=True)
         tra.parse(expression="R =  A * map(singlemap)", basename="r", overwrite=True)
 
 
@@ -676,7 +676,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select(self):
     def test_temporal_select(self):
-        """Testing the temporal select operator. """
+        """Testing the temporal select operator."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = A : A", basename="r", overwrite=True)
         tra.parse(expression="R = A : A", basename="r", overwrite=True)
 
 
@@ -692,7 +692,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select(self):
     def test_temporal_select(self):
-        """Testing the temporal select operator. """
+        """Testing the temporal select operator."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = A : D", basename="r", overwrite=True)
         tra.parse(expression="R = A : D", basename="r", overwrite=True)
 
 
@@ -708,7 +708,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select_operators1(self):
     def test_temporal_select_operators1(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = A : D", basename="r", overwrite=True)
         tra.parse(expression="R = A : D", basename="r", overwrite=True)
 
 
@@ -724,7 +724,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select_operators2(self):
     def test_temporal_select_operators2(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = A {!:,during} C", basename="r", overwrite=True)
         tra.parse(expression="R = A {!:,during} C", basename="r", overwrite=True)
 
 
@@ -779,7 +779,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_hash_operator1(self):
     def test_temporal_hash_operator1(self):
-        """Testing the temporal hash operator in the raster algebra. """
+        """Testing the temporal hash operator in the raster algebra."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = if(A # D == 1, A)", basename="r", overwrite=True)
         tra.parse(expression="R = if(A # D == 1, A)", basename="r", overwrite=True)
 
 
@@ -795,7 +795,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_hash_operator2(self):
     def test_temporal_hash_operator2(self):
-        """Testing the temporal hash operator in the raster algebra. """
+        """Testing the temporal hash operator in the raster algebra."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = A # D", basename="r", overwrite=True)
         tra.parse(expression="R = A # D", basename="r", overwrite=True)
 
 
@@ -811,7 +811,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_hash_operator3(self):
     def test_temporal_hash_operator3(self):
-        """Testing the temporal hash operator in the raster algebra. """
+        """Testing the temporal hash operator in the raster algebra."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(expression="R = C {#,contains} A", basename="r", overwrite=True)
         tra.parse(expression="R = C {#,contains} A", basename="r", overwrite=True)
 
 
@@ -827,7 +827,7 @@ class TestTemporalRasterAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_hash_operator4(self):
     def test_temporal_hash_operator4(self):
-        """Testing the temporal hash operator in the raster algebra. """
+        """Testing the temporal hash operator in the raster algebra."""
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra = tgis.TemporalRasterAlgebraParser(run=True, debug=True)
         tra.parse(
         tra.parse(
             expression="R = if({contains},A # D == 1, C {#,contains} A)",
             expression="R = if({contains},A # D == 1, C {#,contains} A)",

+ 3 - 3
python/grass/temporal/testsuite/unittests_temporal_vector_algebra.py

@@ -157,7 +157,7 @@ class TestTemporalVectorAlgebra(TestCase):
         cls.del_temp_region()
         cls.del_temp_region()
 
 
     def test_temporal_select(self):
     def test_temporal_select(self):
-        """Testing the temporal select operator. """
+        """Testing the temporal select operator."""
         tva = tgis.TemporalVectorAlgebraParser(run=True, debug=True)
         tva = tgis.TemporalVectorAlgebraParser(run=True, debug=True)
         tva.parse(expression="R = A : A", basename="r", overwrite=True)
         tva.parse(expression="R = A : A", basename="r", overwrite=True)
 
 
@@ -175,7 +175,7 @@ class TestTemporalVectorAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_extent1(self):
     def test_temporal_extent1(self):
-        """Testing the temporal extent operators. """
+        """Testing the temporal extent operators."""
         ta = tgis.TemporalVectorAlgebraParser(run=True, debug=True)
         ta = tgis.TemporalVectorAlgebraParser(run=True, debug=True)
         ta.parse(expression="R = A {:,during,r} C", basename="r", overwrite=True)
         ta.parse(expression="R = A {:,during,r} C", basename="r", overwrite=True)
 
 
@@ -192,7 +192,7 @@ class TestTemporalVectorAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_select_operators(self):
     def test_temporal_select_operators(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
         tva = tgis.TemporalVectorAlgebraParser(run=True, debug=True)
         tva = tgis.TemporalVectorAlgebraParser(run=True, debug=True)
         tva.parse(expression="R = A {:,during} C", basename="r", overwrite=True)
         tva.parse(expression="R = A {:,during} C", basename="r", overwrite=True)
 
 

+ 1 - 1
raster/r.contour/testsuite/testrc.py

@@ -107,7 +107,7 @@ class Testrr(TestCase):
         self.assertVectorFitsTopoInfo(self.output, topology)
         self.assertVectorFitsTopoInfo(self.output, topology)
 
 
     def test_v_db_select(self):
     def test_v_db_select(self):
-        """Testing attribute values of contours with v.db.select """
+        """Testing attribute values of contours with v.db.select"""
         self.assertModule("r.contour", input=self.input, output=self.output, step=2)
         self.assertModule("r.contour", input=self.input, output=self.output, step=2)
         v_db_select = SimpleModule("v.db.select", map=self.output)
         v_db_select = SimpleModule("v.db.select", map=self.output)
         v_db_select.run()
         v_db_select.run()

+ 1 - 1
raster/r.reclass/testsuite/test_r_reclass.py

@@ -48,7 +48,7 @@ class Testrr(TestCase):
         self.runModule("g.remove", type="raster", flags="f", name=self.output)
         self.runModule("g.remove", type="raster", flags="f", name=self.output)
 
 
     def test_rules1(self):
     def test_rules1(self):
-        """Testing rules 1 """
+        """Testing rules 1"""
         reclass = SimpleModule(
         reclass = SimpleModule(
             "r.reclass", input=self.input, output=self.output, rules="-"
             "r.reclass", input=self.input, output=self.output, rules="-"
         )
         )

+ 5 - 5
scripts/i.pansharpen/i.pansharpen.py

@@ -458,7 +458,7 @@ def main():
             "g.remove", flags="f", type="raster", pattern="tmp%s*" % pid, quiet=True
             "g.remove", flags="f", type="raster", pattern="tmp%s*" % pid, quiet=True
         )
         )
     except:
     except:
-        ""
+        pass
 
 
 
 
 def brovey(pan, ms1, ms2, ms3, out, pid, sproc):
 def brovey(pan, ms1, ms2, ms3, out, pid, sproc):
@@ -523,7 +523,7 @@ def brovey(pan, ms1, ms2, ms3, out, pid, sproc):
         try:
         try:
             pb.terminate(), pg.terminate(), pr.terminate()
             pb.terminate(), pg.terminate(), pr.terminate()
         except:
         except:
-            ""
+            pass
 
 
     # Cleanup
     # Cleanup
     try:
     try:
@@ -535,7 +535,7 @@ def brovey(pan, ms1, ms2, ms3, out, pid, sproc):
             name="%s,%s,%s" % (panmatch1, panmatch2, panmatch3),
             name="%s,%s,%s" % (panmatch1, panmatch2, panmatch3),
         )
         )
     except:
     except:
-        ""
+        pass
 
 
 
 
 def ihs(pan, ms1, ms2, ms3, out, pid, sproc):
 def ihs(pan, ms1, ms2, ms3, out, pid, sproc):
@@ -577,7 +577,7 @@ def ihs(pan, ms1, ms2, ms3, out, pid, sproc):
             "g.remove", flags="f", quiet=True, type="raster", name=panmatch
             "g.remove", flags="f", quiet=True, type="raster", name=panmatch
         )
         )
     except:
     except:
-        ""
+        pass
 
 
 
 
 def pca(pan, ms1, ms2, ms3, out, pid, sproc):
 def pca(pan, ms1, ms2, ms3, out, pid, sproc):
@@ -704,7 +704,7 @@ def pca(pan, ms1, ms2, ms3, out, pid, sproc):
         try:
         try:
             pb.terminate(), pg.terminate(), pr.terminate()
             pb.terminate(), pg.terminate(), pr.terminate()
         except:
         except:
-            ""
+            pass
 
 
     # Cleanup
     # Cleanup
     grass.run_command(
     grass.run_command(

+ 12 - 12
temporal/t.rast.algebra/testsuite/test_raster_algebra.py

@@ -512,7 +512,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(end, datetime.datetime(2001, 1, 4))
         self.assertEqual(end, datetime.datetime(2001, 1, 4))
 
 
     def test_tmap_function1(self):
     def test_tmap_function1(self):
-        """Testing the tmap function. """
+        """Testing the tmap function."""
 
 
         self.assertModule(
         self.assertModule(
             "t.rast.algebra", expression="R = tmap(singletmap)", basename="r"
             "t.rast.algebra", expression="R = tmap(singletmap)", basename="r"
@@ -531,7 +531,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_tmap_function2(self):
     def test_tmap_function2(self):
-        """Testing the tmap function. """
+        """Testing the tmap function."""
 
 
         self.assertModule(
         self.assertModule(
             "t.rast.algebra", expression="R = tmap(singletmap) + 1", basename="r"
             "t.rast.algebra", expression="R = tmap(singletmap) + 1", basename="r"
@@ -550,7 +550,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_map_function1(self):
     def test_map_function1(self):
-        """Testing the map function. """
+        """Testing the map function."""
 
 
         self.assertModule(
         self.assertModule(
             "t.rast.algebra", expression="R = map(singlemap) + A", basename="r"
             "t.rast.algebra", expression="R = map(singlemap) + A", basename="r"
@@ -569,7 +569,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_map_function2(self):
     def test_map_function2(self):
-        """Testing the map function. """
+        """Testing the map function."""
 
 
         self.assertModule(
         self.assertModule(
             "t.rast.algebra", expression="R =  A * map(singlemap)", basename="r"
             "t.rast.algebra", expression="R =  A * map(singlemap)", basename="r"
@@ -588,7 +588,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select(self):
     def test_temporal_select(self):
-        """Testing the temporal select operator. """
+        """Testing the temporal select operator."""
 
 
         self.assertModule("t.rast.algebra", expression="R = A : A", basename="r")
         self.assertModule("t.rast.algebra", expression="R = A : A", basename="r")
 
 
@@ -604,7 +604,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select(self):
     def test_temporal_select(self):
-        """Testing the temporal select operator. """
+        """Testing the temporal select operator."""
 
 
         self.assertModule("t.rast.algebra", expression="R = A : D", basename="r")
         self.assertModule("t.rast.algebra", expression="R = A : D", basename="r")
 
 
@@ -620,7 +620,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select_operators1(self):
     def test_temporal_select_operators1(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
 
 
         self.assertModule("t.rast.algebra", expression="R = A : D", basename="r")
         self.assertModule("t.rast.algebra", expression="R = A : D", basename="r")
 
 
@@ -636,7 +636,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select_operators2(self):
     def test_temporal_select_operators2(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
 
 
         self.assertModule(
         self.assertModule(
             "t.rast.algebra", expression="R = A {!:,during} C", basename="r"
             "t.rast.algebra", expression="R = A {!:,during} C", basename="r"
@@ -697,7 +697,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_hash_operator1(self):
     def test_temporal_hash_operator1(self):
-        """Testing the temporal hash operator in the raster algebra. """
+        """Testing the temporal hash operator in the raster algebra."""
 
 
         self.assertModule(
         self.assertModule(
             "t.rast.algebra", expression="R = if(A # D == 1, A)", basename="r"
             "t.rast.algebra", expression="R = if(A # D == 1, A)", basename="r"
@@ -715,7 +715,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_hash_operator2(self):
     def test_temporal_hash_operator2(self):
-        """Testing the temporal hash operator in the raster algebra. """
+        """Testing the temporal hash operator in the raster algebra."""
 
 
         self.assertModule("t.rast.algebra", expression="R = A # D", basename="r")
         self.assertModule("t.rast.algebra", expression="R = A # D", basename="r")
 
 
@@ -731,7 +731,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_hash_operator3(self):
     def test_temporal_hash_operator3(self):
-        """Testing the temporal hash operator in the raster algebra. """
+        """Testing the temporal hash operator in the raster algebra."""
 
 
         self.assertModule(
         self.assertModule(
             "t.rast.algebra", expression="R = C {#,contains} A", basename="r"
             "t.rast.algebra", expression="R = C {#,contains} A", basename="r"
@@ -749,7 +749,7 @@ class TestTRastAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "2 days")
         self.assertEqual(D.get_granularity(), "2 days")
 
 
     def test_temporal_hash_operator4(self):
     def test_temporal_hash_operator4(self):
-        """Testing the temporal hash operator in the raster algebra. """
+        """Testing the temporal hash operator in the raster algebra."""
 
 
         self.assertModule(
         self.assertModule(
             "t.rast.algebra",
             "t.rast.algebra",

+ 2 - 2
temporal/t.vect.algebra/testsuite/test_vector_algebra.py

@@ -121,7 +121,7 @@ class TestTemporalVectorAlgebra(TestCase):
         cls.del_temp_region()
         cls.del_temp_region()
 
 
     def test_temporal_select(self):
     def test_temporal_select(self):
-        """Testing the temporal select operator. """
+        """Testing the temporal select operator."""
 
 
         self.assertModule("t.vect.algebra", expression="R = A : A", basename="r")
         self.assertModule("t.vect.algebra", expression="R = A : A", basename="r")
 
 
@@ -138,7 +138,7 @@ class TestTemporalVectorAlgebra(TestCase):
         self.assertEqual(D.get_granularity(), "1 day")
         self.assertEqual(D.get_granularity(), "1 day")
 
 
     def test_temporal_select_operators(self):
     def test_temporal_select_operators(self):
-        """Testing the temporal select operator. Including temporal relations. """
+        """Testing the temporal select operator. Including temporal relations."""
 
 
         self.assertModule(
         self.assertModule(
             "t.vect.algebra", expression="R = A {:,during} C", basename="r"
             "t.vect.algebra", expression="R = A {:,during} C", basename="r"

+ 3 - 3
vector/v.extract/testsuite/test_v_extract.py

@@ -57,7 +57,7 @@ class TestRasterreport(TestCase):
         cls.runModule("g.remove", flags="f", type="vector", name=cls.output)
         cls.runModule("g.remove", flags="f", type="vector", name=cls.output)
 
 
     def test_flagd(self):
     def test_flagd(self):
-        """Testing flag d """
+        """Testing flag d"""
         self.assertModule(
         self.assertModule(
             "v.extract", input=self.input, output=self.output, cats="1,2,3,4"
             "v.extract", input=self.input, output=self.output, cats="1,2,3,4"
         )
         )
@@ -69,7 +69,7 @@ class TestRasterreport(TestCase):
         )
         )
 
 
     def test_cats2(self):
     def test_cats2(self):
-        """Testing cats=2 """
+        """Testing cats=2"""
         self.assertModule(
         self.assertModule(
             "v.extract",
             "v.extract",
             input=self.geology,
             input=self.geology,
@@ -91,7 +91,7 @@ class TestRasterreport(TestCase):
         )
         )
 
 
     def test_flatr(self):
     def test_flatr(self):
-        """Testing flag r """
+        """Testing flag r"""
         self.assertModule(
         self.assertModule(
             "v.extract", input=self.geology, output=self.output, flags="r", cats=1
             "v.extract", input=self.geology, output=self.output, flags="r", cats=1
         )
         )

+ 2 - 2
vector/v.select/testsuite/test_v_select.py

@@ -46,7 +46,7 @@ class TestRasterReport(TestCase):
         self.assertVectorFitsTopoInfo(self.overlap, topology)
         self.assertVectorFitsTopoInfo(self.overlap, topology)
 
 
     def test_opd(self):
     def test_opd(self):
-        """Testign operator disjoint """
+        """Testign operator disjoint"""
         self.assertModule(
         self.assertModule(
             "v.select",
             "v.select",
             ainput=self.ainput,
             ainput=self.ainput,
@@ -58,7 +58,7 @@ class TestRasterReport(TestCase):
         self.assertVectorFitsTopoInfo(self.disjoint, topology)
         self.assertVectorFitsTopoInfo(self.disjoint, topology)
 
 
     def test_ope(self):
     def test_ope(self):
-        """Testing operator equals """
+        """Testing operator equals"""
         self.assertModule(
         self.assertModule(
             "v.select",
             "v.select",
             ainput=self.ainput,
             ainput=self.ainput,

+ 1 - 1
vector/v.vect.stats/testsuite/test_vect_stats.py

@@ -156,7 +156,7 @@ class Testrr(TestCase):
         self.assertLooksLike(reference=string, actual=v_vect_stats.outputs.stdout)
         self.assertLooksLike(reference=string, actual=v_vect_stats.outputs.stdout)
 
 
     def test_mode(self):
     def test_mode(self):
-        """Testing method mode """
+        """Testing method mode"""
         string = """area_cat|count|mode
         string = """area_cat|count|mode
         1|0|null
         1|0|null
         2|0|null
         2|0|null