Giter Site home page Giter Site logo

Comments (6)

sidihamady avatar sidihamady commented on August 23, 2024 1

@EwaGomez Thanks!
I think this is an important issue, for several reasons: (i) the GUI becomes unusable when a simulation is running, which greatly diminishes the interest of the graphical interface compared to entering the parameters via text files or directly via variables in the code (since the only aim of the current GUI is entering parameters. There is no realtime plots, progress or some other useful functionalities. The output is only seen in the stdout console.). (ii) when a GUI application becomes unresponsive for a long time, the system can stop it. (iii) the user cannot stop cleanly the simulation. The only way to do so is to stop Python from the IDE, which is not recommended (open files, memory, actions in progress...).
Another reason I opened this issue is because you're pushing the GUI aspect as novelty of the software, and in this case you have to make it usable. You could highlight other new contributions such as albedo, for example, and leave aside this GUI aspect to redesign and redevelop it completely with functionalities that facilitate the use of the software. And therefore as a perspective and not as a finalized functionality.

from bifacialsimu.

EwaGomez avatar EwaGomez commented on August 23, 2024

Thank you for your comment! I will read into the threading library!
Would you mind if I resolve this issue after the JOSS review? Right now I would love to concentrate on more research related issues and later in the year on a more user-friendly design.

from bifacialsimu.

EwaGomez avatar EwaGomez commented on August 23, 2024

@sidihamady - You are totally right, the novelty of BifacialSimu was not the GUI, but the albedo and electrical models. I made those changes to the original paper!

I still like the idea of Threading and I have been working on it for the last few days. I was able to integrate Threading and to make the GUI responsive during simulations, but unfortunately is matplotlib not threadsafe and was not able to communicate with the Thread, where the calculations were running. Matplotlib is a crucial part of BifacialSimu, since, besides the results data, you get 9 interactive plots at the end of the simulation. So I had to delete Threading again to keep Matplotlib running.
I am now reading into multiprocessing instead of Threading.
By any chance, do you have any experience in Tkinter, Multiprocessing and Matplotlib?

Do you still think that this is an issue for the JOSS publication?

from bifacialsimu.

sidihamady avatar sidihamady commented on August 23, 2024

Dear @EwaGomez

To implement the threading you need to understand some important points.
First the GUI (so Tk and matplotlib) runs in the main thread. Tk and matplotlib are not thread safe. And they don't need to be thread safe. The organization is as follows:
1/ the main thread with UI
2/ a working thead, with only calculations and without any direct call to the GUI.
The communication between the threads can be done using various methods, e.g. events, mutex, ... (with a timer for example).
The simplest way is to perform all calculations is a working thread and setup a termination function that can create/update plots. If you try to plot directly from the working thread, the program will not work.
If by design you have mixed UI stuff with the simulation routines, it will take some time to redesign the application. One golden rule is to never mix UI and calculations. Different routines, different classes. It can take some time in the beginning but it is really crucial.
You can look at the application I developed to simulate solar cell I-V characteristic: https://github.com/sidihamady/Photovoltaic-Model.

For JOSS, as I mentioned, if you consider GUI as something new in the publication, then it should follow usability rules, and be always responsive and offers features not offered by a command-line program.
If the novelty is only in albedo and electrical models, then this should be highlghted clearly in the paper, and therefore remove the part relating to the novelty which would be linked to the GUI.

from bifacialsimu.

EwaGomez avatar EwaGomez commented on August 23, 2024

Dear @sidihamady,
Thank you for your input!
I just released a new version of BifacialSimu including threading. The GUI is now responsive during the simulation. But I also implemented your second suggestion and shifted the main USP of the paper from the GUI to the different simulations models, especially the albedo models. In the future, after the JOSS publication, I will implement a timer and a function to update the plots.

from bifacialsimu.

sidihamady avatar sidihamady commented on August 23, 2024

Dear @EwaGomez,
The issue is now addressed. Thanks.
Indeed, in a future version it is important to enrich the GUI with updated plots, progress information, etc.

from bifacialsimu.

Related Issues (16)

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.