Python/pygrass: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
mNo edit summary
(add how to test pygrass)
Line 1: Line 1:
''pygrass'' is a library that extends the GRASS capabilities to allow users to access the low-level GRASS API.
''pygrass'' is a library that extends the GRASS capabilities to allow users to access the low-level GRASS API.
== How to test library ==
''pygrass'' has doctest inside its code. You can run doctest inside the [http://grass.osgeo.org/sampledata/north_carolina/nc_basic_spm_grass7.tar.gz North Carolina basic location], using the mapset '''user1'''.
To test the single module (file) you have to move to the source code of pygrass and run the following code (this is an example of functions.py):
<source lang="bash">
python -m doctest functions.py
</source>
=== Already tested modules ===
* functions.py
* gis/region.py
* gis/__init__.py
* vector/abstract.py
* vector/__init__.py


{{Python}}
{{Python}}

Revision as of 13:17, 5 February 2013

pygrass is a library that extends the GRASS capabilities to allow users to access the low-level GRASS API.

How to test library

pygrass has doctest inside its code. You can run doctest inside the North Carolina basic location, using the mapset user1.

To test the single module (file) you have to move to the source code of pygrass and run the following code (this is an example of functions.py):

 python -m doctest functions.py

Already tested modules

  • functions.py
  • gis/region.py
  • gis/__init__.py
  • vector/abstract.py
  • vector/__init__.py