Browse Source

i.band: lazy np import (#127)

Martin Landa 5 years ago
parent
commit
cf199557d0
1 changed files with 4 additions and 1 deletions
  1. 4 1
      scripts/i.band/i.band.py

+ 4 - 1
scripts/i.band/i.band.py

@@ -45,7 +45,6 @@
 import sys
 import sys
 
 
 import grass.script as gs
 import grass.script as gs
-from grass.pygrass.raster import RasterRow
 from grass.exceptions import GrassError, OpenError
 from grass.exceptions import GrassError, OpenError
 
 
 def print_map_band_reference(name, band_reader):
 def print_map_band_reference(name, band_reader):
@@ -53,6 +52,8 @@ def print_map_band_reference(name, band_reader):
 
 
     :param str name: raster map name
     :param str name: raster map name
     """
     """
+    from grass.pygrass.raster import RasterRow
+
     try:
     try:
         with RasterRow(name) as rast:
         with RasterRow(name) as rast:
             band_ref = rast.info.band_reference
             band_ref = rast.info.band_reference
@@ -72,6 +73,8 @@ def manage_map_band_reference(name, band_ref):
 
 
     :return int: return code
     :return int: return code
     """
     """
+    from grass.pygrass.raster import RasterRow
+
     try:
     try:
         with RasterRow(name) as rast:
         with RasterRow(name) as rast:
             if band_ref:
             if band_ref: