Opened 3 weeks ago

Closed 2 weeks ago

#2829 closed enhancement (fixed)

FIX - wcst_import should try to print the failed input sentence to evalulate

Reported by: Bang Pham Huu Owned by: Bang Pham Huu
Priority: major Milestone:
Component: wcst_import Version: 10.4
Keywords: Cc: Dimitar Misev
Complexity: Medium

Description

for example:

  "axes": {
            "time": {
              "min": "(datetime(1970,1,1,0,0,0) + timedelta(seconds=${netcdf:variable:valid_time:min})).strftime(\"%Y-%m-%dT%H:%M\")",
              "max": "(datetime(1970,1,1,0,0,0) + timedelta(seconds=${netcdf:variable:valid_time:max})).strftime(\"%Y-%m-%dT%H:%M\")",
              "statements": "from datetime import datetime, timedelta",
              "directPositions": "[(datetime(1970,1,1,0,0,0) + timedelta(hours=i)).strftime(\"%Y-%m-%dT%H:%M\") for i in ${netcdf:variable:valid_time}]",
              "gridOrder": 0,
              "irregular": true,
              "areasOfValidity": [ {
                  "start": "(datetime(1970,1,1,0,0,0) + timedelta(seconds=${netcdf:variable:valid_time:min})).strftime(\"%Y-%m\")",
                  "end": "(datetime(1970,1,1,0,0,0) + timedelta(seconds=${netcdf:variable:valid_time:min})).strftime(\"%Y-%m\")"
              } ]
            },

it has

"directPositions": "[(datetime(1970,1,1,0,0,0) + timedelta(hours=i)).strftime(\"%Y-%m-%dT%H:%M\") for i in ${netcdf:variable:valid_time}]",

with the timedelta with incorrect timestep = hours while it should be seconds. The datetime then is too large due to hours = a big number and it throws not useful error message.

In this case, it should print the sentence in which it tried to evaluate.

Change History (1)

comment:1 by Bang Pham Huu, 2 weeks ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.