From 17dac199ea161e3e3494d13c38f65763463bcf3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81ris=20Narti=C5=A1s?= Date: Wed, 27 Mar 2024 02:15:23 +0200 Subject: [PATCH] Document that GRASS jupyter enables overwrite by default (#3516) * Document that GRASS jupyter enables overwrite by default * Update python/grass/jupyter/__init__.py Explain rationale for defaulting to overwrite Co-authored-by: Vaclav Petras Improve syntax Co-authored-by: Vaclav Petras * Shorten line length of lines commited directly from GH --------- Co-authored-by: Vaclav Petras --- python/grass/jupyter/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/grass/jupyter/__init__.py b/python/grass/jupyter/__init__.py index 246f6d7b3ab..91457f07ac3 100644 --- a/python/grass/jupyter/__init__.py +++ b/python/grass/jupyter/__init__.py @@ -50,6 +50,14 @@ >>> gj.init("grassdata/nc_basic_spm_grass7/user1") +.. note:: + Contrary to typical command line / GUI module usage, grass.jupyter + enables output overwrite by default to align with behaviour of other + Python packages and to allow repeated executions of the same cells and + of the whole notebook. The default command line behaviour can be + restored by setting GRASS_OVERWRITE environmental variable to "0" after + `gj.init()` call: `os.environ["GRASS_OVERWRITE"] = "0"`. + All classes and functions for interaction in notebooks are now available under *gj*, for example we can display a map with a selected raster and vector::