Giter VIP home page Giter VIP logo

Comments (19)

SanPen avatar SanPen commented on June 2, 2024

Hi!
I see some issues there:

  • I see python 2.7, 32 bits....it must be 3.6 or newer for 64 bits
  • Anaconda is cool for some things but they have done a really poor job supporting Qt, the graphic library...

So if you want to use GridCal as a library, I recomend removing Anaconda and installing python 3.7 from python.com, then install GridCal and all the libraries will be fine.

Otherwise just download the standalone GridCal that I provide. It comes with a ready to roll python distribution.

Read the installation part on the documentation if you need more details.

best regards,
Santiago

from gridcal.

anmold-07 avatar anmold-07 commented on June 2, 2024

Hello, Thanks for your quick response.

I'm unable to download the standalone setup file for windows. When I click the on the link provided it shows the following:

https://sanpv.files.wordpress.com/2019/05/gridcalsetup-1.zip might be temporarily down or it may have moved permanently to a new web address.

from gridcal.

anmold-07 avatar anmold-07 commented on June 2, 2024

Also, how do I deal with this error?
ModuleNotFoundError: No module named 'numba.pycc'

I have already installed the numba package but GridCal just stops here every time..

from gridcal.

SanPen avatar SanPen commented on June 2, 2024

About Numba, I have no clue, looks like a compiler thing...
I am serving the setup with this link since wordpress is having issues with the installer:
https://drive.google.com/file/d/1_ln73z0pKYcxw8TEYroWXTqK6ZYLY6hS/view?usp=drivesdk

please try

from gridcal.

SanPen avatar SanPen commented on June 2, 2024

Did you succeed?

from gridcal.

anmold-07 avatar anmold-07 commented on June 2, 2024

Hello, I got the pip version up and running.
Here's what I actually did: I uninstalled the 32 bit anaconda and installed the 64 bit version. Then, while running GridCal using pip, I was getting the THE NO MOULE FOUND NUMBA.PYCC error. I reinstalled the numba module and a couple of other libraries (upgraded Qt) and then the GUI worked perfectly. I didn't try out the link you posted because it is working just fine with pip as of now. In the future if it stops running for some reason, then I'll use the standalone version you posted. Thanks much for the help.

from gridcal.

SanPen avatar SanPen commented on June 2, 2024

I am glad it worked.
Also, I appreciate all the feedback that you may provide.
Best regards,
Santiago

from gridcal.

anmold-07 avatar anmold-07 commented on June 2, 2024

About Numba, I have no clue, looks like a compiler thing...
I am serving the setup with this link since wordpress is having issues with the installer:
https://drive.google.com/file/d/1_ln73z0pKYcxw8TEYroWXTqK6ZYLY6hS/view?usp=drivesdk

please try

Hello, since I wanted to develop my own scripts using GridCal, I installed the standalone version. I wasn't able to use both spyder and GridCal to develop my own scripts due to an error already discussed in the issues section a few months ago. The GUI is working fine after the standalone download but I'm not sure how and where should I write my scripts. Could you please guide me here?

from gridcal.

SanPen avatar SanPen commented on June 2, 2024

Hi,

The way I develop is with an IDE called PyCharm. With it you can chose the python executable that you want go use, hence you would be able to choose the standalone python from GridCal.
It takes a while to get used ro, but it is the best way to develop pythom IMHO.

from gridcal.

anmold-07 avatar anmold-07 commented on June 2, 2024

Hi,

The way I develop is with an IDE called PyCharm. With it you can chose the python executable that you want go use, hence you would be able to choose the standalone python from GridCal.
It takes a while to get used ro, but it is the best way to develop pythom IMHO.

This is the kind of error I am getting. Although I'm able to run the scripts (GridCal as a calculator is working), I'm not able to see any visualizations or graphs. What can be done now? I have set the python interpreter to standalone python.

Backend Qt5Agg is interactive backend. Turning interactive mode on.

KLU failed
Pardiso failed
UmfPack failed
Falling back to Blas/Lapack
Using Blas/Lapack

Failed to enable GUI event loop integration for 'qt5'
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_code_executor.py", line 211, in do_enable_gui
enable_gui(guiname)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\pydev_ipython\inputhook.py", line 536, in enable_gui
return gui_hook(app)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\pydev_ipython\inputhook.py", line 221, in enable_qt5
from pydev_ipython.inputhookqt5 import create_inputhook_qt5
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\pydev_ipython\inputhookqt5.py", line 25, in
from PyQt5 import QtCore, QtGui
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)

