Skip to content

Commit

Permalink
Try another fix for string type rather than a255
Browse files Browse the repository at this point in the history
  • Loading branch information
petebunting committed Jul 29, 2024
1 parent ac7cfc0 commit 247e740
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/rsgislib/classification/classaccuracymetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1867,9 +1867,9 @@ def create_modelled_acc_pts(
if abs(err_mtx_unit_area_arr.sum() - 1) > 0.0001:
raise rsgislib.RSGISPyException("The error matrix does not sum to 1")

out_ref_arr = numpy.empty(n_pts, dtype=str)
out_ref_arr = numpy.empty(n_pts, dtype=numpy.dtype("U255"))
out_ref_arr[...] = ""
out_cls_arr = numpy.empty(n_pts, dtype=str)
out_cls_arr = numpy.empty(n_pts, dtype=numpy.dtype("U255"))
out_cls_arr[...] = ""

s_ref_idx = 0
Expand Down
4 changes: 2 additions & 2 deletions python/rsgislib/rastergis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def set_class_names_colours(
if class_names_col_avail:
class_names_arr = rat.readColumn(rat_dataset, class_names_col)
else:
class_names_arr = numpy.zeros(n_rows, dtype=str)
class_names_arr = numpy.zeros(n_rows, dtype=numpy.dtype("U255"))

for class_key in class_info_dict:
if (class_key >= 0) and (class_key < n_rows):
Expand Down Expand Up @@ -534,7 +534,7 @@ def define_class_names(
def _ratapplier_def_class_names(info, inputs, outputs, otherargs):
classNum = getattr(inputs.inrat, otherargs.classNumCol)

class_names = numpy.empty_like(classNum, dtype=str)
class_names = numpy.empty_like(classNum, dtype=numpy.dtype("U255"))
class_names[...] = ""

for key in otherargs.classNamesDict:
Expand Down

0 comments on commit 247e740

Please sign in to comment.