Developer Documentation
Either you are developing a new feature or using the function from develop mode you should set the option pdm_dev_mode=True
, e.g. :
pp.runpm_vstab(net, pp_to_pm_callback=None, calculate_voltage_angles=True,
trafo_model="t", delta=1e-8, trafo3w_losses="hv", check_connectivity=True,
pm_model="ACPPowerModel", pm_solver="ipopt", correct_pm_network_data=True, silence=True,
pm_time_limits=None, pm_log_level=0, pm_file_path = None, delete_buffer_file=True,
opf_flow_lim="S", pm_tol=1e-8, pdm_dev_mode=True)
this option automatically check the setting and activate the develop mode environment.
Develop Mode
To install and develop PandaModels you can use either Git Bash
or Python
:
Git Bash:
To install and develop, PandaModels from Git Bash
:
Open Julia REPL
in Git Bash
:
$ julia
In Julia REPL
, add the package:
import Pkg
# add package
Pkg.add("PandaModels")
# develop-mode
Pkg.develop("PandaModels")
Pkg.build("PandaModels")
Pkg.resolve()
Check if your package is in develop mode:
import PandaModels
pathof(PandaModels)
Python:
To install and develop, PandaModels directly from python
:
before running the following codes please set the Julia/python
interface by following the steps in here.
Call Julia
in python
:
# call julia
import julia
from julia import Main
from julia import Pkg
# add package
Pkg.add("PandaModels")
# develop-mode
Pkg.develop("PandaModels")
Pkg.build("PandaModels")
Pkg.resolve()
Check if your package is in develop mode:
from julia import Base
Base.find_package("PandaModels")
PyJulia crashes on Julia new released version 1.6.0, please install the older versions.
Dependencies
In develop-mode you need to add the following dependencies:
optimization environment:
infrastructure-based packages:
logger:
i/o:
solvers:
Open Julia REPL
in Git Bash
:
$ julia
In Julia REPL
, add dependencies:
import Pkg
Pkg.Registry.update()
Pkg.add([
Pkg.PackageSpec(;name="JuMP"),
Pkg.PackageSpec(;name="InfrastructureModels"),
Pkg.PackageSpec(;name="PowerModels"),
Pkg.PackageSpec(;name="PowerModelsDistribution"),
Pkg.PackageSpec(;name="Memento"),
Pkg.PackageSpec(;name="JSON"),
Pkg.PackageSpec(;name="Ipopt"),
Pkg.PackageSpec(;name="Juniper"),
Pkg.PackageSpec(;name="Cbc")
])
Pkg.build()
Pkg.resolve()
Gurobi Installation:
To use Gurobi, download and install from Gurobi Download Center, then get the license, activate it and add its path to the local PATH environment variables by following the steps from Gurobi License Center.
for linux
users: open .bashrc
file with , e.g., nano .bashrc
in your home folder and add:
export GUROBI_HOME="/opt/gurobi_VERSION/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
export GRB_LICENSE_FILE="/PATH_TO_YOUR_LICENSE_DIR/gurobi.lic"
Finally, add the package to Julia
by following installation instructions from Gurobi.jl.