doc: Replace grass.script by grass.tools#6111
Merged
wenzeslaus merged 7 commits intoOSGeo:mainfrom Jul 31, 2025
Merged
Conversation
Member
|
I have a general question here. Do we have an idea of the performance difference between both usages? Maybe hard to evaluate, but it will be one of the most used code paths at one point |
2778a84 to
e31b5ac
Compare
Member
Author
|
Performance: Just from the code analysis, there will be only a small difference at this point. Something goes to the attribute lookup and then to the StringIO identification. There will be more if we add, and by default enable, some of the other features, especially the pack IO adds extra cost. Anyway, at this point, there is no significant difference: $ grass ~/grassdata/nc_spm_08_grass7/PERMANENT/ --exec python -m timeit -n 100 -c "import grass.script as gs; gs.read_command('g.region', flags='p')"
100 loops, best of 5: 32.1 msec per loop
$ grass ~/grassdata/nc_spm_08_grass7/PERMANENT/ --exec python -m timeit -n 100 -c "from grass.tools import Tools; tools = Tools(); tools.g_region(flags='p').text"
100 loops, best of 5: 32 msec per loop |
145b6a3 to
0282091
Compare
echoix
reviewed
Jul 27, 2025
Member
echoix
left a comment
There was a problem hiding this comment.
I used a spell check software after noticing a couple odd places.
Replaces grass.script run_command calls by grass.tools in the main documentation. This will eventually include wording about the stability of the API.
… split and rename pygrass
0282091 to
dba20c5
Compare
echoix
approved these changes
Jul 30, 2025
Member
echoix
left a comment
There was a problem hiding this comment.
Letting you finalize the commit message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces grass.script run_command calls by grass.tools in the main documentation. This will eventually include wording about the stability of the API.