Skip to content

Commit

Permalink
notebook updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fneum committed Apr 15, 2024
1 parent 3144182 commit 6166a3d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
19 changes: 14 additions & 5 deletions data-science-for-esm/07-workshop-networkx.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
"import matplotlib.pyplot as plt\n",
"\n",
"fig, ax = plt.subplots(figsize=(5, 5))\n",
"nx.draw(G, with_labels=True, ax=ax, node_color=\"red\", font_weight=\"bold\")\n",
"nx.draw(G, with_labels=True, ax=ax, node_color=\"green\", font_weight=\"bold\")\n",
"plt.savefig(\"tmp.png\")"
]
},
Expand Down Expand Up @@ -661,7 +661,8 @@
"metadata": {},
"outputs": [],
"source": [
"A = nx.adjacency_matrix(G, weight=None).todense()"
"A = nx.adjacency_matrix(G, weight=None).todense()\n",
"A"
]
},
{
Expand All @@ -677,8 +678,7 @@
"metadata": {},
"outputs": [],
"source": [
"K = nx.incidence_matrix(G, oriented=True).todense()\n",
"K"
"nx.incidence_matrix(G, oriented=True).todense()"
]
},
{
Expand Down Expand Up @@ -845,6 +845,15 @@
"edges.head(5)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"edges"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -874,7 +883,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(G)"
"print(N)"
]
},
{
Expand Down
9 changes: 9 additions & 0 deletions data-science-for-esm/10-workshop-pypsa-cem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,15 @@
"system_cost(n).sum() * 1e6 / demand.sum()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"n.export_to_netcdf(\"network-new.nc\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
2 changes: 1 addition & 1 deletion data-science-for-esm/11-workshop-groupwork.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.0"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 6166a3d

Please sign in to comment.