Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gui/wxpython/iscatt/core_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def ApplyColormap(vals, vals_mask, colmap, out_vals):

def MergeArrays(merged_arr, overlay_arr, alpha):
if merged_arr.shape != overlay_arr.shape:
GException("MergeArrays: merged_arr.shape != overlay_arr.shape")
msg = "MergeArrays: merged_arr.shape != overlay_arr.shape"
raise GException(msg)

c_uint8_p = POINTER(c_uint8)
merged_p = merged_arr.ctypes.data_as(c_uint8_p)
Expand Down
13 changes: 7 additions & 6 deletions gui/wxpython/iscatt/iscatt_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def ComputeCatsScatts(self, cats_ids):
)

if returncode < 0:
GException(_("Computing of scatter plots failed."))
raise GException(_("Computing of scatter plots failed."))

def CatRastUpdater(self):
return self.cat_rast_updater
Expand Down Expand Up @@ -274,7 +274,7 @@ def _updateCatRast(self, bbox, areas_cats, updated_cats):
region = self.an_data.GetRegion()
ret = UpdateCatRast(patch_rast, region, self.scatts_dt.GetCatRastCond(cat))
if ret < 0:
GException(_("Patching category raster conditions file failed."))
raise GException(_("Patching category raster conditions file failed."))
RunCommand("g.remove", flags="f", type="raster", name=patch_rast)

def _rasterize(self, grass_region, layer, cat, out_rast):
Expand All @@ -296,7 +296,7 @@ def _rasterize(self, grass_region, layer, cat, out_rast):
)

if ret != 0:
GException(_("v.build failed:\n%s") % msg)
raise GException(_("v.build failed:\n%s") % msg)

environs = os.environ.copy()
environs["GRASS_REGION"] = grass_region["GRASS_REGION"]
Expand All @@ -316,7 +316,7 @@ def _rasterize(self, grass_region, layer, cat, out_rast):
)

if ret != 0:
GException(_("v.to.rast failed:\n{messages}").format(messages=msg))
raise GException(_("v.to.rast failed:\n{messages}").format(messages=msg))

def _create_grass_region_env(self, bbox):
r = self.an_data.GetRegion()
Expand Down Expand Up @@ -383,15 +383,16 @@ def Create(self, bands):

self.region = GetRegion()
if self.region["rows"] * self.region["cols"] > MAX_NCELLS:
GException("too big region")
msg = "too big region"
raise GException(msg)

self.bands_info = {}

for b in self.bands[:]:
i = GetRasterInfo(b)

if i is None:
GException("raster %s is not CELL type" % (b))
raise GException("raster %s is not CELL type" % (b))

self.bands_info[b] = i
# TODO check size of raster
Expand Down
Loading