chairemobilite / transition_qgis

MIT License
1 stars 3 forks source link

fix: Do not send negative values for first waiting time #36

Closed tahini closed 3 weeks ago

tahini commented 3 weeks ago

fixes #35

The returned value is 10000 minutes, which is almost 7 days, enough to represent illimited wait in terms of transit.

Also fix typo in widget names Fisrst => First

greenscientist commented 3 weeks ago

We need to define what illimited is in the API and use that.

greenscientist commented 3 weeks ago

also it's a random number constant in the code, need to be defined as a "constant variable" if we keep this.

tahini commented 3 weeks ago

I have the impression that the python api expects an integer. If instead of 10000 I put None, I get this error: unsupported operand type(s) for *: 'NoneType' and 'int'

tahini commented 3 weeks ago

Actually, I think it's a legit value, in TrRouting, a negative value will ignore the parameter, but it's not documented anywhere as such... and python will transform this -1 to -60 (minutes to seconds), it feels weird, but it's legit, so I'll just have to deal with this in Transition (new calculation functions and parameter validation)

greenscientist commented 3 weeks ago

For the unsupported operand, it was because of the multiplication (max_travel_time_minutes * 60).

the library should probably have a bit more validation on its input.