[GRASS-git] [OSGeo/grass] 265468: grass.jupyter: Use grass.tools for running and att...
Vaclav Petras
noreply at github.com
Mon Sep 8 19:12:51 PDT 2025
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: 2654684603202c96725e2925bc3c11b8c1594201
https://github.com/OSGeo/grass/commit/2654684603202c96725e2925bc3c11b8c1594201
Author: Vaclav Petras <wenzeslaus at gmail.com>
Date: 2025-09-08 (Mon, 08 Sep 2025)
Changed paths:
M python/grass/jupyter/map.py
M python/grass/jupyter/tests/conftest.py
A python/grass/jupyter/tests/grass_jupyter_map_numpy_test.py
A python/grass/jupyter/tests/grass_jupyter_map_test.py
M python/grass/jupyter/testsuite/map_test.py
M python/grass/jupyter/utils.py
M python/grass/tools/support.py
M python/grass/tools/tests/grass_tools_tool_function_wrap_test.py
Log Message:
-----------
grass.jupyter: Use grass.tools for running and attributes in Map (#6314)
Uses Tools from grass.tools to run the underlying display tool. This allows NumPy arrays to be passed to display tools when used with grass.jupyter.Map. Small adjustments to automatic region handling were needed so that the arrays are ignored (and only raster names, i.e., strings, are used).
The Map objects already allow syntax similar to Tools in terms of access to tools as attributes. This migrates the attribute access handling to use the functionality from grass.tools.support and overall syncs the code to Tools. As a result, Map provides the same error messages and attribute completion as Tools. To achieve expected results with the limit for display tools only, the underlying class now supports an allowed prefix parameter which limits the tools to only those with the allowed prefix (and Map sets this prefix).
For further sync with Tools, Map now accepts a session parameter in the same way as Tools (except that env is copied at creation, not linked, but that keeps the current Map behavior with the env parameter - Map always modifies the env and needs the env to be consistent, while Tools typically does not touch the env and may be used in context where the env is changed).
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