mamarjan / gff3-pltools

A fast parallel GFF3 parser
MIT License
15 stars 5 forks source link

gff3-filter throws exception when field can't be converted to int or float #74

Closed mamarjan closed 12 years ago

mamarjan commented 12 years ago

For example, when running with "field feature == 5", there is an exception. Need to decide if this should be an error, a warning, and how to handle this, using exceptions or something else.

Another example, which makes it all more complicated, is this: "(attr some_number - 5) == 0". Currently in the code I would have to return some default number for "some_number", or use an exception and catch it somewhere.

mamarjan commented 12 years ago

The solution using exceptions would kill performance. For floats, NaN could be used, but there is no equivalent for integers.

mamarjan commented 12 years ago

Now when a field cannot be converted to a boolean (i.e. it's not "true" or "false"), or an integer, or floating point number, the filter returns false and the record doesn't pass the filter.