Closed mw25 closed 1 year ago
Thank you for reporting this! Nice find!
For the rest: one doesn't even need Paint. It fails even when reinterpreting sepal length as Time and using Select Rows.
The problem is in the Edit Domain widget, which constructs the Time Variable from Continuous Variable without specifying the have_date and have_time properties.
It is not obvious how to interpret continuous values as time:
The same problem with File Widget: Open iris.tab in File Widget, change sepal length to datetime and use Select Rows.
I think it is the same problem (have_date and have_time is not specified) at this code location: https://github.com/biolab/orange3/blob/2c29c7a711cebfe33c8d378571546d7f88df7c61/Orange/widgets/utils/domaineditor.py#L364
If my opinion on the interpretation of the values counts:
Intuitively, I would interpret a time variable with numeric values without further information as seconds, because that is the SI unit. Another interpretation could be helpful or annoying. But if it is done, why only years? What about the other possible formats, which are defined in TimeVariable and could theoretically be numeric:
Of course it would be nice if Orange would automatically detect these formats, but manually it is already possible now: For example, if you want to convert a numeric variable with years to time (or other formats like 20200101, 20200102, ...), you could first convert it to text and then to time. This is not very intuitive and user-friendly, but it works. A numeric variable (e.g. 2010, 2011, 2012, ...) that is converted to time and mistakenly interpreted as years or days cannot be easily converted back to seconds, as far as I know.
What's wrong?
When the Select Rows gets a TimeVariable converted from numeric the following error message appears and the spinbox (DateTimeWidget?) in the widget is arranged strangely:
How can we reproduce the problem?
Take a numeric variable and convert it to a TimeVariable. (e.g. Paint a point in Paint Data, convert the x variable in Edit Domain to Time-Type). Put the table at the Select Rows input.
What's your environment?