GithubHelp home page GithubHelp logo

Comments (3)

greg-neustroev avatar greg-neustroev commented on July 28, 2024

Since I was the one bothered by this, I assigned it to myself.

There is a default Date formatter, but its output is rather long:

julia> 123456789123456 |> Dates.Nanosecond |> Dates.CompoundPeriod |> Dates.canonicalize
1 day, 10 hours, 17 minutes, 36 seconds, 789 milliseconds, 123 microseconds, 456 nanoseconds

I'd rather have something like:

1d 10h 17m 36s 789ms 123μs 456ns

I looked at the existing packages that output time in this format (TimerOutputs.jl and BenchmarkTools.jl), and they both implement their own formatters. We can do the same, it's not hard to write a formatter like this. The question is, should this be a part of Tulipa or a separate thing (e.g., a micropackage with just a few pretty formatting tools). It's not really a part of TulipaEnergyModel per se, and I can see other libraries like TulipaPlots using the formatting tools later.

Or maybe I missed something and there exists a nice time formatting library we can use?

@abelsiqueira @suvayu thoughts?

from tulipaenergymodel.jl.

suvayu avatar suvayu commented on July 28, 2024

Most Tulipa* libraries will depend on TEM. So I wouldn't bother creating a separate package, because then to use it easily you would need to register it as well.

from tulipaenergymodel.jl.

abelsiqueira avatar abelsiqueira commented on July 28, 2024

I'm in favour of not implementing anything new for this. Instead, maybe we change how we use the timing packages to benefit from their printing.
If that doesn't work, we can check with, for instance, TimerOutputs, to see if it makes sense to export their pretty printing function.

from tulipaenergymodel.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.