[GRASS-git] [OSGeo/grass] c01bfe: grass.tools: Use new ToolError, not CalledModuleEr...

Vaclav Petras noreply at github.com
Thu Sep 25 07:21:05 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: c01bfed6998b194e4b653ccb3af4d8413c60b9f1
      https://github.com/OSGeo/grass/commit/c01bfed6998b194e4b653ccb3af4d8413c60b9f1
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2025-09-25 (Thu, 25 Sep 2025)

  Changed paths:
    M lib/gis/parser_md_python.c
    M python/grass/exceptions/__init__.py
    M python/grass/script/core.py
    M python/grass/tools/__init__.py
    M python/grass/tools/session_tools.py
    M python/grass/tools/tests/conftest.py
    M python/grass/tools/tests/grass_tools_session_tools_test.py
    A python/grass/tools/tests/grass_tools_tool_error_test.py

  Log Message:
  -----------
  grass.tools: Use new ToolError, not CalledModuleError (#6366)

The new ToolError tries to be even more aligned with CalledProcessError (by focusing on cmd and not tool and code like CalledModuleError), while providing messages more tailored towards Tools object and use cases. It also tries to polish further short one-line messages and distinguish between empty stderr and not captures stderr. API and documentation of it is more narrow and focused on the Tools use case specifically and includes type annotations.

Document exception also in each tool page in the Parameters section followed by Returns: and Raises: blocks. The new Raises: block again mimics docs like NumPy (like the Returns: block), but with some liberty (it is in fact under section Parameters and it uses bold, emphasis and indent differently because of consistency with how we want the parameters to be represented and technical limitations related to indents which we do manually). The "tool" terminology now creates a consistent result in the doc (CalledModuleError was not on the tool pages because it would not be consistent).



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list