ModuleNotFoundError: No module named 'PyQt5'
Failed to enable GUI event loop integration for 'qt5'
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_code_executor.py", line 211, in do_enable_gui
enable_gui(guiname)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\pydev_ipython\inputhook.py", line 536, in enable_gui
return gui_hook(app)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\pydev_ipython\inputhook.py", line 221, in enable_qt5
from pydev_ipython.inputhookqt5 import create_inputhook_qt5
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\pydev_ipython\inputhookqt5.py", line 25, in
from PyQt5 import QtCore, QtGui
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'PyQt5' `

from gridcal.

SanPen avatar SanPen commented on June 2, 2024

I am using this configuration:

Captura de pantalla de 2020-03-01 19-37-41

So with this it may be fixed.

from gridcal.

anmold-07 avatar anmold-07 commented on June 2, 2024

error
Getting this error now

from gridcal.

SanPen avatar SanPen commented on June 2, 2024

Hi,

I see that you're trying to run scripts from the interactive python console. This is something I never do, since I write scripts and run them in normal operation mode.

However, if you install PyQt5, you will be able to use the ipython console. I do not ship PySide2 and PyQt5 with GridCal's python distro because in the normal operation this is not required, but you may always extend the distro with the packages you need of course.

You can manage the distribution packages directly from pycharm in the settings.
See Project > Project interpreter, and there add packages with the + simbol

Best regards,
Santiago

from gridcal.

anmold-07 avatar anmold-07 commented on June 2, 2024

If I run it using a python file then I get the following error:

C:\GridCal\python\python.exe C:/Users/Anmol/.PyCharmCE2019.3/config/scratches/scratch.py
Traceback (most recent call last):
File "C:/Users/Anmol/.PyCharmCE2019.3/config/scratches/scratch.py", line 1, in
from GridCal.Engine import *
File "C:\GridCal\python\lib\site-packages\GridCal\Engine_init_.py", line 18, in
from GridCal.Engine.Devices import *
File "C:\GridCal\python\lib\site-packages\GridCal\Engine\Devices_init_.py", line 17, in
from GridCal.Engine.Devices.branch import *
File "C:\GridCal\python\lib\site-packages\GridCal\Engine\Devices\branch.py", line 29, in
from GridCal.Engine.Devices.tower import Tower
File "C:\GridCal\python\lib\site-packages\GridCal\Engine\Devices\tower.py", line 19, in
from PySide2 import QtCore
ImportError: DLL load failed: The specified procedure could not be found.

Process finished with exit code 1

I didn't exactly get what were you recommending. Should I uninstall PyQt5?

from gridcal.

SanPen avatar SanPen commented on June 2, 2024

nope, you should install it if you want to have iPython console. I have just done it and it worked for me on Windows10.

But my true recommendation is to drop the interactive console style of scripting and do it old-school by writing the script in a .py and running it.

Anyway, it is just a mater of preferences ;)

from gridcal.

anmold-07 avatar anmold-07 commented on June 2, 2024

It's working well now.

Also, all the plots in the GUI like voltage magnitude, voltage angles, PV curves for continuation power flow; Can they also be plotted using scripting, for example, using pycharm without using the GUI ? If yes, could you please give a small example?

from gridcal.

SanPen avatar SanPen commented on June 2, 2024

Absolutelly,

In order to plot anything in gridcal you perform the simulation with the corresponding driver.
In the case of voltage collapse:

    vc_options = VoltageCollapseOptions()
    # just for this test
    numeric_circuit = main_circuit.compile_snapshot()
    numeric_inputs = numeric_circuit.compute()
    Sbase = np.zeros(len(main_circuit.buses), dtype=complex)
    Vbase = np.zeros(len(main_circuit.buses), dtype=complex)
    for c in numeric_inputs:
        Sbase[c.original_bus_idx] = c.Sbus
        Vbase[c.original_bus_idx] = c.Vbus
    unitary_vector = -1 + 2 * np.random.random(len(main_circuit.buses))
    vc_inputs = VoltageCollapseInput(Sbase=Sbase,
                                     Vbase=Vbase,
                                     Starget=Sbase * (1 + unitary_vector))
    vc = VoltageCollapse(circuit=main_circuit, options=vc_options,
                         inputs=vc_inputs)
    vc.run()
    mdl = vc.results.mdl()
    mdl.plot()

from gridcal.

anmold-07 avatar anmold-07 commented on June 2, 2024

Say I want to plot the voltage magnitudes and angles using a script after running a power flow on a power system. How shall I do that?

from gridcal.

SanPen avatar SanPen commented on June 2, 2024

Hi,

You can try this:

options = PowerFlowOptions(SolverType.NR, verbose=False)
power_flow = PowerFlowDriver(grid, options)
power_flow.run()

vm = np.abs(power_flow.results.voltage)
va = np.angle(power_flow.results.voltage)

And then plot ´vm´ and ´va´.

from gridcal.

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.