[GRASS-git] [OSGeo/grass] 88300a: doc: Generate zero, not type in Python examples (#...
Vaclav Petras
noreply at github.com
Mon Jun 9 13:58:26 PDT 2025
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: 88300ae4ca9b86ac95a9e5ec5183bb42aeaf3e65
https://github.com/OSGeo/grass/commit/88300ae4ca9b86ac95a9e5ec5183bb42aeaf3e65
Author: Vaclav Petras <wenzeslaus at gmail.com>
Date: 2025-06-09 (Mon, 09 Jun 2025)
Changed paths:
M lib/gis/parser_md_python.c
Log Message:
-----------
doc: Generate zero, not type in Python examples (#5855)
In the generated Python examples the type was leaking to the code, but does not make sense syntactically. For strings, we simply say string in quotes by default (if key description is not available), but for ints and floats, there is no such value (we don't have an example value), so this generates zero in the example. This will be likely wrong value for many cases, but it is valid and also something the user will likely change (and it is easy to change).
Generated r.buffer example:
```python
gs.run_command("r.buffer", input="name", output="name", distances=0.0)
```
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