Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i.gensig: Add support of original class value in sig file (for i.maxlik) #2425

Merged
merged 9 commits into from
Jun 18, 2022
3 changes: 1 addition & 2 deletions imagery/i.gensig/testsuite/test_i_gensig.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import os
import stat
import ctypes
import pathlib
import shutil

from grass.pygrass import utils
Expand Down Expand Up @@ -44,7 +43,7 @@ def setUpClass(cls):
"""Ensures expected computational region and generated data"""
cls.use_temp_region()
cls.runModule("g.region", n=5, s=0, e=5, w=0, res=1)
cls.data_dir = os.path.join(pathlib.Path(__file__).parent.absolute(), "data")
cls.data_dir = "data"
cls.mpath = utils.decode(G_mapset_path())
cls.mapset_name = Mapset().name

Expand Down
12 changes: 12 additions & 0 deletions imagery/i.gensig/testsuite/test_keyvalue_result.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
time=1.103s
wenzeslaus marked this conversation as resolved.
Show resolved Hide resolved
status=succeeded
total=1
failures=0
errors=0
successes=1
skipped=0
expected_failures=0
unexpected_successes=0
tested_modules=i.gensig
supplementary_files=
test_type=not-specified
2 changes: 1 addition & 1 deletion lib/imagery/sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ int I_read_signatures(FILE * fd, struct Signature *S)

/* Read marker of original class value presence */
if (ver >= 2 && fscanf(fd, "%d", &S->have_oclass) != 1) {
G_warning(_("Invalid signature file"));
G_warning(_("Invalid signature file: Original class value presence not readable"));
return -1;
}

Expand Down