Skip to content

Commit

Permalink
use new ipopt version
Browse files Browse the repository at this point in the history
  • Loading branch information
fneum committed Jun 22, 2021
1 parent 71465f7 commit a03d677
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install dependencies
run: |
echo -ne "url: ${CDSAPI_URL}\nkey: ${CDSAPI_TOKEN}\n" > ~/.cdsapirc
echo -e " - glpk\n - ipopt<=3.13.3" >> envs/environment.yaml
echo -e " - glpk\n - ipopt>=3.14" >> envs/environment.yaml
mamba env update -f envs/environment.yaml --name test
- name: Test snakemake workflow
Expand Down
143 changes: 143 additions & 0 deletions Untitled.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:pypsa.io:Imported network elec_s_60_ec_lv1.25_1H.nc has buses, carriers, generators, global_constraints, lines, links, loads, storage_units, stores\n"
]
}
],
"source": [
"n = pypsa.Network(\"networks/elec_s_60_ec_lv1.25_1H.nc\")"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"name\n",
"1 -3.042957e+07\n",
"2 -1.616837e+07\n",
"3 0.000000e+00\n",
"4 -3.087070e+07\n",
"5 -1.341090e+08\n",
" ... \n",
"94 -2.649189e+07\n",
"95 -4.624605e+07\n",
"96 -1.445403e+08\n",
"97 -5.238214e+07\n",
"98 -9.232155e+07\n",
"Length: 98, dtype: float64"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"n.links[dc_links_b].eval(\"capital_cost * (p_nom_opt - p_nom_min)\")\n",
"n.lines.eval(\"capital_cost * (s_nom_opt - s_nom_min)\")"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"dc_links_b = n.links.carrier == 'DC'"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([False])"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(n.links.p_nom_extendable & n.links.carrier == \"DC\").unique()"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"name\n",
"14547 True\n",
"5686 True\n",
"14539 True\n",
"12998 True\n",
"14562 True\n",
" ... \n",
"RO0 0 battery discharger False\n",
"RS0 0 battery discharger False\n",
"SE3 0 battery discharger False\n",
"SI0 0 battery discharger False\n",
"SK0 0 battery discharger False\n",
"Length: 282, dtype: bool"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"n.links.p_nom_extendable & (n.links.carrier == \"DC\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
2 changes: 2 additions & 0 deletions envs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ dependencies:
- pip:
- vresutils==0.3.1
- tsam>=1.1.0
- coincbc
- ipopt'<3.13.3'

0 comments on commit a03d677

Please sign in to comment.