grew-nlp / grewpy

grewpy: Python library for Grew
4 stars 2 forks source link

unexpected behavior when parsing a grs file using GRSDraft #5

Closed s-herrera closed 8 months ago

s-herrera commented 8 months ago

When parsing a grs file, without contraints with "<" or ">" operators disappear. Is this a expected behavior?

Here is an example: test.py.txt

The test compares a request built using Request and the request obtained after parsing a GRS. If the request has a < operator, because it disappears, an error is raised. But if, for example, we change the operator for <<, because the grs file is parsed well, no error is raised.

bguil commented 8 months ago

Thanks for reporting. This is a bug in grewlib. A fix should be available soon.

bguil commented 8 months ago

The bug is fixed in the latest version of grewlib (1.15.3).

Note that in the code example you sent, you use an equality test on Request object. Even if they are "equal", two different Python objects will be considered as different. For instance:

from grewpy import Request
x = Request('X->Y')
y = Request('X->Y')
x==y

will return false