Skip to content

Commit

Permalink
EODC
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Mar 20, 2024
1 parent 0071008 commit c1535d9
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 449 deletions.
218 changes: 4 additions & 214 deletions dev/generate datapackages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "9d57850c-04fa-4ef7-89e8-3e9de62f92e3",
"metadata": {},
"outputs": [
Expand All @@ -222,216 +222,7 @@
"execution_count": null,
"id": "a081c764-a942-4627-9197-fcd373e98b62",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Calculating LCA results for image...\n",
"--- Calculating LCA results for SSP2-RCP19...\n",
"------ Calculating LCA results for 2005...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"0% [# ] 100% | ETA: 00:00:01/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n",
"3\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"0% [### ] 100% | ETA: 00:02:10/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"0% [#### ] 100% | ETA: 00:02:07/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"0% [###### ] 100% | ETA: 00:02:12/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"0% [######## ] 100% | ETA: 00:02:05/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"0% [######### ] 100% | ETA: 00:01:57/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n",
"3\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"0% [########### ] 100% | ETA: 00:01:55/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/romain/anaconda3/envs/pathways/lib/python3.11/site-packages/scikits/umfpack/umfpack.py:736: UmfpackWarning: (almost) singular matrix! (estimated cond. number: 1.21e+13)\n",
" warnings.warn(msg, UmfpackWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n"
]
}
],
"outputs": [],
"source": [
"import numpy as np\n",
"dp = p.calculate(\n",
Expand All @@ -446,12 +237,11 @@
" v for v in p.scenarios.coords[\"variables\"].values\n",
" if any(i in v for i in [\"Industry\", \"Transport\", \"Heating\"])\n",
" ],\n",
" #years=[2005, 2020, 2050, 2070, 2100],\n",
" years=[2005, 2010, 2020],\n",
" characterization=True,\n",
" #flows=[\"Lithium - natural resource - in ground - kilogram\",],\n",
" #data_type=np.float32,\n",
" multiprocessing=False,\n",
" demand_cutoff=0.1,\n",
" demand_cutoff=0.01,\n",
")"
]
},
Expand Down
7 changes: 4 additions & 3 deletions dev/timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@
p.calculate(
methods=[
"RELICS - metals extraction - Lithium",
"RELICS - metals extraction - Molybdenum",
#"RELICS - metals extraction - Molybdenum",
],
regions=[
"WEU",
"WEU", "USA",
],
scenarios=[scenario],
years=[
2020,
2010, 2020, 2030,
],
variables=[
v
for v in p.scenarios.coords["variables"].values
if any(i in v for i in ["Industry", "Transport", "Heating"])
],
demand_cutoff=0.01,
multiprocessing=True
)
arr = p.display_results()
arr.to_netcdf(f"results_image_{scenario}.nc")
Loading

0 comments on commit c1535d9

Please sign in to comment.