Welcome, Guest
Username: Password: Remember me

TOPIC: Error parsing new Keyword

Error parsing new Keyword 8 years 8 months ago #20102

  • jamesmac
  • jamesmac's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
Hi,
I recently added a new Keyword to Telemac 3D v6.3 to allow specification of the local time zone as
Hours relative to UTC in the CAS file. I set the TYPE as INTEGER to allow Hours to be positive or negative.
This worked fine with values in the 0-12 range but failed when any negative value was used. The error message was :
"I am looking for an INTEGER but found an inappropriate value set for keyword.."

I traced this to the readCAS(keywords,dico,frgb) Method in parserKeywords.py. There are two problems there :
  1. logic does not distinguish between the INTEGER and ENTIER (whole numbers) cases ie it treats them as the same
  1. the validation regex applied to both is the one designed for the ENTIER case ('\d+\Z'), hence the failure with negative values.
I modified the code to handle integers separately with a modified regex and all appears OK now.

I am using Telemac v6.3 under Win7-64bit with Python 2.7.5
I thought you might like to know in case this has not been fixed in later versions.
Regards,
J.M.
The administrator has disabled public write access.

Error parsing new Keyword 8 years 8 months ago #20103

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Thank you for pointing this out. This would mean that since Python is used no negative integer was ever read in all the modules... actually it could be... I cannot think of an example with a negative integer.

Regards,

Jean-Michel Hervouet
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.