Test default values and datetime types#324
Test default values and datetime types#324Joseph-Edwards merged 18 commits intolibsemigroups:mainfrom
datetime types#324Conversation
|
This PR should hopefully highlight the issues described in #320. |
ece4320 to
4d3c5ce
Compare
68c793a to
cddc994
Compare
|
I was hoping it would be possible to implicitly between |
| system_clock::time_point to_system(TimePoint tp) { | ||
| // Account for the difference between system_clock and | ||
| // high_resolution_clock | ||
| auto sys_now = system_clock::now(); |
There was a problem hiding this comment.
I'm not sure this does what you want, the time at which line 58 is executed isn't the same as the time at which 59 is executed, so what are you measuring here?
There was a problem hiding this comment.
This function was very heavily influenced by the discussion on this Convert between C++ Clocks stack overflow question.
Whilst the times between line 58 and 59 won't be exactly the same, the testing done in that stack overflow thread showed that the error in conversion is on the order of magnitude of hundreds of nanoseconds. Since Python's datetime module works with microsecond precision, this error seemed acceptable.
That stack overflow thread goes on to explain a method that yields time conversions where the error is on the order of magnitude of one nanosecond. I'm happy to implement that if that level of error is desired.
james-d-mitchell
left a comment
There was a problem hiding this comment.
This looks pretty good, although there are a few things I don't understand exactly, if you could address those, then that'd be great!
This PR adds some tests of the default values of
ToddCoxetersettings, and also the type ofdatetimeobject some functions return.