Skip to content

Commit

Permalink
TGIS: any number of "_" is allowed in semantic labels (#2238)
Browse files Browse the repository at this point in the history
  • Loading branch information
metzm committed Feb 26, 2022
1 parent 31afeac commit 9a3920c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions python/grass/temporal/abstract_space_time_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1571,12 +1571,16 @@ def leading_zero(value):
where += "semantic_label IN ('{}'".format(self.semantic_label)

# be zero-padding less sensitive
shortcut, identifier = self.semantic_label.split("_", -1)
identifier_zp = leading_zero(identifier)
if identifier_zp:
where += ", '{fl}_{zp}'".format(
fl=shortcut.upper(), zp=identifier_zp.upper()
)
try:
shortcut, identifier = self.semantic_label.split("_", -1)
identifier_zp = leading_zero(identifier)
if identifier_zp:
where += ", '{fl}_{zp}'".format(
fl=shortcut.upper(), zp=identifier_zp.upper()
)
except ValueError:
# any number of "_" is allowed in semantic labels
pass

# close WHERE statement
where += ")"
Expand Down

0 comments on commit 9a3920c

Please sign in to comment.