You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For newcomers to Julia, setting up a software stack with compatible Python and Julia is perhaps the trickiest part of using PandaModelsBackend.
29
+
Like Python, one can get Julia through an installer provided by the language developers or through a package manager, like conda.
30
+
Both are shown below and are demonstrated (sort-of, for installers) in [GitHub Actions CI](.github/workflows/ci.yml).
31
+
You'll need to separately install certain dependencies into Python and others into Julia. You never need to enter the Julia REPL.
32
+
If you get tangled up, the CI file is a good, proven route to consult.
33
+
[Docs at pandapower](https://pandapower.readthedocs.io/en/v2.6.0/opf/powermodels.html) may also be helpful.
34
+
There are a lot of acceptable ways to get Python+Julia working, so as long as [`python-jl tests/test_backend_api.py`](tests/test_backend_api.py) is working at the end, you're probably good to run grid2op.
35
+
36
+
##### Notes
24
37
25
-
### Using python virtual environment
38
+
* This software stack won't work on M1 Macs.
39
+
* Conda can be used for Python and Julia for Linux and Intel Macs. There isn't a `julia` package for Silicon Macs, so you'll need to use the Julia installer (+ conda or installer Python).
40
+
* A few problems and solutions have been collected [here](#troubleshooting-the-software-stack).
Access the package manager again in julia by typing ]. Now install the packages: ```add PyCall```. To pass the python environment variable, running build PyCall inside the julia package manager may be necessary.
57
74
58
-
### Using Conda
59
-
[TODO]
75
+
#### Using Conda
76
+
77
+
0. copy a conda env spec file like [unix.yaml](devtools/conda-envs/unix.yaml). Customize python version, environment name, etc.
78
+
79
+
```
80
+
# 1. create a new conda env from the spec.
81
+
conda env create -f unix.yaml && conda activate test
82
+
83
+
# 2. install editable PandaModelsBackend
84
+
git clone https://github.com/gt-sse-center/PandaModelsBackend.git && cd PandaModelsBackend
85
+
pip install -e .
86
+
87
+
# 3. install PowerModels into Julia
88
+
# equivalent to entering pkg mode of Julia REPL, adding packages, and exiting REPL via:
#>20 passed, 1 xpassed, 1226 warnings in 267.01s (0:04:27)
121
+
python-jl tests/test_backend_api.py
122
+
#>Ran 31 tests in 58.499s
123
+
#>OK
124
+
```
125
+
126
+
-----
60
127
61
128
## Build
62
129
```
@@ -70,4 +137,55 @@ pip install -e .
70
137
```
71
138
cd tests
72
139
python test_backend_api.py
140
+
# depending on installation, `python-jl` may be needed instead of `python` above
73
141
```
142
+
143
+
-----
144
+
145
+
## Release Procedure
146
+
147
+
* On a local clone on branch `main`, update the [CHANGELOG](changelog.md) with PRs, the new version number, and the release date. Commit it.
148
+
* Make an annotated tag for the new version. Push it along with any cleanup commits (e.g., changelog above). If you've forked the repo, "origin" will probably be "upstream". See `git remote -v` for names.
149
+
```
150
+
git tag -a v0.5.0 -m "v0.5.0"
151
+
git push --atomic origin main v0.5.0
152
+
```
153
+
* The CI workflow will take over publication to [PyPI](https://pypi.org/project/pandamodelsbackend/) and making a GitHub release. You can edit the frontmatter for the latter through the GitHub web interface with any particular details (and perhaps a link to the CHANGELOG section).
154
+
155
+
## Troubleshooting the Software Stack
156
+
157
+
1.**Problem:**
158
+
Your Python interpreter "/path/to/miniconda/envs/rl2grid/bin/python"
159
+
is statically linked to libpython. Currently, PyJulia does not fully
160
+
support such Python interpreter.
161
+
162
+
**Solution:**
163
+
Use `python-jl` from conda (or Julia installation) instead of `python`.
164
+
165
+
2.**Problem:**
166
+
A pip installation involves compiling, and system compilers aren't working.
167
+
168
+
**Solution:**
169
+
`conda install cxx-compiler -c conda-forge` and rerun pip.
170
+
171
+
3.**Problem:**
172
+
AttributeError in pandapower file d2Sbus_dV2.
173
+
174
+
**Solution:**
175
+
This was fixed between v2.14.9 and master for csr_matrix?. Alternately, edit the `diagV` to below:
0 commit comments