-
-
Notifications
You must be signed in to change notification settings - Fork 362
doc: Replace grass.script by grass.tools #6111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Letting you finalize the commit message
Replaces grass.script run_command calls by grass.tools in the main documentation. This will eventually include wording about the stability of the API.