From 6c39abf8f9ab53fe658950a5a1ce18fb4956bafd Mon Sep 17 00:00:00 2001 From: romainsacchi Date: Sat, 14 Oct 2023 13:56:34 +0200 Subject: [PATCH] Update Readme --- README.md | 27 +- dev/test_custom_scenarios.ipynb | 542 +++++++++++++++++++++++++++----- 2 files changed, 491 insertions(+), 78 deletions(-) diff --git a/README.md b/README.md index d5aff17d..72c84f42 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,15 @@ As it now evolves towards a more IAM-neutral approach, a change of name was cons Scientific publication available here: [Sacchi et al, 2022](https://doi.org/10.1016/j.rser.2022.112311). +What's new in 1.8.0? +==================== + +- Added support for brightway 2.5 +- Added support for Python 3.11 +- Uses bw2io 0.8.10 +- Adds electricity storage in electricity markets -- see [docs](https://premise.readthedocs.io/en/latest/transform.html#storage) +- Adds [scenario explorer dashboard](https://premisedash-6f5a0259c487.herokuapp.com/) + What's new in 1.5.0? ==================== @@ -67,11 +76,8 @@ Two options: A development version with the latest advancements (but with the risks of unseen bugs), is available from Anaconda Cloud: - - conda config --append conda-forge - conda config --append cmutel - conda config --append romainsacchi - conda install premise + + conda install -c romainsacchi premise For a more stable and proven version, from Pypi: @@ -88,10 +94,9 @@ The best way is to follow [the examples from the Jupyter Notebook](https://githu # Support -Do not hesitate to contact the development team at [romain.sacchi@psi.ch](mailto:romain.sacchi@psi.ch) -or [aloisdir@pik-potsdam.de](mailto:aloisdir@pik-potsdam.de). +Do not hesitate to contact [romain.sacchi@psi.ch](mailto:romain.sacchi@psi.ch). -## Maintainers +## Contributors * [Romain Sacchi](https://github.com/romainsacchi) * [Alois Dirnaichner](https://github.com/Loisel) @@ -99,6 +104,12 @@ or [aloisdir@pik-potsdam.de](mailto:aloisdir@pik-potsdam.de). * [Laurent Vandepaer](https://github.com/lvandepaer) * [Chris Mutel](https://github.com/cmutel/) + +## Maintainers + +* [Romain Sacchi](https://github.com/romainsacchi) +* [Chris Mutel](https://github.com/cmutel/) + ## Contributing See [contributing](https://github.com/polca/premise/blob/master/CONTRIBUTING.md). diff --git a/dev/test_custom_scenarios.ipynb b/dev/test_custom_scenarios.ipynb index fb1559a1..565469cf 100644 --- a/dev/test_custom_scenarios.ipynb +++ b/dev/test_custom_scenarios.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 8, "id": "80ac6f31-2713-42ee-8929-5525347b2a4b", "metadata": {}, "outputs": [], @@ -13,7 +13,97 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 9, + "id": "bc2035a4-8766-43c6-b45a-67b879f01647", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(0, 8, 10)" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from bw2io import __version__\n", + "__version__" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "111cb014-cd51-4c10-b494-b6bce3bd020b", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Applying strategy: normalize_units\n", + "Applying strategy: drop_unspecified_subcategories\n", + "Applying strategy: ensure_categories_are_tuples\n", + "Applied 3 strategies in 0.00 seconds\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Writing activities to SQLite3 database:\n", + "0% [##############################] 100% | ETA: 00:00:00\n", + "Total time elapsed: 00:00:00\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Title: Writing activities to SQLite3 database:\n", + " Started: 10/14/2023 13:41:19\n", + " Finished: 10/14/2023 13:41:19\n", + " Total time elapsed: 00:00:00\n", + " CPU %: 91.60\n", + " Memory %: 0.36\n", + "Created database: biosphere3\n" + ] + } + ], + "source": [ + "import bw2io\n", + "bw2io.create_default_biosphere3(overwrite=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "f6c53688-57f8-4819-9b66-28bbf3f1d1f9", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Cache folder cleared!\n" + ] + } + ], + "source": [ + "clear_cache()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, "id": "68f5574a-4334-4d99-b18e-076ae3b4de79", "metadata": {}, "outputs": [], @@ -24,15 +114,15 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 15, "id": "5424fda3-657a-470e-bc2f-b5237078be7e", "metadata": {}, "outputs": [], "source": [ "urls = [\n", - " \"/Users/romain/Library/CloudStorage/Dropbox/EP2050/energy-perspective-2050-switzerland/datapackage.json\",\n", - " \"/Users/romain/GitHub/cobalt-perspective-2050/datapackage.json\",\n", - " \"/Users/romain/Library/CloudStorage/Dropbox/ammonia-scenarios/ammonia-prospective-scenarios/datapackage.json\",\n", + " #\"/Users/romain/Library/CloudStorage/Dropbox/EP2050/energy-perspective-2050-switzerland/datapackage.json\",\n", + " #\"/Users/romain/GitHub/cobalt-perspective-2050/datapackage.json\",\n", + " #\"/Users/romain/Library/CloudStorage/Dropbox/ammonia-scenarios/ammonia-prospective-scenarios/datapackage.json\",\n", " #\"https://raw.githubusercontent.com/premise-community-scenarios/scenario-example-bread/main/datapackage.json\"\n", " #\"/Users/romain/GitHub/scenario-example-bread-/datapackage.json\"\n", "]" @@ -40,7 +130,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "943e4ba8-edc7-48ac-8c91-0aeda924b2c2", "metadata": {}, "outputs": [ @@ -48,7 +138,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "premise v.(1, 7, 8)\n", + "premise v.(1, 8, 0, 'dev1')\n", "+------------------------------------------------------------------+\n", "| Warning |\n", "+------------------------------------------------------------------+\n", @@ -87,17 +177,62 @@ "NewDatabase(..., quiet=True)\n", "\n", "//////////////////// EXTRACTING SOURCE DATABASE ////////////////////\n", + "Cannot find cached database. Will create one now for next time...\n", + "Getting activity data\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 21238/21238 [00:00<00:00, 254000.19it/s]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Adding exchange data to activities\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 674593/674593 [01:26<00:00, 7810.88it/s]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Filling out exchange data\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 21238/21238 [00:02<00:00, 7158.96it/s]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Set missing location of datasets to global scope.\n", + "Set missing location of production exchanges to scope of dataset.\n", + "Correct missing location of technosphere exchanges.\n", + "Correct missing flow categories for biosphere exchanges\n", + "Remove empty exchanges.\n", + "Remove uncertainty data.\n", "Done!\n", "\n", "////////////////// IMPORTING DEFAULT INVENTORIES ///////////////////\n", - "Done!\n", + "Cannot find cached inventories. Will create them now for next time...\n", + "Importing default inventories...\n", "\n", - "/////////////////////// EXTRACTING IAM DATA ////////////////////////\n", - "Done!\n", - "`update_all()` will skip the following steps:\n", - "update_two_wheelers(), update_cars(), and update_buses()\n", - "If you want to update these steps, please run them separately afterwards.\n", - "Extracted 1 worksheets in 5.37 seconds\n", + "Extracted 1 worksheets in 0.13 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -105,9 +240,212 @@ "Applying strategy: migrate_exchanges\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", - "Done!\n", - "Done!\n", - "Extracted 1 worksheets in 4.52 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Remove uncertainty data.\n", + "Extracted 7 worksheets in 0.04 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.03 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.03 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.43 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "The following datasets to import already exist in the source database. They will not be imported\n", + "+----------------------------------------------------+--------------------------------+----------+-------------+\n", + "| Name | Reference product | Location | File |\n", + "+----------------------------------------------------+--------------------------------+----------+-------------+\n", + "| fluorspar production, 97% purity | fluorspar, 97% purity | GLO | lci-PV.xlsx |\n", + "| metallization paste production, back side | metallization paste, back side | RER | lci-PV.xlsx |\n", + "| metallization paste production, back side, alumini | metallization paste, back side | RER | lci-PV.xlsx |\n", + "| metallization paste production, front side | metallization paste, front sid | RER | lci-PV.xlsx |\n", + "| photovoltaic module production, building-integrate | photovoltaic module, building- | RER | lci-PV.xlsx |\n", + "| photovoltaic module production, building-integrate | photovoltaic module, building- | RER | lci-PV.xlsx |\n", + "| photovoltaic mounting system production, for facad | photovoltaic mounting system, | RER | lci-PV.xlsx |\n", + "| photovoltaic mounting system production, for flat- | photovoltaic mounting system, | RER | lci-PV.xlsx |\n", + "| photovoltaic mounting system production, for slant | photovoltaic mounting system, | RER | lci-PV.xlsx |\n", + "| photovoltaic panel factory construction | photovoltaic panel factory | GLO | lci-PV.xlsx |\n", + "| polyvinylfluoride production | polyvinylfluoride | US | lci-PV.xlsx |\n", + "| polyvinylfluoride production, dispersion | polyvinylfluoride, dispersion | US | lci-PV.xlsx |\n", + "| polyvinylfluoride, film production | polyvinylfluoride, film | US | lci-PV.xlsx |\n", + "| silicon production, metallurgical grade | silicon, metallurgical grade | NO | lci-PV.xlsx |\n", + "| vinyl fluoride production | vinyl fluoride | US | lci-PV.xlsx |\n", + "| wafer factory construction | wafer factory | DE | lci-PV.xlsx |\n", + "+----------------------------------------------------+--------------------------------+----------+-------------+\n", + "Extracted 1 worksheets in 0.05 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "The following datasets to import already exist in the source database. They will not be imported\n", + "+----------------------------------------------------+--------------------------------+----------+---------------------------------------------------+\n", + "| Name | Reference product | Location | File |\n", + "+----------------------------------------------------+--------------------------------+----------+---------------------------------------------------+\n", + "| carbon dioxide, captured at cement production plan | carbon dioxide, captured and r | RER | lci-synfuels-from-methanol-from-cement-plant.xlsx |\n", + "+----------------------------------------------------+--------------------------------+----------+---------------------------------------------------+\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "The following datasets to import already exist in the source database. They will not be imported\n", + "+----------------------------------------------------+----------------------+----------+-------------------------------------------+\n", + "| Name | Reference product | Location | File |\n", + "+----------------------------------------------------+----------------------+----------+-------------------------------------------+\n", + "| methanol distillation, hydrogen from coal gasifica | methanol, purified | RER | lci-synfuels-from-methanol-from-coal.xlsx |\n", + "| methanol synthesis, hydrogen from coal gasificatio | methanol, unpurified | RER | lci-synfuels-from-methanol-from-coal.xlsx |\n", + "+----------------------------------------------------+----------------------+----------+-------------------------------------------+\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.00 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 5 worksheets in 0.17 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -115,12 +453,116 @@ "Applying strategy: migrate_exchanges\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.03 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.09 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Remove uncertainty data.\n", + "Extracted 2 worksheets in 0.01 seconds\n", + "Migrating to 3.8 first\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Applying strategy: migrate_datasets\n", + "Applying strategy: migrate_exchanges\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.02 seconds\n", + "Remove uncertainty data.\n", + "Data cached. It is advised to restart your workflow at this point.\n", + "This allows premise to use the cached data instead, which results in\n", + "a faster workflow.\n", "Done!\n", + "\n", + "/////////////////////// EXTRACTING IAM DATA ////////////////////////\n", "Done!\n", + "\n", + "/////////////////////////// ELECTRICITY ////////////////////////////\n", "Done!\n", "\n", - "Write new database(s) to Brightway2.\n", - "One or multiple duplicates detected. Removing them...\n" + "Building superstructure database...\n", + "Dropped 0 duplicate(s).\n", + "Scenario difference file exported to /Users/romain/GitHub/premise/dev/export/scenario diff files!\n" ] }, { @@ -128,55 +570,11 @@ "output_type": "stream", "text": [ "Writing activities to SQLite3 database:\n", - "0% [##############################] 100% | ETA: 00:00:00\n", - "Total time elapsed: 00:00:31\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Title: Writing activities to SQLite3 database:\n", - " Started: 10/12/2023 13:02:12\n", - " Finished: 10/12/2023 13:02:43\n", - " Total time elapsed: 00:00:31\n", - " CPU %: 95.50\n", - " Memory %: 24.26\n", - "Created database: ecoinvent_cutoff_3.9_image_SSP2-Base_2050\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Writing activities to SQLite3 database:\n", - "0% [##############################] 100% | ETA: 00:00:00\n", - "Total time elapsed: 00:00:28\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Title: Writing activities to SQLite3 database:\n", - " Started: 10/12/2023 13:06:44\n", - " Finished: 10/12/2023 13:07:13\n", - " Total time elapsed: 00:00:28\n", - " CPU %: 94.40\n", - " Memory %: 19.19\n", - "Created database: ecoinvent_cutoff_3.9_remind_SSP2-PkBudg500_2050\n", - "Generate scenario report.\n", - "Report saved under /Users/romain/GitHub/premise/dev/export/scenario_report.\n", - "Generate change report.\n", - "Report saved under /Users/romain/GitHub/premise/dev.\n" + "0% [## ] 100% | ETA: 00:00:32" ] } ], "source": [ - "from premise import *\n", - "from datapackage import Package\n", - "bw.projects.set_current(\"ei39\")\n", - "\n", "#for url in urls:\n", "scenarios = [\n", " #{\"model\": \"image\", \"pathway\":\"SSP2-Base\", \"year\": 2020},\n", @@ -185,14 +583,18 @@ " #{\"model\": \"image\", \"pathway\":\"SSP2-Base\", \"year\": 2035},\n", " #{\"model\": \"image\", \"pathway\":\"SSP2-Base\", \"year\": 2040},\n", " #{\"model\": \"image\", \"pathway\":\"SSP2-Base\", \"year\": 2045},\n", - " {\"model\": \"image\", \"pathway\":\"SSP2-Base\", \"year\": 2050},\n", + " #{\"model\": \"image\", \"pathway\":\"SSP2-Base\", \"year\": 2050},\n", " #{\"model\": \"image\", \"pathway\":\"SSP2-RCP26\", \"year\": 2020},\n", " ##{\"model\": \"image\", \"pathway\":\"SSP2-RCP26\", \"year\": 2025},\n", - " #{\"model\": \"image\", \"pathway\":\"SSP2-RCP26\", \"year\": 2030},\n", + " {\"model\": \"remind\", \"pathway\":\"SSP2-Base\", \"year\": 2020},\n", + " {\"model\": \"remind\", \"pathway\":\"SSP2-Base\", \"year\": 2030},\n", + " {\"model\": \"remind\", \"pathway\":\"SSP2-Base\", \"year\": 2050},\n", + " {\"model\": \"remind\", \"pathway\":\"SSP2-PkBudg500\", \"year\": 2030},\n", + " {\"model\": \"remind\", \"pathway\":\"SSP2-PkBudg500\", \"year\": 2050},\n", " #{\"model\": \"image\", \"pathway\":\"SSP2-RCP26\", \"year\": 2035},\n", " #{\"model\": \"image\", \"pathway\":\"SSP2-RCP26\", \"year\": 2040},\n", " #{\"model\": \"image\", \"pathway\":\"SSP2-RCP26\", \"year\": 2045},\n", - " {\"model\": \"remind\", \"pathway\":\"SSP2-PkBudg500\", \"year\": 2050},\n", + " \n", "]\n", "\n", "ndb = NewDatabase(\n", @@ -202,10 +604,10 @@ " key='tUePmX_S5B8ieZkkM7WUU2CnO8SmShwmAeWK9x2rTFo=',\n", " #external_scenarios=[Package(url)]\n", ")\n", - "ndb.update_all()\n", + "ndb.update_electricity()\n", "#ndb.update_external_scenario()\n", "#ndb.write_datapackage(name=ndb.datapackages[0].descriptor[\"name\"])\n", - "ndb.write_db_to_brightway()\n" + "ndb.write_superstructure_db_to_brightway(\"ei39 - image - SSP2\")\n" ] }, {