Bladeren bron

fix doctests

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74326 15284696-431f-4ddb-bdfa-cd5b030d7da7
Stefan Blumentrath 6 jaren geleden
bovenliggende
commit
939dca0148
1 gewijzigde bestanden met toevoegingen van 32 en 32 verwijderingen
  1. 32 32
      lib/python/script/array.py

+ 32 - 32
lib/python/script/array.py

@@ -23,10 +23,10 @@ Usage:
 ...
 >>> # Lets have a look at the array
 ... print(map2d_1)
-[[ 0.  1.  2.  3.  4.  5.]
- [ 1.  2.  3.  4.  5.  6.]
- [ 2.  3.  4.  5.  6.  7.]
- [ 3.  4.  5.  6.  7.  8.]]
+[[0. 1. 2. 3. 4. 5.]
+ [1. 2. 3. 4. 5. 6.]
+ [2. 3. 4. 5. 6. 7.]
+ [3. 4. 5. 6. 7. 8.]]
 >>> # This will write the numpy array as GRASS raster map
 ... # with name map2d_1
 ... map2d_1.write(mapname="map2d_1", overwrite=True)
@@ -39,10 +39,10 @@ Usage:
 ... map2d_2 %= 3
 >>> # Show the result
 ... print(map2d_2)
-[[ 0.  1.  2.  0.  1.  2.]
- [ 1.  2.  0.  1.  2.  0.]
- [ 2.  0.  1.  2.  0.  1.]
- [ 0.  1.  2.  0.  1.  2.]]
+[[0. 1. 2. 0. 1. 2.]
+ [1. 2. 0. 1. 2. 0.]
+ [2. 0. 1. 2. 0. 1.]
+ [0. 1. 2. 0. 1. 2.]]
 >>> # Write the result as new raster map with name map2d_2
 ... map2d_2.write(mapname="map2d_2", overwrite=True)
 0
@@ -60,20 +60,20 @@ Usage:
 ...
 >>> # Lets have a look at the 3D array
 ... print(map3d_1)
-[[[  0.   1.   2.   3.   4.   5.]
-  [  1.   2.   3.   4.   5.   6.]
-  [  2.   3.   4.   5.   6.   7.]
-  [  3.   4.   5.   6.   7.   8.]]
+[[[ 0.  1.  2.  3.  4.  5.]
+  [ 1.  2.  3.  4.  5.  6.]
+  [ 2.  3.  4.  5.  6.  7.]
+  [ 3.  4.  5.  6.  7.  8.]]
 <BLANKLINE>
- [[  1.   2.   3.   4.   5.   6.]
-  [  2.   3.   4.   5.   6.   7.]
-  [  3.   4.   5.   6.   7.   8.]
-  [  4.   5.   6.   7.   8.   9.]]
+ [[ 1.  2.  3.  4.  5.  6.]
+  [ 2.  3.  4.  5.  6.  7.]
+  [ 3.  4.  5.  6.  7.  8.]
+  [ 4.  5.  6.  7.  8.  9.]]
 <BLANKLINE>
- [[  2.   3.   4.   5.   6.   7.]
-  [  3.   4.   5.   6.   7.   8.]
-  [  4.   5.   6.   7.   8.   9.]
-  [  5.   6.   7.   8.   9.  10.]]]
+ [[ 2.  3.  4.  5.  6.  7.]
+  [ 3.  4.  5.  6.  7.  8.]
+  [ 4.  5.  6.  7.  8.  9.]
+  [ 5.  6.  7.  8.  9. 10.]]]
 >>> # This will write the numpy array as GRASS 3D raster map
 ... # with name map3d_1
 ... map3d_1.write(mapname="map3d_1", overwrite=True)
@@ -85,20 +85,20 @@ Usage:
 ... map3d_2 %= 3
 >>> # Show the result
 ... print(map3d_2)
-[[[ 0.  1.  2.  0.  1.  2.]
-  [ 1.  2.  0.  1.  2.  0.]
-  [ 2.  0.  1.  2.  0.  1.]
-  [ 0.  1.  2.  0.  1.  2.]]
+[[[0. 1. 2. 0. 1. 2.]
+  [1. 2. 0. 1. 2. 0.]
+  [2. 0. 1. 2. 0. 1.]
+  [0. 1. 2. 0. 1. 2.]]
 <BLANKLINE>
- [[ 1.  2.  0.  1.  2.  0.]
-  [ 2.  0.  1.  2.  0.  1.]
-  [ 0.  1.  2.  0.  1.  2.]
-  [ 1.  2.  0.  1.  2.  0.]]
+ [[1. 2. 0. 1. 2. 0.]
+  [2. 0. 1. 2. 0. 1.]
+  [0. 1. 2. 0. 1. 2.]
+  [1. 2. 0. 1. 2. 0.]]
 <BLANKLINE>
- [[ 2.  0.  1.  2.  0.  1.]
-  [ 0.  1.  2.  0.  1.  2.]
-  [ 1.  2.  0.  1.  2.  0.]
-  [ 2.  0.  1.  2.  0.  1.]]]
+ [[2. 0. 1. 2. 0. 1.]
+  [0. 1. 2. 0. 1. 2.]
+  [1. 2. 0. 1. 2. 0.]
+  [2. 0. 1. 2. 0. 1.]]]
 >>> # Write the result as new 3D raster map with name map3d_2
 ... map3d_2.write(mapname="map3d_2", overwrite=True)
 0