From 10cc8faf0898c471f1bce7a34be63e2648bf27c2 Mon Sep 17 00:00:00 2001 From: danielmk Date: Tue, 31 Aug 2021 19:55:25 +0200 Subject: [PATCH 01/11] Added keyresult calculations for RRS --- model/scenario.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/model/scenario.py b/model/scenario.py index 81f13d1d4..3e17dca1b 100644 --- a/model/scenario.py +++ b/model/scenario.py @@ -35,6 +35,8 @@ def set_ref_adoption(self): def set_pds_adoption(self): pass + + class RRSScenario(Scenario): @@ -109,6 +111,35 @@ def set_tam(self, config_values=None, **args): tam_pds_data_sources=self.tam_pds_data_sources, **args) + def implementation_unit_adoption_increase(self, year=2050): + return (self.pds_ca.adoption_data_per_region().loc[year] / self.ac.soln_avg_annual_use - + self.ref_ca.adoption_data_per_region().loc[year] / self.ac.soln_avg_annual_use) + + def functional_unit_adoption_increase(self, year=2050): + # Incrase in functional units adopted compared to REF scenario + # In 2050 + return (self.pds_ca.adoption_data_per_region().loc[year] - + self.ref_ca.adoption_data_per_region().loc[year]) + + def marginal_first_cost(self, year=2050): + return (self.fc.soln_pds_annual_world_first_cost().loc[:year].sum() - + self.fc.soln_ref_annual_world_first_cost().loc[:year].sum() - + self.fc.conv_ref_annual_world_first_cost().loc[:year].sum()) / 10**9 + + def net_operating_savings(self, year=2050): + return ( + (self.oc.conv_ref_cumulative_operating_cost().loc[ year ] - + self.oc.conv_ref_cumulative_operating_cost().loc[ year ]) - + (self.oc.soln_pds_cumulative_operating_cost().loc[ year ] - + self.oc.soln_pds_cumulative_operating_cost().loc[ year ]) + ) / 10**9 + + def lifetime_operating_savings(self, year=2050): + return self.oc.soln_marginal_operating_cost_savings().sum() / 10**9 + + def cumulative_emissions_reduced(self, year=2050): + return self.c2.co2eq_mmt_reduced().loc[2020:2050, 'World'].sum() / 1000 + class LandScenario(Scenario): From dc3d6b7f512e97ac653d7b6942262a4ea279b8e4 Mon Sep 17 00:00:00 2001 From: danielmk Date: Wed, 1 Sep 2021 17:15:38 +0200 Subject: [PATCH 02/11] key result corrections and notebook added. --- Key_Results.ipynb | 285 ++++++++++++++++++++++++++++++++++++++++++++++ model/scenario.py | 51 +++++---- 2 files changed, 315 insertions(+), 21 deletions(-) create mode 100644 Key_Results.ipynb diff --git a/Key_Results.ipynb b/Key_Results.ipynb new file mode 100644 index 000000000..66abbcc1c --- /dev/null +++ b/Key_Results.ipynb @@ -0,0 +1,285 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d96fa055", + "metadata": {}, + "source": [ + "# Scenarios and key results" + ] + }, + { + "cell_type": "markdown", + "id": "1d12f695", + "metadata": {}, + "source": [ + "Each Reduction and Replacement Solution (RRS) produces five key results:\n", + "1. Implementation Unit Adoption Increase in 2050 (PDS vs REF)\n", + "2. Functional Unit Adoption Increase in 2050 (PDS vs REF)\n", + "3. Marginal First Cost 2015-2050\n", + "4. Net Operating Savings 2020-2050\n", + "5. Lifetime Operating Savings 2020-2050\n", + "6. Total Emissions Reduction\n", + "\n", + "The first two are adoption results, the following three are financial and the last one is an emission result. Before we can get the key results, we need to produce a specific scenario of a solution." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "70785e50", + "metadata": {}, + "outputs": [], + "source": [ + "from solution import factory\n", + "import pandas as pd\n", + "pds1 = factory.load_scenario(\"bikeinfrastructure\", \"PDS1\")" + ] + }, + { + "cell_type": "markdown", + "id": "46e11086", + "metadata": {}, + "source": [ + "Now that we have our scenario, we can generate the key results." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "d2252191", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'implementation_unit_adoption_increase': 242777.14688276115,\n", + " 'functional_unit_adoption_increase': 1254.2601831584388,\n", + " 'marginal_first_cost': 2358.757905490336,\n", + " 'net_operating_savings': 415.40118026217056,\n", + " 'lifetime_operating_savings': 741.9571034347329,\n", + " 'cumulative_emissions_reduced': 2.3034768858097836}" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pds1.key_results()" + ] + }, + { + "cell_type": "markdown", + "id": "8a4095cd", + "metadata": {}, + "source": [ + "`key_results()` returns a dictionary. Of all six key results. We can also access each result individually." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "523f5cdd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[242777.14688276115,\n", + " 1254.2601831584388,\n", + " 2358.757905490336,\n", + " 415.40118026217056,\n", + " 741.9571034347329,\n", + " 2.3034768858097836]" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "[pds1.implementation_unit_adoption_increase(),\n", + "pds1.functional_unit_adoption_increase(),\n", + "pds1.marginal_first_cost(),\n", + "pds1.net_operating_savings(),\n", + "pds1.lifetime_operating_savings(),\n", + "pds1.cumulative_emissions_reduced()]" + ] + }, + { + "cell_type": "markdown", + "id": "a8819680", + "metadata": {}, + "source": [ + "While `lifetime_operating_savings` is calculated for the entire scenario lifetime, other key results are calculated for a specific final year or for an interval. Intervals always start in 2020 but we can specify the final year. In the original excel sheets the default year is 2050 and so it is in the Python port." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "1776652d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'implementation_unit_adoption_increase': 242777.14688276115,\n", + " 'functional_unit_adoption_increase': 1254.2601831584388,\n", + " 'marginal_first_cost': 2358.757905490336,\n", + " 'net_operating_savings': 415.40118026217056,\n", + " 'lifetime_operating_savings': 741.9571034347329,\n", + " 'cumulative_emissions_reduced': 2.3034768858097836}" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pds1.key_results(year=2050)" + ] + }, + { + "cell_type": "markdown", + "id": "778f3e02", + "metadata": {}, + "source": [ + "Compare to:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "2943b823", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'implementation_unit_adoption_increase': 221737.86679763015,\n", + " 'functional_unit_adoption_increase': 1145.564897659259,\n", + " 'marginal_first_cost': 2154.345880454912,\n", + " 'net_operating_savings': 234.309027914764,\n", + " 'lifetime_operating_savings': 741.9571034347329,\n", + " 'cumulative_emissions_reduced': 1.309142675006755}" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pds1.key_results(year=2040)" + ] + }, + { + "cell_type": "markdown", + "id": "c84b9a2b", + "metadata": {}, + "source": [ + "This also works for the individual solutions, except for `lifetime_operating_savings`." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "9e2aef26", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[242777.14688276115,\n", + " 1254.2601831584388,\n", + " 2358.757905490336,\n", + " 415.40118026217056,\n", + " 741.9571034347329,\n", + " 2.3034768858097836]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "year=2050\n", + "[pds1.implementation_unit_adoption_increase(year),\n", + "pds1.functional_unit_adoption_increase(year),\n", + "pds1.marginal_first_cost(year),\n", + "pds1.net_operating_savings(year),\n", + "pds1.lifetime_operating_savings(),\n", + "pds1.cumulative_emissions_reduced(year)]" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "568e9b5b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[221737.86679763015,\n", + " 1145.564897659259,\n", + " 2154.345880454912,\n", + " 234.309027914764,\n", + " 741.9571034347329,\n", + " 1.309142675006755]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "year=2040\n", + "[pds1.implementation_unit_adoption_increase(year),\n", + "pds1.functional_unit_adoption_increase(year),\n", + "pds1.marginal_first_cost(year),\n", + "pds1.net_operating_savings(year),\n", + "pds1.lifetime_operating_savings(),\n", + "pds1.cumulative_emissions_reduced(year)]" + ] + }, + { + "cell_type": "markdown", + "id": "5a861142", + "metadata": {}, + "source": [ + "Finally, by default all key results are calculated for the `'World'` region." + ] + } + ], + "metadata": { + "interpreter": { + "hash": "641170e26b916086f6ab8a8498639d254e86adadac2c3bbb49fa49caa88ce61e" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.9.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/model/scenario.py b/model/scenario.py index 3e17dca1b..3b7debcbf 100644 --- a/model/scenario.py +++ b/model/scenario.py @@ -111,34 +111,43 @@ def set_tam(self, config_values=None, **args): tam_pds_data_sources=self.tam_pds_data_sources, **args) - def implementation_unit_adoption_increase(self, year=2050): - return (self.pds_ca.adoption_data_per_region().loc[year] / self.ac.soln_avg_annual_use - - self.ref_ca.adoption_data_per_region().loc[year] / self.ac.soln_avg_annual_use) - - def functional_unit_adoption_increase(self, year=2050): - # Incrase in functional units adopted compared to REF scenario - # In 2050 - return (self.pds_ca.adoption_data_per_region().loc[year] - - self.ref_ca.adoption_data_per_region().loc[year]) + def key_results(self, year=2050, region='World'): + return {'implementation_unit_adoption_increase': self.implementation_unit_adoption_increase(year=year), + 'functional_unit_adoption_increase': self.functional_unit_adoption_increase(year=year), + 'marginal_first_cost': self.marginal_first_cost(year=year), + 'net_operating_savings': self.net_operating_savings(year=year), + 'lifetime_operating_savings': self.lifetime_operating_savings(), + 'cumulative_emissions_reduced': self.cumulative_emissions_reduced(year=year, region=region)} + + def implementation_unit_adoption_increase(self, year=2050, region='World'): + return (self.pds_ca.adoption_data_per_region().loc[year][region] / self.ac.soln_avg_annual_use - + self.ref_ca.adoption_data_per_region().loc[year][region] / self.ac.soln_avg_annual_use) + + def functional_unit_adoption_increase(self, year=2050, region='World'): + return ( + self.pds_ca.adoption_data_per_region().loc[year] - + self.ref_ca.adoption_data_per_region().loc[year] + )[region] def marginal_first_cost(self, year=2050): - return (self.fc.soln_pds_annual_world_first_cost().loc[:year].sum() - - self.fc.soln_ref_annual_world_first_cost().loc[:year].sum() - - self.fc.conv_ref_annual_world_first_cost().loc[:year].sum()) / 10**9 + return -(self.fc.soln_pds_annual_world_first_cost().loc[:year].sum()- + self.fc.soln_ref_annual_world_first_cost().loc[:year].sum()- + self.fc.conv_ref_annual_world_first_cost().loc[:year].sum() + ) / 1e9 def net_operating_savings(self, year=2050): return ( - (self.oc.conv_ref_cumulative_operating_cost().loc[ year ] - - self.oc.conv_ref_cumulative_operating_cost().loc[ year ]) - - (self.oc.soln_pds_cumulative_operating_cost().loc[ year ] - - self.oc.soln_pds_cumulative_operating_cost().loc[ year ]) - ) / 10**9 + (self.oc.conv_ref_cumulative_operating_cost().loc[year] - + self.oc.conv_ref_cumulative_operating_cost().loc[2020]) - + (self.oc.soln_pds_cumulative_operating_cost().loc[year] - + self.oc.soln_pds_cumulative_operating_cost().loc[2020]) + ) / 1e9 - def lifetime_operating_savings(self, year=2050): - return self.oc.soln_marginal_operating_cost_savings().sum() / 10**9 + def lifetime_operating_savings(self): + return self.oc.soln_marginal_operating_cost_savings().sum() / 1e9 - def cumulative_emissions_reduced(self, year=2050): - return self.c2.co2eq_mmt_reduced().loc[2020:2050, 'World'].sum() / 1000 + def cumulative_emissions_reduced(self, year=2050, region='World'): + return self.c2.co2eq_mmt_reduced().loc[2020:year, region].sum() / 1e3 From 56f55e53859c5505e98c12219b5e571dd4d7f682 Mon Sep 17 00:00:00 2001 From: danielmk Date: Sat, 4 Sep 2021 15:15:16 +0200 Subject: [PATCH 03/11] Check pds_ca and ref_ca existence --- model/scenario.py | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/model/scenario.py b/model/scenario.py index 3b7debcbf..ac71f16c1 100644 --- a/model/scenario.py +++ b/model/scenario.py @@ -120,17 +120,49 @@ def key_results(self, year=2050, region='World'): 'cumulative_emissions_reduced': self.cumulative_emissions_reduced(year=year, region=region)} def implementation_unit_adoption_increase(self, year=2050, region='World'): - return (self.pds_ca.adoption_data_per_region().loc[year][region] / self.ac.soln_avg_annual_use - - self.ref_ca.adoption_data_per_region().loc[year][region] / self.ac.soln_avg_annual_use) + if hasattr(self, 'pds_ca'): + if self.pds_ca.soln_adoption_custom_name: + pds_adoption = self.pds_ca.adoption_data_per_region() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + + if hasattr(self, 'ref_ca'): + if self.ref_ca.soln_adoption_custom_name: + ref_adoption = self.ref_ca.adoption_data_per_region() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + + return (pds_adoption.loc[year][region] / self.ac.soln_avg_annual_use - + ref_adoption.loc[year][region] / self.ac.soln_avg_annual_use) def functional_unit_adoption_increase(self, year=2050, region='World'): + if hasattr(self, 'pds_ca'): + if self.pds_ca.soln_adoption_custom_name: + pds_adoption = self.pds_ca.adoption_data_per_region() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + + if hasattr(self, 'ref_ca'): + if self.ref_ca.soln_adoption_custom_name: + ref_adoption = self.ref_ca.adoption_data_per_region() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + return ( - self.pds_ca.adoption_data_per_region().loc[year] - - self.ref_ca.adoption_data_per_region().loc[year] + pds_adoption.loc[year] - + ref_adoption.loc[year] )[region] def marginal_first_cost(self, year=2050): - return -(self.fc.soln_pds_annual_world_first_cost().loc[:year].sum()- + return (self.fc.soln_pds_annual_world_first_cost().loc[:year].sum()- self.fc.soln_ref_annual_world_first_cost().loc[:year].sum()- self.fc.conv_ref_annual_world_first_cost().loc[:year].sum() ) / 1e9 From fa0c117c5cdc06db18549a3f9358e4f79203077d Mon Sep 17 00:00:00 2001 From: danielmk Date: Sat, 4 Sep 2021 15:17:35 +0200 Subject: [PATCH 04/11] Add testing for key_results --- tools/expected_result_tester.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tools/expected_result_tester.py b/tools/expected_result_tester.py index 178ce82f6..9f8bf6828 100644 --- a/tools/expected_result_tester.py +++ b/tools/expected_result_tester.py @@ -14,6 +14,7 @@ import importlib from tools.util import df_excel_range, cell_to_offsets + # verbosity level 0: no "print" # verbosity level 1: print solutions and scenarios # verbosiyt level 2: print solutions, scenarios, and test sections @@ -1021,7 +1022,30 @@ def check_excel_against_object(obj, zip_f, scenario, i, verify, test_skip=None, if skip_count > 0: if _verbosity >= 2: print(f" **** Skipped {skip_count} tests") +def key_results_tester(solution_name, expected_filename, is_land=False, + scenario_skip=None): + importname = 'solution.' + solution_name + m = importlib.import_module(importname) + with zipfile.ZipFile(expected_filename) as zf: + for (i, scenario_name) in enumerate(m.scenarios.keys()): + if scenario_skip and i in scenario_skip: + if _verbosity >= 1: print(f"**** Skipped scenario {i} '{scenario_name}'") + continue + if _verbosity >= 1: print(f"Checking scenario {i}: {scenario_name}") + obj = m.Scenario(scenario=scenario_name) + ac_file = zf.open(scenario_name + "/" + 'Advanced Controls') + df = pd.read_csv(ac_file, header=None, na_values=['#REF!', '#DIV/0!', '#VALUE!', '(N/A)']) + key_results = obj.key_results() + + decimal_precision = 7 + aae = np.testing.assert_almost_equal + aae(key_results['implementation_unit_adoption_increase'], float(df.loc[3, 0]), decimal=7) + aae(key_results['functional_unit_adoption_increase'], float(df.loc[3, 1]), decimal=7) + aae(key_results['marginal_first_cost'], float(df.loc[3, 2]), decimal=7) + aae(key_results['net_operating_savings'], float(df.loc[3, 3]), decimal=7) + aae(key_results['lifetime_operating_savings'], float(df.loc[3, 4]), decimal=7) + aae(key_results['cumulative_emissions_reduced'], float(df.loc[3, 5]), decimal=7) def one_solution_tester(solution_name, expected_filename, is_land=False, scenario_skip=None, test_skip=None, test_only=None): @@ -1043,6 +1067,14 @@ def one_solution_tester(solution_name, expected_filename, is_land=False, continue if _verbosity >= 1: print(f"Checking scenario {i}: {scenario_name}") + key_results_tester( + solution_name, + expected_filename, + is_land=is_land, + scenario_skip=scenario_skip) + + # Ignore all other testing while troubleshooting key results + """ obj = m.Scenario(scenario=scenario_name) if is_land: to_verify = LAND_solution_verify_list(obj, zf) @@ -1052,3 +1084,4 @@ def one_solution_tester(solution_name, expected_filename, is_land=False, check_excel_against_object(obj, zf, scenario_name, i, to_verify, test_skip=test_skip, test_only=test_only) + """ \ No newline at end of file From baae5119325d1927963777d5cd9e4ead1b804e5f Mon Sep 17 00:00:00 2001 From: danielmk Date: Mon, 6 Sep 2021 19:32:50 +0200 Subject: [PATCH 05/11] Support for LAND and refactoring --- model/scenario.py | 113 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 2 deletions(-) diff --git a/model/scenario.py b/model/scenario.py index ac71f16c1..3e245324f 100644 --- a/model/scenario.py +++ b/model/scenario.py @@ -35,6 +35,114 @@ def set_ref_adoption(self): def set_pds_adoption(self): pass + def key_results(self, year=2050, region='World'): + if self.solution_category == self.solution_category.REDUCTION or self.solution_category == self.solution_category.REPLACEMENT: + return {'implementation_unit_adoption_increase': self.implementation_unit_adoption_increase(year=year), + 'functional_unit_adoption_increase': self.functional_unit_adoption_increase(year=year), + 'marginal_first_cost': self.marginal_first_cost(year=year), + 'net_operating_savings': self.net_operating_savings(year=year), + 'lifetime_operating_savings': self.lifetime_operating_savings(), + 'cumulative_emissions_reduced': self.cumulative_emissions_reduced(year=year, region=region)} + elif self.solution_category == self.solution_category.LAND: + return {'adoption_unit_increase': self.adoption_unit_increase_LAND(year=year), + 'marginal_first_cost': self.marginal_first_cost(year=year), + 'net_operating_savings': self.net_operating_savings(year=year), + 'lifetime_operating_savings': self.lifetime_operating_savings(), + 'cumulative_emissions_reduced': self.cumulative_emissions_reduced(year=year, region=region), + 'total_additional_co2eq_sequestered': self.total_additional_co2eq_sequestered(year)} + else: + raise NotImplementedError("key_results only implemented for REDUCTION, REPLACEMENT and LAND") + + def implementation_unit_adoption_increase(self, year=2050, region='World'): + if hasattr(self, 'pds_ca'): + if self.pds_ca.soln_adoption_custom_name: + pds_adoption = self.pds_ca.adoption_data_per_region() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + + if hasattr(self, 'ref_ca'): + if self.ref_ca.soln_adoption_custom_name: + ref_adoption = self.ref_ca.adoption_data_per_region() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + + return (pds_adoption.loc[year][region] / self.ac.soln_avg_annual_use - + ref_adoption.loc[year][region] / self.ac.soln_avg_annual_use) + + def adoption_unit_increase_LAND(self, year=2050, region='World'): + # TODO implement + if hasattr(self, 'pds_ca'): + if self.pds_ca.soln_adoption_custom_name: + pds_adoption = self.pds_ca.adoption_data_per_region() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + + if hasattr(self, 'ref_ca'): + if self.ref_ca.soln_adoption_custom_name: + ref_adoption = self.ref_ca.adoption_data_per_region() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + + return (pds_adoption.loc[year][region] - + ref_adoption.loc[year][region]) + pass + + def total_additional_co2eq_sequestered(self, year=2050): + # farmlandrestoration starts in year 2021 in Advanced Control excel + # Not sure if this is a bug or intended. Excel also says it should start at 2020 + return (self.c2.co2_sequestered_global().loc[2021:year,'All'] / 1000).sum() + + def functional_unit_adoption_increase(self, year=2050, region='World'): + if hasattr(self, 'pds_ca'): + if self.pds_ca.soln_adoption_custom_name: + pds_adoption = self.pds_ca.adoption_data_per_region() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + else: + pds_adoption = self.ht.soln_pds_funits_adopted() + + if hasattr(self, 'ref_ca'): + if self.ref_ca.soln_adoption_custom_name: + ref_adoption = self.ref_ca.adoption_data_per_region() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + else: + ref_adoption = self.ht.soln_ref_funits_adopted() + + return ( + pds_adoption.loc[year] - + ref_adoption.loc[year] + )[region] + + def marginal_first_cost(self, year=2050): + return (self.fc.soln_pds_annual_world_first_cost().loc[:year].sum()- + self.fc.soln_ref_annual_world_first_cost().loc[:year].sum()- + self.fc.conv_ref_annual_world_first_cost().loc[:year].sum() + ) / 1e9 + + def net_operating_savings(self, year=2050): + return ( + (self.oc.conv_ref_cumulative_operating_cost().loc[year] - + self.oc.conv_ref_cumulative_operating_cost().loc[2020]) - + (self.oc.soln_pds_cumulative_operating_cost().loc[year] - + self.oc.soln_pds_cumulative_operating_cost().loc[2020]) + ) / 1e9 + + def lifetime_operating_savings(self): + return self.oc.soln_marginal_operating_cost_savings().sum() / 1e9 + + def cumulative_emissions_reduced(self, year=2050, region='World'): + return self.c2.co2eq_mmt_reduced().loc[2020:year, region].sum() / 1e3 + + @@ -110,7 +218,7 @@ def set_tam(self, config_values=None, **args): tam_ref_data_sources=self.tam_ref_data_sources, tam_pds_data_sources=self.tam_pds_data_sources, **args) - + """ def key_results(self, year=2050, region='World'): return {'implementation_unit_adoption_increase': self.implementation_unit_adoption_increase(year=year), 'functional_unit_adoption_increase': self.functional_unit_adoption_increase(year=year), @@ -180,8 +288,9 @@ def lifetime_operating_savings(self): def cumulative_emissions_reduced(self, year=2050, region='World'): return self.c2.co2eq_mmt_reduced().loc[2020:year, region].sum() / 1e3 - + """ class LandScenario(Scenario): + pass From 9998d831c8d4a45d48dbf11dbc5d5684949cdf91 Mon Sep 17 00:00:00 2001 From: danielmk Date: Mon, 6 Sep 2021 19:33:23 +0200 Subject: [PATCH 06/11] Added keyresults testing for LAND --- tools/expected_result_tester.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/expected_result_tester.py b/tools/expected_result_tester.py index 9f8bf6828..7d0709f6d 100644 --- a/tools/expected_result_tester.py +++ b/tools/expected_result_tester.py @@ -1040,12 +1040,20 @@ def key_results_tester(solution_name, expected_filename, is_land=False, decimal_precision = 7 aae = np.testing.assert_almost_equal - aae(key_results['implementation_unit_adoption_increase'], float(df.loc[3, 0]), decimal=7) - aae(key_results['functional_unit_adoption_increase'], float(df.loc[3, 1]), decimal=7) - aae(key_results['marginal_first_cost'], float(df.loc[3, 2]), decimal=7) - aae(key_results['net_operating_savings'], float(df.loc[3, 3]), decimal=7) - aae(key_results['lifetime_operating_savings'], float(df.loc[3, 4]), decimal=7) - aae(key_results['cumulative_emissions_reduced'], float(df.loc[3, 5]), decimal=7) + if is_land: + aae(key_results['adoption_unit_increase'], float(df.loc[3, 0]), decimal=7) + aae(key_results['marginal_first_cost'], float(df.loc[3, 1]), decimal=7) + aae(key_results['net_operating_savings'], float(df.loc[3, 2]), decimal=7) + aae(key_results['lifetime_operating_savings'], float(df.loc[3, 3]), decimal=7) + aae(key_results['cumulative_emissions_reduced'], float(df.loc[3, 4]), decimal=7) + aae(key_results['total_additional_co2eq_sequestered'], float(df.loc[3, 5]), decimal=7) + else: + aae(key_results['implementation_unit_adoption_increase'], float(df.loc[3, 0]), decimal=7) + aae(key_results['functional_unit_adoption_increase'], float(df.loc[3, 1]), decimal=7) + aae(key_results['marginal_first_cost'], float(df.loc[3, 2]), decimal=7) + aae(key_results['net_operating_savings'], float(df.loc[3, 3]), decimal=7) + aae(key_results['lifetime_operating_savings'], float(df.loc[3, 4]), decimal=7) + aae(key_results['cumulative_emissions_reduced'], float(df.loc[3, 5]), decimal=7) def one_solution_tester(solution_name, expected_filename, is_land=False, scenario_skip=None, test_skip=None, test_only=None): From 84b84d0de63ed575cdafe5dd8386b2a1db751c4f Mon Sep 17 00:00:00 2001 From: danielmk Date: Tue, 7 Sep 2021 12:24:01 +0200 Subject: [PATCH 07/11] Minor fixes --- Key_Results.ipynb | 215 +++++++++++++++++++++++++++++--- model/scenario.py | 1 - tools/expected_result_tester.py | 32 +++-- 3 files changed, 213 insertions(+), 35 deletions(-) diff --git a/Key_Results.ipynb b/Key_Results.ipynb index 66abbcc1c..1756e49a1 100644 --- a/Key_Results.ipynb +++ b/Key_Results.ipynb @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "1d12f695", + "id": "bd0fd28b", "metadata": {}, "source": [ "Each Reduction and Replacement Solution (RRS) produces five key results:\n", @@ -26,7 +26,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 10, "id": "70785e50", "metadata": {}, "outputs": [], @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "46e11086", + "id": "bd21f4a0", "metadata": {}, "source": [ "Now that we have our scenario, we can generate the key results." @@ -46,8 +46,8 @@ }, { "cell_type": "code", - "execution_count": 2, - "id": "d2252191", + "execution_count": 11, + "id": "aa3bb6da", "metadata": {}, "outputs": [ { @@ -55,13 +55,13 @@ "text/plain": [ "{'implementation_unit_adoption_increase': 242777.14688276115,\n", " 'functional_unit_adoption_increase': 1254.2601831584388,\n", - " 'marginal_first_cost': 2358.757905490336,\n", + " 'marginal_first_cost': -2358.757905490336,\n", " 'net_operating_savings': 415.40118026217056,\n", " 'lifetime_operating_savings': 741.9571034347329,\n", " 'cumulative_emissions_reduced': 2.3034768858097836}" ] }, - "execution_count": 2, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "8a4095cd", + "id": "2ab0cff3", "metadata": {}, "source": [ "`key_results()` returns a dictionary. Of all six key results. We can also access each result individually." @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "a8819680", + "id": "03ae538d", "metadata": {}, "source": [ "While `lifetime_operating_savings` is calculated for the entire scenario lifetime, other key results are calculated for a specific final year or for an interval. Intervals always start in 2020 but we can specify the final year. In the original excel sheets the default year is 2050 and so it is in the Python port." @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": 4, - "id": "1776652d", + "id": "8b07f6f7", "metadata": {}, "outputs": [ { @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "778f3e02", + "id": "7b9bf497", "metadata": {}, "source": [ "Compare to:" @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "2943b823", + "id": "8523ad41", "metadata": {}, "outputs": [ { @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "c84b9a2b", + "id": "4bba04f7", "metadata": {}, "source": [ "This also works for the individual solutions, except for `lifetime_operating_savings`." @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": 6, - "id": "9e2aef26", + "id": "9caeb538", "metadata": {}, "outputs": [ { @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": 7, - "id": "568e9b5b", + "id": "8f1e563b", "metadata": {}, "outputs": [ { @@ -251,11 +251,194 @@ }, { "cell_type": "markdown", - "id": "5a861142", + "id": "afb7e127", "metadata": {}, "source": [ "Finally, by default all key results are calculated for the `'World'` region." ] + }, + { + "cell_type": "markdown", + "id": "a9b7f3d3", + "metadata": {}, + "source": [ + "### Testing key results" + ] + }, + { + "cell_type": "markdown", + "id": "b60b1d59", + "metadata": {}, + "source": [ + "Tests for key results are part of the normal test suite." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "df07c145", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "============================= test session starts =============================" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "error: unknown option `show-current'\n", + "usage: git branch [] [-r | -a] [--merged | --no-merged]\n", + " or: git branch [] [-l] [-f] []\n", + " or: git branch [] [-r] (-d | -D) ...\n", + " or: git branch [] (-m | -M) [] \n", + " or: git branch [] (-c | -C) [] \n", + " or: git branch [] [-r | -a] [--points-at]\n", + " or: git branch [] [-r | -a] [--format]\n", + "\n", + "Generic options\n", + " -v, --verbose show hash and subject, give twice for upstream branch\n", + " -q, --quiet suppress informational messages\n", + " -t, --track set up tracking mode (see git-pull(1))\n", + " -u, --set-upstream-to \n", + " change the upstream info\n", + " --unset-upstream Unset the upstream info\n", + " --color[=] use colored output\n", + " -r, --remotes act on remote-tracking branches\n", + " --contains print only branches that contain the commit\n", + " --no-contains \n", + " print only branches that don't contain the commit\n", + " --abbrev[=] use digits to display SHA-1s\n", + "\n", + "Specific git-branch actions:\n", + " -a, --all list both remote-tracking and local branches\n", + " -d, --delete delete fully merged branch\n", + " -D delete branch (even if not merged)\n", + " -m, --move move/rename a branch and its reflog\n", + " -M move/rename a branch, even if target exists\n", + " -c, --copy copy a branch and its reflog\n", + " -C copy a branch, even if target exists\n", + " --list list branch names\n", + " -l, --create-reflog create the branch's reflog\n", + " --edit-description edit the description for the branch\n", + " -f, --force force creation, move/rename, deletion\n", + " --merged print only branches that are merged\n", + " --no-merged print only branches that are not merged\n", + " --column[=\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
CO2 (Gt-C)CH4 (Mt-CH4)N2O (Mt-N2O)
Year
20150.0000000.00.0
20160.0000000.00.0
20170.0000000.00.0
20180.0000000.00.0
20190.0000000.00.0
20200.0136420.00.0
20210.0204630.00.0
20220.0272850.00.0
20230.0341060.00.0
20240.0409270.00.0
20250.0477480.00.0
20260.0545690.00.0
20270.0613900.00.0
20280.0682120.00.0
20290.0750330.00.0
20300.0818540.00.0
20310.0886750.00.0
20320.0954960.00.0
20330.1023170.00.0
20340.1091390.00.0
20350.1159600.00.0
20360.1227810.00.0
20370.1296020.00.0
20380.1364230.00.0
20390.1432440.00.0
20400.1500660.00.0
20410.1568870.00.0
20420.1637080.00.0
20430.1705290.00.0
20440.1773500.00.0
20450.1841710.00.0
20460.1909930.00.0
20470.1978140.00.0
20480.2046350.00.0
20490.2114560.00.0
20500.2182770.00.0
20510.0000000.00.0
20520.0000000.00.0
20530.0000000.00.0
20540.0000000.00.0
20550.0000000.00.0
20560.0000000.00.0
20570.0000000.00.0
20580.0000000.00.0
20590.0000000.00.0
20600.0000000.00.0
\n", + "" + ], + "text/plain": [ + " CO2 (Gt-C) CH4 (Mt-CH4) N2O (Mt-N2O)\n", + "Year \n", + "2015 0.000000 0.0 0.0\n", + "2016 0.000000 0.0 0.0\n", + "2017 0.000000 0.0 0.0\n", + "2018 0.000000 0.0 0.0\n", + "2019 0.000000 0.0 0.0\n", + "2020 0.013642 0.0 0.0\n", + "2021 0.020463 0.0 0.0\n", + "2022 0.027285 0.0 0.0\n", + "2023 0.034106 0.0 0.0\n", + "2024 0.040927 0.0 0.0\n", + "2025 0.047748 0.0 0.0\n", + "2026 0.054569 0.0 0.0\n", + "2027 0.061390 0.0 0.0\n", + "2028 0.068212 0.0 0.0\n", + "2029 0.075033 0.0 0.0\n", + "2030 0.081854 0.0 0.0\n", + "2031 0.088675 0.0 0.0\n", + "2032 0.095496 0.0 0.0\n", + "2033 0.102317 0.0 0.0\n", + "2034 0.109139 0.0 0.0\n", + "2035 0.115960 0.0 0.0\n", + "2036 0.122781 0.0 0.0\n", + "2037 0.129602 0.0 0.0\n", + "2038 0.136423 0.0 0.0\n", + "2039 0.143244 0.0 0.0\n", + "2040 0.150066 0.0 0.0\n", + "2041 0.156887 0.0 0.0\n", + "2042 0.163708 0.0 0.0\n", + "2043 0.170529 0.0 0.0\n", + "2044 0.177350 0.0 0.0\n", + "2045 0.184171 0.0 0.0\n", + "2046 0.190993 0.0 0.0\n", + "2047 0.197814 0.0 0.0\n", + "2048 0.204635 0.0 0.0\n", + "2049 0.211456 0.0 0.0\n", + "2050 0.218277 0.0 0.0\n", + "2051 0.000000 0.0 0.0\n", + "2052 0.000000 0.0 0.0\n", + "2053 0.000000 0.0 0.0\n", + "2054 0.000000 0.0 0.0\n", + "2055 0.000000 0.0 0.0\n", + "2056 0.000000 0.0 0.0\n", + "2057 0.000000 0.0 0.0\n", + "2058 0.000000 0.0 0.0\n", + "2059 0.000000 0.0 0.0\n", + "2060 0.000000 0.0 0.0" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pds1.c2.ghg_emissions_reductions_global_annual()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "f534243a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "-1390148.5984713845" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "year=2050\n", + "region='World'\n", + "pds_adoption = pds1.pds_ca.adoption_data_per_region()\n", + "ref_adoption = pds1.ref_ca.adoption_data_per_region()\n", + "(pds_adoption.loc[year][region] / pds1.ac.soln_avg_annual_use - \n", + " ref_adoption.loc[year][region] / pds1.ac.conv_avg_annual_use)" + ] + }, + { + "cell_type": "markdown", + "id": "2ab0cff3", + "metadata": {}, + "source": [ + "`key_results()` returns a dictionary. Of all six key results. We can also access each result individually." + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "523f5cdd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
WorldOECD90Eastern EuropeAsia (Sans Japan)Middle East and AfricaLatin AmericaChinaIndiaEUUSA
Year
2014841.924923NaNNaNNaNNaNNaNNaNNaNNaNNaN
2015894.015378NaNNaNNaNNaNNaNNaNNaNNaNNaN
2016932.030756NaNNaNNaNNaNNaNNaNNaNNaNNaN
2017970.046134NaNNaNNaNNaNNaNNaNNaNNaNNaN
20181008.061512233.9883993.173527859.45133948.522968157.556351311.348795185.191833138.07360113.301056
20191867.670287NaNNaNNaNNaNNaNNaNNaNNaNNaN
20202047.097470NaNNaNNaNNaNNaNNaNNaNNaNNaN
20212222.808422NaNNaNNaNNaNNaNNaNNaNNaNNaN
20222394.872622NaNNaNNaNNaNNaNNaNNaNNaNNaN
20232563.359547NaNNaNNaNNaNNaNNaNNaNNaNNaN
20242728.338675NaNNaNNaNNaNNaNNaNNaNNaNNaN
20252889.879483NaNNaNNaNNaNNaNNaNNaNNaNNaN
20263168.536333NaNNaNNaNNaNNaNNaNNaNNaNNaN
20273288.284260NaNNaNNaNNaNNaNNaNNaNNaNNaN
20283409.631245NaNNaNNaNNaNNaNNaNNaNNaNNaN
20293532.362731NaNNaNNaNNaNNaNNaNNaNNaNNaN
20303665.117966NaNNaNNaNNaNNaNNaNNaNNaNNaN
20313781.120970NaNNaNNaNNaNNaNNaNNaNNaNNaN
20323906.718608NaNNaNNaNNaNNaNNaNNaNNaNNaN
20334032.842514NaNNaNNaNNaNNaNNaNNaNNaNNaN
20344159.278130NaNNaNNaNNaNNaNNaNNaNNaNNaN
20354272.015687NaNNaNNaNNaNNaNNaNNaNNaNNaN
20364412.226259NaNNaNNaNNaNNaNNaNNaNNaNNaN
20374538.309656NaNNaNNaNNaNNaNNaNNaNNaNNaN
20384663.846531NaNNaNNaNNaNNaNNaNNaNNaNNaN
20394788.622326NaNNaNNaNNaNNaNNaNNaNNaNNaN
20404931.968322NaNNaNNaNNaNNaNNaNNaNNaNNaN
20415035.032443NaNNaNNaNNaNNaNNaNNaNNaNNaN
20425156.237648NaNNaNNaNNaNNaNNaNNaNNaNNaN
20435275.823541NaNNaNNaNNaNNaNNaNNaNNaNNaN
20445393.575564NaNNaNNaNNaNNaNNaNNaNNaNNaN
20455497.388386NaNNaNNaNNaNNaNNaNNaNNaNNaN
20465622.719766NaNNaNNaNNaNNaNNaNNaNNaNNaN
20475733.682829NaNNaNNaNNaNNaNNaNNaNNaNNaN
20485841.953789NaNNaNNaNNaNNaNNaNNaNNaNNaN
20495947.318089NaNNaNNaNNaNNaNNaNNaNNaNNaN
20506052.095000NaNNaNNaNNaNNaNNaNNaNNaNNaN
20516148.468473NaNNaNNaNNaNNaNNaNNaNNaNNaN
20526243.825443NaNNaNNaNNaNNaNNaNNaNNaNNaN
20536335.417519NaNNaNNaNNaNNaNNaNNaNNaNNaN
20546423.030144NaNNaNNaNNaNNaNNaNNaNNaNNaN
20556506.448760NaNNaNNaNNaNNaNNaNNaNNaNNaN
20566585.458809NaNNaNNaNNaNNaNNaNNaNNaNNaN
20576659.845733NaNNaNNaNNaNNaNNaNNaNNaNNaN
20586729.394974NaNNaNNaNNaNNaNNaNNaNNaNNaN
20596793.891974NaNNaNNaNNaNNaNNaNNaNNaNNaN
20606853.122175NaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", + "
" + ], + "text/plain": [ + " World OECD90 Eastern Europe Asia (Sans Japan) Middle East and Africa Latin America China India EU USA\n", + "Year \n", + "2014 841.924923 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2015 894.015378 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2016 932.030756 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2017 970.046134 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2018 1008.061512 233.988399 3.173527 859.451339 48.522968 157.556351 311.348795 185.191833 138.073601 13.301056\n", + "2019 1867.670287 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2020 2047.097470 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2021 2222.808422 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2022 2394.872622 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2023 2563.359547 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2024 2728.338675 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2025 2889.879483 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2026 3168.536333 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2027 3288.284260 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2028 3409.631245 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2029 3532.362731 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2030 3665.117966 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2031 3781.120970 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2032 3906.718608 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2033 4032.842514 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2034 4159.278130 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2035 4272.015687 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2036 4412.226259 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2037 4538.309656 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2038 4663.846531 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2039 4788.622326 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2040 4931.968322 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2041 5035.032443 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2042 5156.237648 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2043 5275.823541 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2044 5393.575564 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2045 5497.388386 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2046 5622.719766 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2047 5733.682829 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2048 5841.953789 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2049 5947.318089 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2050 6052.095000 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2051 6148.468473 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2052 6243.825443 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2053 6335.417519 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2054 6423.030144 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2055 6506.448760 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2056 6585.458809 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2057 6659.845733 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2058 6729.394974 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2059 6793.891974 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", + "2060 6853.122175 NaN NaN NaN NaN NaN NaN NaN NaN NaN" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pds1.ht.soln_pds_funits_adopted()" + ] + }, + { + "cell_type": "markdown", + "id": "03ae538d", + "metadata": {}, + "source": [ + "While `lifetime_operating_savings` is calculated for the entire scenario lifetime, other key results are calculated for a specific final year or for an interval. Intervals always start in 2020 but we can specify the final year. In the original excel sheets the default year is 2050 and so it is in the Python port." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "8b07f6f7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'implementation_unit_adoption_increase': 242777.14688276115,\n", + " 'functional_unit_adoption_increase': 1254.2601831584388,\n", + " 'marginal_first_cost': 2358.757905490336,\n", + " 'net_operating_savings': 415.40118026217056,\n", + " 'lifetime_operating_savings': 741.9571034347329,\n", + " 'cumulative_emissions_reduced': 2.3034768858097836}" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pds1.key_results(year=2050)" + ] + }, + { + "cell_type": "markdown", + "id": "7b9bf497", + "metadata": {}, + "source": [ + "Compare to:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "8523ad41", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'implementation_unit_adoption_increase': 221737.86679763015,\n", + " 'functional_unit_adoption_increase': 1145.564897659259,\n", + " 'marginal_first_cost': 2154.345880454912,\n", + " 'net_operating_savings': 234.309027914764,\n", + " 'lifetime_operating_savings': 741.9571034347329,\n", + " 'cumulative_emissions_reduced': 1.309142675006755}" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pds1.key_results(year=2040)" + ] + }, + { + "cell_type": "markdown", + "id": "4bba04f7", + "metadata": {}, + "source": [ + "This also works for the individual solutions, except for `lifetime_operating_savings`." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "9caeb538", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[242777.14688276115,\n", + " 1254.2601831584388,\n", + " 2358.757905490336,\n", + " 415.40118026217056,\n", + " 741.9571034347329,\n", + " 2.3034768858097836]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "year=2050\n", + "[pds1.implementation_unit_adoption_increase(year),\n", + "pds1.functional_unit_adoption_increase(year),\n", + "pds1.marginal_first_cost(year),\n", + "pds1.net_operating_savings(year),\n", + "pds1.lifetime_operating_savings(),\n", + "pds1.cumulative_emissions_reduced(year)]" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "8f1e563b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[221737.86679763015,\n", + " 1145.564897659259,\n", + " 2154.345880454912,\n", + " 234.309027914764,\n", + " 741.9571034347329,\n", + " 1.309142675006755]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "year=2040\n", + "[pds1.implementation_unit_adoption_increase(year),\n", + "pds1.functional_unit_adoption_increase(year),\n", + "pds1.marginal_first_cost(year),\n", + "pds1.net_operating_savings(year),\n", + "pds1.lifetime_operating_savings(),\n", + "pds1.cumulative_emissions_reduced(year)]" + ] + }, + { + "cell_type": "markdown", + "id": "afb7e127", + "metadata": {}, + "source": [ + "Finally, by default all key results are calculated for the `'World'` region." + ] + }, + { + "cell_type": "markdown", + "id": "a9b7f3d3", + "metadata": {}, + "source": [ + "### Testing key results" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "df07c145", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "============================= test session starts =============================\n", + "platform win32 -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1\n", + "Git: v0.17.1-8-g9998d831 ()\n", + "rootdir: C:\\Users\\Daniel\\repos\\solutions, configfile: tox.ini\n", + "collected 2 items\n", + "\n", + "solution\\bamboo\\tests\\test_bamboo.py .. [100%]\n", + "\n", + "============================== warnings summary ===============================\n", + "solution/bamboo/tests/test_bamboo.py::test_bamboo_loader\n", + " C:\\Users\\Daniel\\anaconda3\\envs\\pd-dev\\lib\\site-packages\\fair\\RCPs\\rcp3pd.py:4: DeprecationWarning: name rcp3pd will be deprecated in FaIR 2.0. Please use rcp26.\n", + " warnings.warn('name rcp3pd will be deprecated in FaIR 2.0. Please use rcp26.',\n", + "\n", + "solution/bamboo/tests/test_bamboo.py::test_bamboo_loader\n", + " C:\\Users\\Daniel\\anaconda3\\envs\\pd-dev\\lib\\site-packages\\fair\\RCPs\\rcp6.py:4: DeprecationWarning: name rcp6 will be deprecated in FaIR 2.0. Please use rcp60.\n", + " warnings.warn('name rcp6 will be deprecated in FaIR 2.0. Please use rcp60.',\n", + "\n", + "-- Docs: https://docs.pytest.org/en/stable/warnings.html\n", + "======================= 2 passed, 2 warnings in 17.99s ========================\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "error: unknown option `show-current'\n", + "usage: git branch [] [-r | -a] [--merged | --no-merged]\n", + " or: git branch [] [-l] [-f] []\n", + " or: git branch [] [-r] (-d | -D) ...\n", + " or: git branch [] (-m | -M) [] \n", + " or: git branch [] (-c | -C) [] \n", + " or: git branch [] [-r | -a] [--points-at]\n", + " or: git branch [] [-r | -a] [--format]\n", + "\n", + "Generic options\n", + " -v, --verbose show hash and subject, give twice for upstream branch\n", + " -q, --quiet suppress informational messages\n", + " -t, --track set up tracking mode (see git-pull(1))\n", + " -u, --set-upstream-to \n", + " change the upstream info\n", + " --unset-upstream Unset the upstream info\n", + " --color[=] use colored output\n", + " -r, --remotes act on remote-tracking branches\n", + " --contains print only branches that contain the commit\n", + " --no-contains \n", + " print only branches that don't contain the commit\n", + " --abbrev[=] use digits to display SHA-1s\n", + "\n", + "Specific git-branch actions:\n", + " -a, --all list both remote-tracking and local branches\n", + " -d, --delete delete fully merged branch\n", + " -D delete branch (even if not merged)\n", + " -m, --move move/rename a branch and its reflog\n", + " -M move/rename a branch, even if target exists\n", + " -c, --copy copy a branch and its reflog\n", + " -C copy a branch, even if target exists\n", + " --list list branch names\n", + " -l, --create-reflog create the branch's reflog\n", + " --edit-description edit the description for the branch\n", + " -f, --force force creation, move/rename, deletion\n", + " --merged print only branches that are merged\n", + " --no-merged print only branches that are not merged\n", + " --column[=\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
CO2 (Gt-C)CH4 (Mt-CH4)N2O (Mt-N2O)
Year
20150.0000000.00.0
20160.0000000.00.0
20170.0000000.00.0
20180.0000000.00.0
20190.0000000.00.0
20200.0136420.00.0
20210.0204630.00.0
20220.0272850.00.0
20230.0341060.00.0
20240.0409270.00.0
20250.0477480.00.0
20260.0545690.00.0
20270.0613900.00.0
20280.0682120.00.0
20290.0750330.00.0
20300.0818540.00.0
20310.0886750.00.0
20320.0954960.00.0
20330.1023170.00.0
20340.1091390.00.0
20350.1159600.00.0
20360.1227810.00.0
20370.1296020.00.0
20380.1364230.00.0
20390.1432440.00.0
20400.1500660.00.0
20410.1568870.00.0
20420.1637080.00.0
20430.1705290.00.0
20440.1773500.00.0
20450.1841710.00.0
20460.1909930.00.0
20470.1978140.00.0
20480.2046350.00.0
20490.2114560.00.0
20500.2182770.00.0
20510.0000000.00.0
20520.0000000.00.0
20530.0000000.00.0
20540.0000000.00.0
20550.0000000.00.0
20560.0000000.00.0
20570.0000000.00.0
20580.0000000.00.0
20590.0000000.00.0
20600.0000000.00.0
\n", - "" - ], - "text/plain": [ - " CO2 (Gt-C) CH4 (Mt-CH4) N2O (Mt-N2O)\n", - "Year \n", - "2015 0.000000 0.0 0.0\n", - "2016 0.000000 0.0 0.0\n", - "2017 0.000000 0.0 0.0\n", - "2018 0.000000 0.0 0.0\n", - "2019 0.000000 0.0 0.0\n", - "2020 0.013642 0.0 0.0\n", - "2021 0.020463 0.0 0.0\n", - "2022 0.027285 0.0 0.0\n", - "2023 0.034106 0.0 0.0\n", - "2024 0.040927 0.0 0.0\n", - "2025 0.047748 0.0 0.0\n", - "2026 0.054569 0.0 0.0\n", - "2027 0.061390 0.0 0.0\n", - "2028 0.068212 0.0 0.0\n", - "2029 0.075033 0.0 0.0\n", - "2030 0.081854 0.0 0.0\n", - "2031 0.088675 0.0 0.0\n", - "2032 0.095496 0.0 0.0\n", - "2033 0.102317 0.0 0.0\n", - "2034 0.109139 0.0 0.0\n", - "2035 0.115960 0.0 0.0\n", - "2036 0.122781 0.0 0.0\n", - "2037 0.129602 0.0 0.0\n", - "2038 0.136423 0.0 0.0\n", - "2039 0.143244 0.0 0.0\n", - "2040 0.150066 0.0 0.0\n", - "2041 0.156887 0.0 0.0\n", - "2042 0.163708 0.0 0.0\n", - "2043 0.170529 0.0 0.0\n", - "2044 0.177350 0.0 0.0\n", - "2045 0.184171 0.0 0.0\n", - "2046 0.190993 0.0 0.0\n", - "2047 0.197814 0.0 0.0\n", - "2048 0.204635 0.0 0.0\n", - "2049 0.211456 0.0 0.0\n", - "2050 0.218277 0.0 0.0\n", - "2051 0.000000 0.0 0.0\n", - "2052 0.000000 0.0 0.0\n", - "2053 0.000000 0.0 0.0\n", - "2054 0.000000 0.0 0.0\n", - "2055 0.000000 0.0 0.0\n", - "2056 0.000000 0.0 0.0\n", - "2057 0.000000 0.0 0.0\n", - "2058 0.000000 0.0 0.0\n", - "2059 0.000000 0.0 0.0\n", - "2060 0.000000 0.0 0.0" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pds1.c2.ghg_emissions_reductions_global_annual()" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "f534243a", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "-1390148.5984713845" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "year=2050\n", - "region='World'\n", - "pds_adoption = pds1.pds_ca.adoption_data_per_region()\n", - "ref_adoption = pds1.ref_ca.adoption_data_per_region()\n", - "(pds_adoption.loc[year][region] / pds1.ac.soln_avg_annual_use - \n", - " ref_adoption.loc[year][region] / pds1.ac.conv_avg_annual_use)" - ] - }, - { - "cell_type": "markdown", - "id": "2ab0cff3", - "metadata": {}, - "source": [ - "`key_results()` returns a dictionary. Of all six key results. We can also access each result individually." - ] - }, - { - "cell_type": "code", - "execution_count": 49, - "id": "523f5cdd", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
WorldOECD90Eastern EuropeAsia (Sans Japan)Middle East and AfricaLatin AmericaChinaIndiaEUUSA
Year
2014841.924923NaNNaNNaNNaNNaNNaNNaNNaNNaN
2015894.015378NaNNaNNaNNaNNaNNaNNaNNaNNaN
2016932.030756NaNNaNNaNNaNNaNNaNNaNNaNNaN
2017970.046134NaNNaNNaNNaNNaNNaNNaNNaNNaN
20181008.061512233.9883993.173527859.45133948.522968157.556351311.348795185.191833138.07360113.301056
20191867.670287NaNNaNNaNNaNNaNNaNNaNNaNNaN
20202047.097470NaNNaNNaNNaNNaNNaNNaNNaNNaN
20212222.808422NaNNaNNaNNaNNaNNaNNaNNaNNaN
20222394.872622NaNNaNNaNNaNNaNNaNNaNNaNNaN
20232563.359547NaNNaNNaNNaNNaNNaNNaNNaNNaN
20242728.338675NaNNaNNaNNaNNaNNaNNaNNaNNaN
20252889.879483NaNNaNNaNNaNNaNNaNNaNNaNNaN
20263168.536333NaNNaNNaNNaNNaNNaNNaNNaNNaN
20273288.284260NaNNaNNaNNaNNaNNaNNaNNaNNaN
20283409.631245NaNNaNNaNNaNNaNNaNNaNNaNNaN
20293532.362731NaNNaNNaNNaNNaNNaNNaNNaNNaN
20303665.117966NaNNaNNaNNaNNaNNaNNaNNaNNaN
20313781.120970NaNNaNNaNNaNNaNNaNNaNNaNNaN
20323906.718608NaNNaNNaNNaNNaNNaNNaNNaNNaN
20334032.842514NaNNaNNaNNaNNaNNaNNaNNaNNaN
20344159.278130NaNNaNNaNNaNNaNNaNNaNNaNNaN
20354272.015687NaNNaNNaNNaNNaNNaNNaNNaNNaN
20364412.226259NaNNaNNaNNaNNaNNaNNaNNaNNaN
20374538.309656NaNNaNNaNNaNNaNNaNNaNNaNNaN
20384663.846531NaNNaNNaNNaNNaNNaNNaNNaNNaN
20394788.622326NaNNaNNaNNaNNaNNaNNaNNaNNaN
20404931.968322NaNNaNNaNNaNNaNNaNNaNNaNNaN
20415035.032443NaNNaNNaNNaNNaNNaNNaNNaNNaN
20425156.237648NaNNaNNaNNaNNaNNaNNaNNaNNaN
20435275.823541NaNNaNNaNNaNNaNNaNNaNNaNNaN
20445393.575564NaNNaNNaNNaNNaNNaNNaNNaNNaN
20455497.388386NaNNaNNaNNaNNaNNaNNaNNaNNaN
20465622.719766NaNNaNNaNNaNNaNNaNNaNNaNNaN
20475733.682829NaNNaNNaNNaNNaNNaNNaNNaNNaN
20485841.953789NaNNaNNaNNaNNaNNaNNaNNaNNaN
20495947.318089NaNNaNNaNNaNNaNNaNNaNNaNNaN
20506052.095000NaNNaNNaNNaNNaNNaNNaNNaNNaN
20516148.468473NaNNaNNaNNaNNaNNaNNaNNaNNaN
20526243.825443NaNNaNNaNNaNNaNNaNNaNNaNNaN
20536335.417519NaNNaNNaNNaNNaNNaNNaNNaNNaN
20546423.030144NaNNaNNaNNaNNaNNaNNaNNaNNaN
20556506.448760NaNNaNNaNNaNNaNNaNNaNNaNNaN
20566585.458809NaNNaNNaNNaNNaNNaNNaNNaNNaN
20576659.845733NaNNaNNaNNaNNaNNaNNaNNaNNaN
20586729.394974NaNNaNNaNNaNNaNNaNNaNNaNNaN
20596793.891974NaNNaNNaNNaNNaNNaNNaNNaNNaN
20606853.122175NaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", - "
" - ], - "text/plain": [ - " World OECD90 Eastern Europe Asia (Sans Japan) Middle East and Africa Latin America China India EU USA\n", - "Year \n", - "2014 841.924923 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2015 894.015378 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2016 932.030756 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2017 970.046134 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2018 1008.061512 233.988399 3.173527 859.451339 48.522968 157.556351 311.348795 185.191833 138.073601 13.301056\n", - "2019 1867.670287 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2020 2047.097470 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2021 2222.808422 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2022 2394.872622 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2023 2563.359547 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2024 2728.338675 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2025 2889.879483 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2026 3168.536333 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2027 3288.284260 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2028 3409.631245 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2029 3532.362731 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2030 3665.117966 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2031 3781.120970 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2032 3906.718608 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2033 4032.842514 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2034 4159.278130 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2035 4272.015687 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2036 4412.226259 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2037 4538.309656 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2038 4663.846531 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2039 4788.622326 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2040 4931.968322 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2041 5035.032443 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2042 5156.237648 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2043 5275.823541 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2044 5393.575564 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2045 5497.388386 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2046 5622.719766 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2047 5733.682829 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2048 5841.953789 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2049 5947.318089 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2050 6052.095000 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2051 6148.468473 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2052 6243.825443 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2053 6335.417519 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2054 6423.030144 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2055 6506.448760 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2056 6585.458809 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2057 6659.845733 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2058 6729.394974 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2059 6793.891974 NaN NaN NaN NaN NaN NaN NaN NaN NaN\n", - "2060 6853.122175 NaN NaN NaN NaN NaN NaN NaN NaN NaN" - ] - }, - "execution_count": 49, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pds1.ht.soln_pds_funits_adopted()" - ] - }, - { - "cell_type": "markdown", - "id": "03ae538d", - "metadata": {}, - "source": [ - "While `lifetime_operating_savings` is calculated for the entire scenario lifetime, other key results are calculated for a specific final year or for an interval. Intervals always start in 2020 but we can specify the final year. In the original excel sheets the default year is 2050 and so it is in the Python port." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "8b07f6f7", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'implementation_unit_adoption_increase': 242777.14688276115,\n", - " 'functional_unit_adoption_increase': 1254.2601831584388,\n", - " 'marginal_first_cost': 2358.757905490336,\n", - " 'net_operating_savings': 415.40118026217056,\n", - " 'lifetime_operating_savings': 741.9571034347329,\n", - " 'cumulative_emissions_reduced': 2.3034768858097836}" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pds1.key_results(year=2050)" - ] - }, - { - "cell_type": "markdown", - "id": "7b9bf497", - "metadata": {}, - "source": [ - "Compare to:" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "8523ad41", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'implementation_unit_adoption_increase': 221737.86679763015,\n", - " 'functional_unit_adoption_increase': 1145.564897659259,\n", - " 'marginal_first_cost': 2154.345880454912,\n", - " 'net_operating_savings': 234.309027914764,\n", - " 'lifetime_operating_savings': 741.9571034347329,\n", - " 'cumulative_emissions_reduced': 1.309142675006755}" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pds1.key_results(year=2040)" - ] - }, - { - "cell_type": "markdown", - "id": "4bba04f7", - "metadata": {}, - "source": [ - "This also works for the individual solutions, except for `lifetime_operating_savings`." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "9caeb538", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[242777.14688276115,\n", - " 1254.2601831584388,\n", - " 2358.757905490336,\n", - " 415.40118026217056,\n", - " 741.9571034347329,\n", - " 2.3034768858097836]" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "year=2050\n", - "[pds1.implementation_unit_adoption_increase(year),\n", - "pds1.functional_unit_adoption_increase(year),\n", - "pds1.marginal_first_cost(year),\n", - "pds1.net_operating_savings(year),\n", - "pds1.lifetime_operating_savings(),\n", - "pds1.cumulative_emissions_reduced(year)]" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "8f1e563b", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[221737.86679763015,\n", - " 1145.564897659259,\n", - " 2154.345880454912,\n", - " 234.309027914764,\n", - " 741.9571034347329,\n", - " 1.309142675006755]" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "year=2040\n", - "[pds1.implementation_unit_adoption_increase(year),\n", - "pds1.functional_unit_adoption_increase(year),\n", - "pds1.marginal_first_cost(year),\n", - "pds1.net_operating_savings(year),\n", - "pds1.lifetime_operating_savings(),\n", - "pds1.cumulative_emissions_reduced(year)]" - ] - }, - { - "cell_type": "markdown", - "id": "afb7e127", - "metadata": {}, - "source": [ - "Finally, by default all key results are calculated for the `'World'` region." - ] - }, - { - "cell_type": "markdown", - "id": "a9b7f3d3", - "metadata": {}, - "source": [ - "### Testing key results" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "df07c145", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "============================= test session starts =============================\n", - "platform win32 -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1\n", - "Git: v0.17.1-8-g9998d831 ()\n", - "rootdir: C:\\Users\\Daniel\\repos\\solutions, configfile: tox.ini\n", - "collected 2 items\n", - "\n", - "solution\\bamboo\\tests\\test_bamboo.py .. [100%]\n", - "\n", - "============================== warnings summary ===============================\n", - "solution/bamboo/tests/test_bamboo.py::test_bamboo_loader\n", - " C:\\Users\\Daniel\\anaconda3\\envs\\pd-dev\\lib\\site-packages\\fair\\RCPs\\rcp3pd.py:4: DeprecationWarning: name rcp3pd will be deprecated in FaIR 2.0. Please use rcp26.\n", - " warnings.warn('name rcp3pd will be deprecated in FaIR 2.0. Please use rcp26.',\n", - "\n", - "solution/bamboo/tests/test_bamboo.py::test_bamboo_loader\n", - " C:\\Users\\Daniel\\anaconda3\\envs\\pd-dev\\lib\\site-packages\\fair\\RCPs\\rcp6.py:4: DeprecationWarning: name rcp6 will be deprecated in FaIR 2.0. Please use rcp60.\n", - " warnings.warn('name rcp6 will be deprecated in FaIR 2.0. Please use rcp60.',\n", - "\n", - "-- Docs: https://docs.pytest.org/en/stable/warnings.html\n", - "======================= 2 passed, 2 warnings in 17.99s ========================\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "error: unknown option `show-current'\n", - "usage: git branch [] [-r | -a] [--merged | --no-merged]\n", - " or: git branch [] [-l] [-f] []\n", - " or: git branch [] [-r] (-d | -D) ...\n", - " or: git branch [] (-m | -M) [] \n", - " or: git branch [] (-c | -C) [] \n", - " or: git branch [] [-r | -a] [--points-at]\n", - " or: git branch [] [-r | -a] [--format]\n", - "\n", - "Generic options\n", - " -v, --verbose show hash and subject, give twice for upstream branch\n", - " -q, --quiet suppress informational messages\n", - " -t, --track set up tracking mode (see git-pull(1))\n", - " -u, --set-upstream-to \n", - " change the upstream info\n", - " --unset-upstream Unset the upstream info\n", - " --color[=] use colored output\n", - " -r, --remotes act on remote-tracking branches\n", - " --contains print only branches that contain the commit\n", - " --no-contains \n", - " print only branches that don't contain the commit\n", - " --abbrev[=] use digits to display SHA-1s\n", - "\n", - "Specific git-branch actions:\n", - " -a, --all list both remote-tracking and local branches\n", - " -d, --delete delete fully merged branch\n", - " -D delete branch (even if not merged)\n", - " -m, --move move/rename a branch and its reflog\n", - " -M move/rename a branch, even if target exists\n", - " -c, --copy copy a branch and its reflog\n", - " -C copy a branch, even if target exists\n", - " --list list branch names\n", - " -l, --create-reflog create the branch's reflog\n", - " --edit-description edit the description for the branch\n", - " -f, --force force creation, move/rename, deletion\n", - " --merged print only branches that are merged\n", - " --no-merged print only branches that are not merged\n", - " --column[=