What is the best platform for gekko that will let you have an interactive graph? I am currently using jupyter lab but it doesnt have animation or show it real time
There is an built-in dynamic GUI tool available for simple optimization problems, although it is certainly not fully-featured and is quite buggy at the moment.
You can pull it up using GUI=True in your call to m.solve().
Some other favorites used here in the lab are Plotly and Matplotlib. Both of these can be made to support dynamic plotting.
Related
My team and I are making a Jupyter Notebook for machine learning and data science work. I'm managing software design so I want to make sure I do this correctly and properly.
Our machine learning leverages common data science libraries:
-pandas
-sklearn
-numpy
-matplotlib
The Notebook deliverable is meant to be used by people with little to no coding expertise. We hope to accomplish this with a variety of Jupyter widgets. To keep the code away from the innocent end-user, we want to import a module into the notebook and have the code in the notebook used for creating widgets wrapping the data science.
For example, we would run a machine learning algorithm on a data frame that processes several countries' CO2 emissions to look at climate change. And we want to make a visualization for which countries emit the most. The code for the ML would be in the imported module. The Notebook would import the module and have widget functions to make calls to the module.
I'd like some feedback on this design. I'm considering taking our ML code and creating the module in PyCharm. I haven't tested if matplotlib visualizations work in PyCharm as well as it works in Jupyter. Any advice and precautions to keep in mind are appreciated.
We've already made most of the ML code across a few notebooks. We're looking to migrate over to a class-based module import to the notebook. I'm looking into packaging and importing into Jupyter to make sure this is possible, clean, and modular.
Can anyone point me toward some of the more visually intricate / complicated examples of what can be done with Tkinter? Canvas based widgets and OpenGL please.
Thanks.
There are a couple I think might be interesting;
Py in my eye
tkDocs
There are a couple of things to keep in mind;
Tk is over 25 years old. On X11 it predates things like Freetype. It is still evolving though.
Tk is cross-platform. This implies that it generally cannot use the latest and greatest platform-specific tricks. It has to work with all the platforms it supports.
"Theming" and "skins" are relatively new in GUI toolkits. Some of them (GTK+ comes to mind) had to be re-designed internally to be able to use themes. Tk acquired theming support relatively recently.
Things like transparency are platform dependent, making it difficult for a toolkit to support it on all platforms. E.g. on X11 it requires the rendering extension.
It you want to do really graphics intensive stuff, a GUI toolkit might not be the best tool for the job. A games toolkit like pygame or OpenGL interface might suit your needs better.
There were samples in python-2.7.15 that could represent what you are looking for:
On my Linux install they are located in /usr/doc/python-2.7.15/Demo/tkinter
if you have python3 only, you could maybe look for an older version to download and install, see if the documents get installed.
I'd like to develop an application targeting modern popular Linux distributions that uses GTK for its UI, but also the Vulkan API to render a 3D model. Ideally I'd like to use the gtkmm C++ wrapper for GTK, and the Vulkan C++ API.
What ways do I currently have to do this?
I know that I can get a Vulkan context using SDL2 and other similar low level libraries, and I can get an OpenGL context using GTK. But I haven't found resources for combining these two approaches.
To start, I'm not limited to developing on or targeting any particular Linux distribution. Although any insights into why a particular environment makes this easier or more difficult are appreciated.
Edit:
I'm aware of this question: What is the Vulkan equivalent of the GtkGLArea widget (GTK+)?
However, many months have passed since its most recent update. My Google searching does not indicate that the state of affairs has changed, but I would like to be proven wrong. In addition, I intentionally phrased my question more broadly. I don't necessarily want just a GtkVulkanArea widget. I want to know of any valid way to combine Gtk and Vulkan. For example, is it possible to embed a Gtk event loop and widgets in an SDL2 window? What about the other way around? Again, my Google searching has not been very helpful, and I hope someone knowledgeable on this topic will answer.
I want to impliment some kind of UI for my Python programs (some simple operations, nothing advanced).
So I looked around and considered ncurses and tkinter for python. Yet I am not sure which of these two would suit best my needs for a simple interface (in the sense of easy to learn to program) with the best output possibilies. It does not have to be fancy or anything, just help me visualise my code (lets say a text based chess game).
intuitively i would take tkinter, but could you probably just summarise for me the advantages of the two UIs? (in addition ncurses does not seem to have a good tutorial for python...)
Thank you in advance!
I would like to suggest tkinter as it comes with python and compare to other GUI packages it has good tutorials. And also it will help you to improve your OOP concept for python
If you plan on using your application across platforms, Tkinter or PyQt are both good choices. If you want a GTK+ application that matches your GNOME environment and don't plan on using the application on other platforms, then I would suggest using GTK+ via gobject-introspection (from pygobject). In Fedora, you should have support for it out of the box. Other distributions may require the installation of additional packages.
For more information on the above bindings, see:
TkDocs
The Python GTK+ 3 Tutorial
(Sorry I couldn't post a link for PyQt because I don't have enough reputation to post more than 2 links.)
Additionally, it's worth noting that both PyQt and GTK+ have interface designers available so that you don't have to create your interfaces programmatically if you don't want to. For PyQt I believe Qt Creator comes with an interface designer. For GTK+ you have Glade.
It seems you need a license to use MATLAB. I do not have one so I was wondering if there was some highly-compatible substitute for it in Linux.
GNU Octave has "a language that is mostly compatible with MATLAB". They also have a section in their FAQ about MATLAB compatibility that covers pretty much all the difficulties/differences between the two.
Depending on what exactly you need to do:
gnuplot is good for basic-intermediate graphing
matplotlib (using Python) is also good for graphing
Maxima is a computer algebra system
R
Octave/ KOctive (GUI).
Scilab
Matplotlib
Sage
I'm not sure if these are applicable without knowing what you're trying to achieve.
Sadly, you won't get anything as powerful as Matlab without paying up.
Again depending on what exactly you need to do
R - a free software environment for statistical computing and graphics.
There is Octave, an open source Matlab-like program. Don't know how compatible it is with the 'real' Matlab.
Octave
Scilab
Python + SciPy + MatPlotLib
Besides Octave, check also:
Pari/GP
http://pari.math.u-bordeaux.fr/download.html