Skip to content
Snippets Groups Projects

Resolve "Output time of otbcli applications in minutes, seconds instead of scientific notation"

Merged Emmanuelle Sarrazin requested to merge 763-output-time-format into develop
All threads resolved!

Summary

Use human readable format for output time in otbcli applications. Closes #763 (closed)

Rationale

Issue #763 (closed)

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


***Check before merging:*** - All discussions are resolved - At least 2 :thumbsup: votes from core developers, no :thumbsdown: vote. - The feature branch is (reasonably) up-to-date with the base branch - Dashboard is green - Copyright owner has signed the ORFEO ToolBox Contributor License Agreement

Merge request reports

Merged by Julien MichelJulien Michel 6 years ago (Jul 26, 2018 8:32am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I think that as it is a duration time, it is not strange if the hours are greater than 24 hours.

  • Plus technically not all days are 24h :P

  • Lol ok. You can resolve this comment.

  • I would have like to say: just use strftime or std::put_time, unfortunately it isn't made to display durations. For durations, there is a neat solution with Howard Hinnant date library: https://howardhinnant.github.io/date/date.html#duration_io

    Anyway. As a side note, for ossim OTB plugin I wrote ossimTimeUtilities.h. May be it could be interesting to integrate such a toolbox in OTB. I'm quite sure this is the kind of code that we are likely to need elsewhere.

    BTW, I have a question, why are we using plain integers and not std::chrono::duration?

    Edited by Luc Hermitte
  • @lhermitte

    BTW, I have a question, why are we using plain integers and not std::chrono::duration?

    There are some issues on MSVC with exporting (as in ITK_EXPORT) standard library types. I can't find the original otbStopwatch MR, but it caused a build error back then.

  •   if (minutes > 0 or hours>0)

    I'm not sure I like or instead of ||, and it looks like the alternative representations don't work so well in MSVC.

  • Laurențiu Nicola
  • Luc Hermitte
  • Laurențiu Nicola
  • @lnicola

    BTW, I have a question, why are we using plain integers and not std::chrono::duration?

    There are some issues on MSVC with exporting (as in ITK_EXPORT) standard library types. I can't find the original otbStopwatch MR, but it caused a build error back then.

    OK. Thanks for the reminder.

  • I can't find the original MR

    For reference, this was probably https://msdn.microsoft.com/en-us/library/esew7y1w.aspx?f=255&MSPPError=-2147217396 (C4251).

  • Julien Michel added 1 commit

    added 1 commit

    • e928596a - COMP: Fix or operator not well supported by MSVC (+ a few style edits)

    Compare with previous version

  • Julien Michel resolved all discussions

    resolved all discussions

  • Julien Michel resolved all discussions

    resolved all discussions

  • Julien Michel added 3 commits

    added 3 commits

    • 9065e5f2 - WRG: Attempt to fix MSVC warning (C4244: 'initializing': conversion from…
    • 6bf8aeb7 - ENH: Add the std::ostream & version of the method
    • 2e52be46 - ENH: Use the same method in all watchers

    Compare with previous version

  • I implemented the std::ostream & version (keeping the std::string one) and used it in all watchers.

  • Julien Michel mentioned in commit 49bdd852

    mentioned in commit 49bdd852

  • merged

  • mentioned in issue #1682 (closed)

  • added feature label

  • Cédric Traizet changed milestone to %7.0.0

    changed milestone to %7.0.0

  • Please register or sign in to reply
    Loading