Skip to content

error in temporal algebra #12

@petrasovaa

Description

@petrasovaa

In the example in the third time series tutorial (algebra) I am getting this error:

# Get time series with month of maximum LST
expression="month_max_lst = if({during}, lst_daily == tmap(lst_maximum), start_month(), null())"

gs.run_command("t.rast.algebra",
               basename="month_max_lst",
               expression=expression,
               suffix="gran",
               nprocs=4)
Traceback (most recent call last):
  File "/home/akratoc/dev/grass/grass_main/dist.x86_64-pc-linux-gnu/scripts/t.rast.algebra", line 146, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/akratoc/dev/grass/grass_main/dist.x86_64-pc-linux-gnu/scripts/t.rast.algebra", line 136, in main
    pc = p.parse(expression, basename, gs.overwrite())
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/akratoc/dev/grass/grass_main/dist.x86_64-pc-linux-gnu/etc/python/grass/temporal/temporal_raster_algebra.py", line 126, in parse
    self.parser.parse(expression)
  File "/usr/lib/python3/dist-packages/ply/yacc.py", line 333, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ply/yacc.py", line 1201, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ply/yacc.py", line 192, in call_errorfunc
    r = errorfunc(token)
        ^^^^^^^^^^^^^^^^
  File "/home/akratoc/dev/grass/grass_main/dist.x86_64-pc-linux-gnu/etc/python/grass/temporal/temporal_algebra.py", line 3416, in p_error
    raise SyntaxError(
SyntaxError: syntax error on line 1, position 42 token TMAP near 'tmap' expression 'month_max_lst = if({during}, lst_daily == tmap(lst_maximum), start_month(), null())'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions