Coder Social home page Coder Social logo

Pretty traces about dftk.jl HOT 6 CLOSED

juliamolsim avatar juliamolsim commented on June 7, 2024
Pretty traces

from dftk.jl.

Comments (6)

mfherbst avatar mfherbst commented on June 7, 2024

Oh wow that really looks awesome!

from dftk.jl.

GVigne avatar GVigne commented on June 7, 2024

I started to take a look at this, by trying to change the default callback. Although I have a MWE, I can't find a way to write a full code to solve the issue.
The problem is that the default callback (ScfDefaultCallback) prints the information which we give him without much structure. What I mean by that is that when using the default callback, it prints various values according to a set of given parameters info, which is updated at each iteration of the solver.
However, SolverTraces requires to first define the number and name of columns which need to be printed: I have not found a way to hide or skip some columns. So the solution I have is to define a column for all the values which could be printed, and fill only the ones which are intersting. I think a picture is in order:

Ex_SolverTraces

As you can see here, I have not found a generic way to keep none, one or several of the columns Magnet, alpha and Diag, and have to print them all: some have default values (I put Inf there) and can be a bit ugly.
I am still investigating, but I wanted to see if you had any ideas or clues. I might reach out to the creator of SolverTraces to see if he has plans to add a way to hide some columns or values (or do it myself if he agrees).

Edit: I can always define a model for each possibility (one with only Magnet, one with only Diag...), and use the relevant one. This works, but that isn't very clean, as it comes to defining 8 models just to use one...

from dftk.jl.

antoine-levitt avatar antoine-levitt commented on June 7, 2024

Hm, I wonder if this is not more trouble than it's worth, it looks like it's going to be more trouble trying to fit our custom printing into their framework than it's worth...

from dftk.jl.

GVigne avatar GVigne commented on June 7, 2024

That was also what I was considering. I can submit a pull request if you want to take a look at the code. But I feel like the current workflow is not that compatible with the actual version of SolverTraces, as it requires to know exactly what we want to print.
Another problem I encountered is with the step: you have to declare the maximum number of steps when creating a SolverTrace object in order to have those pretty [?/10] markers. However, in our case, it can be hard to know beforehand the exact number of iterations. And because of the way the SolverTrace object is defined (by using immutables structures), you can't change the maximum number of steps after creating an instance of SolverTrace.

from dftk.jl.

antoine-levitt avatar antoine-levitt commented on June 7, 2024

OK let's not bother then. Thanks for looking into this!

from dftk.jl.

GVigne avatar GVigne commented on June 7, 2024

Yes, I think it is best. I have a functional code, but feel like it doesn't bring much -and since SolverTrace doesn't seem very flexible in our case, I think it could raise issues in the future if we want to display other type of information.

from dftk.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.