From aad664ff1202d298e3265cd8994ca5e9a57788e9 Mon Sep 17 00:00:00 2001 From: brynpickering Date: Wed, 18 Jan 2023 15:09:13 +0100 Subject: [PATCH] Release v0.6.10 --- calliope/_version.py | 2 +- calliope/postprocess/plotting/flows.py | 2 +- changelog.rst | 4 +- .../notebooks/calliope_model_object.ipynb | 3044 +++++++++-------- doc/_static/notebooks/milp.ipynb | 1496 ++++---- doc/_static/notebooks/national_scale.ipynb | 2017 +++++------ doc/_static/notebooks/urban_scale.ipynb | 2831 +++++++-------- doc/_static/plot_summary.html | 26 +- doc/user/develop.rst | 18 +- .../images/clustered_plot_timeseries.html | 10 +- doc/user/images/plot_capacity.html | 8 +- doc/user/images/plot_flows.html | 8 +- doc/user/images/plot_timeseries.html | 8 +- doc/user/images/plot_transmission.html | 8 +- doc/user/images/plot_transmission_token.html | 8 +- 15 files changed, 4847 insertions(+), 4643 deletions(-) diff --git a/calliope/_version.py b/calliope/_version.py index 9802342ef..54149df1f 100644 --- a/calliope/_version.py +++ b/calliope/_version.py @@ -1 +1 @@ -__version__ = "0.6.10-dev" +__version__ = "0.6.10" diff --git a/calliope/postprocess/plotting/flows.py b/calliope/postprocess/plotting/flows.py index fe2d01be2..d72caf3dc 100644 --- a/calliope/postprocess/plotting/flows.py +++ b/calliope/postprocess/plotting/flows.py @@ -208,7 +208,7 @@ def _production_data(model, timesteps, timestep): techs_production = locs_techs_carriers_production.sel( carriers=carrier, locs=location ).to_pandas() - for tech, prod in techs_production.loc[:, timestep].iteritems(): + for tech, prod in techs_production.loc[:, timestep].items(): if prod and prod > 0: # if some energy is at stake diff --git a/changelog.rst b/changelog.rst index 4b05ea666..cac21a8c1 100644 --- a/changelog.rst +++ b/changelog.rst @@ -3,8 +3,8 @@ Release History =============== -0.6.10 (dev) ------------- +0.6.10 (2023-01-18) +------------------- |changed| |backwards-incompatible| Updated to Numpy v1.23, Pandas v1.5, Pyomo v6.4, Ruamel.yaml v0.17, Scikit-learn v1.2, Xarray v2022.3, GLPK v5. This enables Calliope to be installed on Apple Silicon devices, but changes the result of algorithmic timeseries clustering. `In scikit-learn version 0.24.0, the method of random sampling for K-Means clustering was changed `_. This change will lead to different optimisation results if using `K-Means clustering `_ in your model. diff --git a/doc/_static/notebooks/calliope_model_object.ipynb b/doc/_static/notebooks/calliope_model_object.ipynb index eac65f599..2f41b9c89 100644 --- a/doc/_static/notebooks/calliope_model_object.ipynb +++ b/doc/_static/notebooks/calliope_model_object.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -24,17 +24,17 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[2023-01-10 15:31:04] INFO Model: initialising\n", - "[2023-01-10 15:31:05] INFO Model: preprocessing stage 1 (model_run)\n", - "[2023-01-10 15:31:06] INFO Model: preprocessing stage 2 (model_data)\n", - "[2023-01-10 15:31:06] INFO Model: preprocessing complete\n" + "[2023-01-18 13:20:45] INFO Model: initialising\n", + "[2023-01-18 13:20:46] INFO Model: preprocessing stage 1 (model_run)\n", + "[2023-01-18 13:20:47] INFO Model: preprocessing stage 2 (model_data)\n", + "[2023-01-18 13:20:47] INFO Model: preprocessing complete\n" ] } ], @@ -45,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -54,7 +54,7 @@ "'Model name: Urban-scale example model\\nModel size: 4 locations, 9 technologies, 48 timesteps'" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -75,7 +75,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -84,7 +84,7 @@ "dict_keys(['scenario', 'applied_overrides', 'techs', 'tech_groups', 'locations', 'timeseries_data', 'run', 'model', 'group_constraints', 'sets', 'constraint_sets'])" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -96,7 +96,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -119,7 +119,7 @@ " 'resource_unit': 'energy_per_area'}}" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -132,7 +132,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -154,7 +154,7 @@ " 'energy_cap': 1350}}}" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -167,41 +167,41 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['X3::heat_pipes:N1',\n", - " 'X3::demand_heat',\n", - " 'X3::power_lines:X1',\n", - " 'X3::boiler',\n", + "['X3::power_lines:X1',\n", " 'X1::supply_gas',\n", - " 'X2::demand_heat',\n", + " 'X3::boiler',\n", " 'X3::pv',\n", - " 'X1::supply_grid_power',\n", " 'X2::pv',\n", + " 'X1::supply_grid_power',\n", + " 'X1::chp',\n", " 'X2::power_lines:X1',\n", " 'X1::power_lines:X2',\n", - " 'X2::supply_gas',\n", - " 'X1::chp',\n", - " 'X1::demand_electricity',\n", - " 'X1::heat_pipes:N1',\n", + " 'X3::demand_heat',\n", + " 'X2::heat_pipes:N1',\n", + " 'X3::heat_pipes:N1',\n", " 'X1::pv',\n", - " 'X3::demand_electricity',\n", + " 'X1::power_lines:X3',\n", " 'X1::demand_heat',\n", - " 'N1::heat_pipes:X2',\n", " 'N1::heat_pipes:X3',\n", - " 'N1::heat_pipes:X1',\n", - " 'X2::heat_pipes:N1',\n", + " 'X2::supply_gas',\n", " 'X2::demand_electricity',\n", + " 'N1::heat_pipes:X2',\n", + " 'X2::demand_heat',\n", + " 'X1::demand_electricity',\n", + " 'N1::heat_pipes:X1',\n", + " 'X2::boiler',\n", + " 'X1::heat_pipes:N1',\n", " 'X3::supply_gas',\n", - " 'X1::power_lines:X3',\n", - " 'X2::boiler']" + " 'X3::demand_electricity']" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -216,41 +216,41 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['X3::heat_pipes:N1',\n", - " 'X3::demand_heat',\n", - " 'X3::power_lines:X1',\n", - " 'X3::boiler',\n", + "['X3::power_lines:X1',\n", " 'X1::supply_gas',\n", - " 'X2::demand_heat',\n", + " 'X3::boiler',\n", " 'X3::pv',\n", - " 'X1::supply_grid_power',\n", " 'X2::pv',\n", + " 'X1::supply_grid_power',\n", + " 'X1::chp',\n", " 'X2::power_lines:X1',\n", " 'X1::power_lines:X2',\n", - " 'X2::supply_gas',\n", - " 'X1::chp',\n", - " 'X1::demand_electricity',\n", - " 'X1::heat_pipes:N1',\n", + " 'X3::demand_heat',\n", + " 'X2::heat_pipes:N1',\n", + " 'X3::heat_pipes:N1',\n", " 'X1::pv',\n", - " 'X3::demand_electricity',\n", + " 'X1::power_lines:X3',\n", " 'X1::demand_heat',\n", - " 'N1::heat_pipes:X2',\n", " 'N1::heat_pipes:X3',\n", - " 'N1::heat_pipes:X1',\n", - " 'X2::heat_pipes:N1',\n", + " 'X2::supply_gas',\n", " 'X2::demand_electricity',\n", + " 'N1::heat_pipes:X2',\n", + " 'X2::demand_heat',\n", + " 'X1::demand_electricity',\n", + " 'N1::heat_pipes:X1',\n", + " 'X2::boiler',\n", + " 'X1::heat_pipes:N1',\n", " 'X3::supply_gas',\n", - " 'X1::power_lines:X3',\n", - " 'X2::boiler']" + " 'X3::demand_electricity']" ] }, - "execution_count": 8, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -264,7 +264,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -273,7 +273,7 @@ "['X2::pv', 'X3::pv', 'X1::pv']" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -284,7 +284,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -351,7 +351,7 @@ "2005-07-01 04:00:00 0.0 0.0" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -372,7 +372,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -730,71 +730,82 @@ " fill: currentColor;\n", "}\n", "
<xarray.Dataset>\n",
-       "Dimensions:                               (loc_techs_finite_resource: 9, loc_techs: 26, timesteps: 48, loc_techs_area: 3, loc_techs_supply_plus: 3, loc_techs_export: 4, costs: 1, loc_techs_investment_cost: 20, loc_techs_om_cost: 8, loc_techs_transmission: 10, locs: 4, coordinates: 2, techs: 9, carrier_tiers: 3, loc_tech_carriers_conversion_plus: 3, loc_carriers: 10, loc_techs_non_conversion: 23, loc_techs_conversion: 2, loc_techs_conversion_plus: 1, carriers: 3)\n",
+       "Dimensions:                               (loc_techs: 26, loc_techs_export: 4,\n",
+       "                                           loc_techs_finite_resource: 9,\n",
+       "                                           timesteps: 48,\n",
+       "                                           loc_techs_supply_plus: 3,\n",
+       "                                           loc_techs_area: 3, costs: 1,\n",
+       "                                           loc_techs_investment_cost: 20,\n",
+       "                                           ...\n",
+       "                                           loc_tech_carriers_conversion_plus: 3,\n",
+       "                                           loc_carriers: 10,\n",
+       "                                           loc_techs_non_conversion: 23,\n",
+       "                                           loc_techs_conversion: 2,\n",
+       "                                           loc_techs_conversion_plus: 1,\n",
+       "                                           carriers: 3)\n",
        "Coordinates: (12/20)\n",
-       "  * carrier_tiers                         (carrier_tiers) <U5 'out' 'in' 'out_2'\n",
+       "  * carrier_tiers                         (carrier_tiers) <U5 'out_2' 'in' 'out'\n",
        "  * carriers                              (carriers) <U11 'gas' ... 'heat'\n",
-       "  * coordinates                           (coordinates) object 'x' 'y'\n",
+       "  * coordinates                           (coordinates) object 'y' 'x'\n",
        "  * costs                                 (costs) object 'monetary'\n",
-       "  * loc_carriers                          (loc_carriers) object 'X3::gas' ......\n",
+       "  * loc_carriers                          (loc_carriers) object 'X1::gas' ......\n",
        "  * loc_tech_carriers_conversion_plus     (loc_tech_carriers_conversion_plus) object ...\n",
        "    ...                                    ...\n",
        "  * loc_techs_om_cost                     (loc_techs_om_cost) object 'X1::sup...\n",
        "  * loc_techs_supply_plus                 (loc_techs_supply_plus) object 'X2:...\n",
-       "  * loc_techs_transmission                (loc_techs_transmission) object 'X3...\n",
-       "  * locs                                  (locs) object 'X3' 'N1' 'X2' 'X1'\n",
-       "  * techs                                 (techs) object 'demand_heat' ... 'h...\n",
+       "  * loc_techs_transmission                (loc_techs_transmission) object 'N1...\n",
+       "  * locs                                  (locs) object 'N1' 'X3' 'X2' 'X1'\n",
+       "  * techs                                 (techs) object 'pv' ... 'chp'\n",
        "  * timesteps                             (timesteps) datetime64[ns] 2005-07-...\n",
        "Data variables: (12/38)\n",
-       "    resource_unit                         (loc_techs_finite_resource) object ...\n",
-       "    energy_eff                            (loc_techs) float64 0.9037 ... 0.85\n",
+       "    lifetime                              (loc_techs) float64 25.0 25.0 ... nan\n",
+       "    energy_con                            (loc_techs) float64 1.0 nan ... 1.0\n",
+       "    export_carrier                        (loc_techs_export) object 'electric...\n",
        "    resource                              (loc_techs_finite_resource, timesteps) float64 ...\n",
-       "    resource_eff                          (loc_techs_finite_resource) float64 ...\n",
-       "    force_resource                        (loc_techs_finite_resource) bool Tr...\n",
-       "    resource_area_per_energy_cap          (loc_techs_area) int64 7 7 7\n",
+       "    resource_unit                         (loc_techs_finite_resource) object ...\n",
+       "    parasitic_eff                         (loc_techs_supply_plus) float64 0.8...\n",
        "    ...                                    ...\n",
        "    lookup_loc_techs_conversion_plus      (carrier_tiers, loc_techs_conversion_plus) object ...\n",
-       "    lookup_loc_techs_export               (loc_techs_export) object 'X2::pv::...\n",
-       "    lookup_loc_techs_area                 (locs) object 'X3::pv' '' ... 'X1::pv'\n",
+       "    lookup_loc_techs_export               (loc_techs_export) object 'X1::chp:...\n",
+       "    lookup_loc_techs_area                 (locs) object '' 'X3::pv' ... 'X1::pv'\n",
        "    timestep_resolution                   (timesteps) float64 1.0 1.0 ... 1.0\n",
        "    timestep_weights                      (timesteps) float64 1.0 1.0 ... 1.0\n",
        "    max_demand_timesteps                  (carriers) datetime64[ns] 2005-07-0...\n",
        "Attributes:\n",
-       "    calliope_version:    0.6.8\n",
+       "    calliope_version:    0.6.10\n",
        "    applied_overrides:   \n",
        "    scenario:            None\n",
-       "    defaults:            available_area: null\\ncarrier_ratios: null\\ncharge_r...\n",
-       "    allow_operate_mode:  1
" ], "text/plain": [ "\n", - "Dimensions: (loc_techs_finite_resource: 9, loc_techs: 26, timesteps: 48, loc_techs_area: 3, loc_techs_supply_plus: 3, loc_techs_export: 4, costs: 1, loc_techs_investment_cost: 20, loc_techs_om_cost: 8, loc_techs_transmission: 10, locs: 4, coordinates: 2, techs: 9, carrier_tiers: 3, loc_tech_carriers_conversion_plus: 3, loc_carriers: 10, loc_techs_non_conversion: 23, loc_techs_conversion: 2, loc_techs_conversion_plus: 1, carriers: 3)\n", + "Dimensions: (loc_techs: 26, loc_techs_export: 4,\n", + " loc_techs_finite_resource: 9,\n", + " timesteps: 48,\n", + " loc_techs_supply_plus: 3,\n", + " loc_techs_area: 3, costs: 1,\n", + " loc_techs_investment_cost: 20,\n", + " ...\n", + " loc_tech_carriers_conversion_plus: 3,\n", + " loc_carriers: 10,\n", + " loc_techs_non_conversion: 23,\n", + " loc_techs_conversion: 2,\n", + " loc_techs_conversion_plus: 1,\n", + " carriers: 3)\n", "Coordinates: (12/20)\n", - " * carrier_tiers (carrier_tiers)
<xarray.Dataset>\n",
-       "Dimensions:                                                      (carrier_tiers: 3, carriers: 3, coordinates: 2, costs: 1, loc_carriers: 10, loc_carriers_system_balance_constraint: 10, loc_carriers_update_system_balance_constraint: 3, loc_tech_carriers_carrier_consumption_max_constraint: 16, loc_tech_carriers_carrier_production_max_constraint: 19, loc_tech_carriers_con: 19, loc_tech_carriers_conversion_all: 4, loc_tech_carriers_conversion_plus: 3, loc_tech_carriers_demand: 6, loc_tech_carriers_export: 4, loc_tech_carriers_export_balance_constraint: 4, loc_tech_carriers_prod: 21, loc_tech_carriers_supply_all: 7, loc_tech_carriers_supply_conversion_all: 11, loc_techs: 26, loc_techs_area: 3, loc_techs_balance_conversion_constraint: 2, loc_techs_balance_conversion_plus_out_2_constraint: 1, loc_techs_balance_conversion_plus_primary_constraint: 1, loc_techs_balance_demand_constraint: 6, loc_techs_balance_supply_plus_constraint: 3, loc_techs_balance_transmission_constraint: 10, loc_techs_carrier_production_max_conversion_plus_constraint: 1, loc_techs_conversion: 2, loc_techs_conversion_all: 3, loc_techs_conversion_plus: 1, loc_techs_cost: 20, loc_techs_cost_constraint: 20, loc_techs_cost_investment_constraint: 20, loc_techs_cost_var_constraint: 5, loc_techs_cost_var_conversion_constraint: 2, loc_techs_cost_var_conversion_plus_constraint: 1, loc_techs_costs_export: 2, loc_techs_demand: 6, loc_techs_energy_capacity_constraint: 26, loc_techs_export: 4, loc_techs_finite_resource: 9, loc_techs_finite_resource_demand: 6, loc_techs_finite_resource_supply_plus: 3, loc_techs_investment_cost: 20, loc_techs_non_conversion: 23, loc_techs_non_transmission: 16, loc_techs_om_cost: 8, loc_techs_om_cost_conversion: 2, loc_techs_om_cost_conversion_plus: 1, loc_techs_om_cost_supply: 4, loc_techs_om_cost_supply_plus: 1, loc_techs_out_2: 1, loc_techs_resource_area_constraint: 3, loc_techs_resource_area_per_energy_capacity_constraint: 3, loc_techs_resource_availability_supply_plus_constraint: 3, loc_techs_resource_max_constraint: 3, loc_techs_supply: 4, loc_techs_supply_all: 7, loc_techs_supply_conversion_all: 10, loc_techs_supply_plus: 3, loc_techs_symmetric_transmission_constraint: 10, loc_techs_transmission: 10, loc_techs_update_costs_var_constraint: 2, locs: 4, locs_resource_area_capacity_per_loc_constraint: 3, resources: 4, techs: 9, techs_conversion: 1, techs_conversion_plus: 1, techs_demand: 2, techs_non_transmission: 7, techs_supply: 2, techs_supply_plus: 1, techs_transmission: 7, techs_transmission_names: 2, timesteps: 48)\n",
+       "Dimensions:                                                      (\n",
+       "                                                                  carrier_tiers: 3,\n",
+       "                                                                  carriers: 3,\n",
+       "                                                                  coordinates: 2,\n",
+       "                                                                  costs: 1,\n",
+       "                                                                  loc_carriers: 10,\n",
+       "                                                                  ...\n",
+       "                                                                  techs_non_transmission: 7,\n",
+       "                                                                  techs_supply: 2,\n",
+       "                                                                  techs_supply_plus: 1,\n",
+       "                                                                  techs_transmission: 7,\n",
+       "                                                                  techs_transmission_names: 2,\n",
+       "                                                                  timesteps: 48)\n",
        "Coordinates: (12/76)\n",
        "  * carrier_tiers                                                (carrier_tiers) <U5 ...\n",
        "  * carriers                                                     (carriers) <U11 ...\n",
@@ -1503,12 +1536,12 @@
        "  * techs_transmission_names                                     (techs_transmission_names) <U11 ...\n",
        "  * timesteps                                                    (timesteps) datetime64[ns] ...\n",
        "Data variables: (12/38)\n",
-       "    resource_unit                                                (loc_techs_finite_resource) object ...\n",
-       "    energy_eff                                                   (loc_techs) float64 ...\n",
+       "    lifetime                                                     (loc_techs) float64 ...\n",
+       "    energy_con                                                   (loc_techs) float64 ...\n",
+       "    export_carrier                                               (loc_techs_export) object ...\n",
        "    resource                                                     (loc_techs_finite_resource, timesteps) float64 ...\n",
-       "    resource_eff                                                 (loc_techs_finite_resource) float64 ...\n",
-       "    force_resource                                               (loc_techs_finite_resource) bool ...\n",
-       "    resource_area_per_energy_cap                                 (loc_techs_area) int64 ...\n",
+       "    resource_unit                                                (loc_techs_finite_resource) object ...\n",
+       "    parasitic_eff                                                (loc_techs_supply_plus) float64 ...\n",
        "    ...                                                           ...\n",
        "    lookup_loc_techs_conversion_plus                             (carrier_tiers, loc_techs_conversion_plus) object ...\n",
        "    lookup_loc_techs_export                                      (loc_techs_export) object ...\n",
@@ -1517,140 +1550,136 @@
        "    timestep_weights                                             (timesteps) float64 ...\n",
        "    max_demand_timesteps                                         (carriers) datetime64[ns] ...\n",
        "Attributes:\n",
-       "    calliope_version:    0.6.8\n",
+       "    calliope_version:    0.6.10\n",
        "    applied_overrides:   \n",
        "    scenario:            None\n",
-       "    defaults:            available_area: null\\ncarrier_ratios: null\\ncharge_r...\n",
+       "    defaults:            carrier_ratios:\\ncharge_rate:\\nenergy_cap_per_storag...\n",
        "    allow_operate_mode:  1\n",
-       "    model_config:        calliope_version: 0.6.8\\nname: Urban-scale example m...\n",
-       "    run_config:          backend: pyomo\\nbigM: 1000000.0\\ncyclic_storage: tru...
" + " is_result: 0" ], "text/plain": [ "\n", @@ -3637,7 +3694,7 @@ " is_result: 0" ] }, - "execution_count": 15, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -3648,7 +3705,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -4005,51 +4062,49 @@ " stroke: currentColor;\n", " fill: currentColor;\n", "}\n", - "
<xarray.DataArray 'loc_techs_energy_capacity_constraint' (loc_techs_energy_capacity_constraint: 26)>\n",
-       "array(['X3::heat_pipes:N1', 'X3::demand_heat', 'X3::power_lines:X1',\n",
-       "       'X3::boiler', 'X1::supply_gas', 'X2::demand_heat', 'X3::pv',\n",
-       "       'X1::supply_grid_power', 'X2::pv', 'X2::power_lines:X1',\n",
-       "       'X1::power_lines:X2', 'X2::supply_gas', 'X1::chp',\n",
-       "       'X1::demand_electricity', 'X1::heat_pipes:N1', 'X1::pv',\n",
-       "       'X3::demand_electricity', 'X1::demand_heat', 'N1::heat_pipes:X2',\n",
-       "       'N1::heat_pipes:X3', 'N1::heat_pipes:X1', 'X2::heat_pipes:N1',\n",
-       "       'X2::demand_electricity', 'X3::supply_gas', 'X1::power_lines:X3',\n",
-       "       'X2::boiler'], dtype='<U22')\n",
+       "
<xarray.DataArray 'loc_techs_energy_capacity_constraint' (\n",
+       "                                                          loc_techs_energy_capacity_constraint: 26)>\n",
+       "array(['X3::power_lines:X1', 'X1::supply_gas', 'X3::boiler', 'X3::pv',\n",
+       "       'X2::pv', 'X1::supply_grid_power', 'X1::chp', 'X2::power_lines:X1',\n",
+       "       'X1::power_lines:X2', 'X3::demand_heat', 'X2::heat_pipes:N1',\n",
+       "       'X3::heat_pipes:N1', 'X1::pv', 'X1::power_lines:X3', 'X1::demand_heat',\n",
+       "       'N1::heat_pipes:X3', 'X2::supply_gas', 'X2::demand_electricity',\n",
+       "       'N1::heat_pipes:X2', 'X2::demand_heat', 'X1::demand_electricity',\n",
+       "       'N1::heat_pipes:X1', 'X2::boiler', 'X1::heat_pipes:N1',\n",
+       "       'X3::supply_gas', 'X3::demand_electricity'], dtype='<U22')\n",
        "Coordinates:\n",
-       "  * loc_techs_energy_capacity_constraint  (loc_techs_energy_capacity_constraint) <U22 ...
" + " * loc_techs_energy_capacity_constraint (loc_techs_energy_capacity_constraint) <U22 ...
" ], "text/plain": [ - "\n", - "array(['X3::heat_pipes:N1', 'X3::demand_heat', 'X3::power_lines:X1',\n", - " 'X3::boiler', 'X1::supply_gas', 'X2::demand_heat', 'X3::pv',\n", - " 'X1::supply_grid_power', 'X2::pv', 'X2::power_lines:X1',\n", - " 'X1::power_lines:X2', 'X2::supply_gas', 'X1::chp',\n", - " 'X1::demand_electricity', 'X1::heat_pipes:N1', 'X1::pv',\n", - " 'X3::demand_electricity', 'X1::demand_heat', 'N1::heat_pipes:X2',\n", - " 'N1::heat_pipes:X3', 'N1::heat_pipes:X1', 'X2::heat_pipes:N1',\n", - " 'X2::demand_electricity', 'X3::supply_gas', 'X1::power_lines:X3',\n", - " 'X2::boiler'], dtype='\n", + "array(['X3::power_lines:X1', 'X1::supply_gas', 'X3::boiler', 'X3::pv',\n", + " 'X2::pv', 'X1::supply_grid_power', 'X1::chp', 'X2::power_lines:X1',\n", + " 'X1::power_lines:X2', 'X3::demand_heat', 'X2::heat_pipes:N1',\n", + " 'X3::heat_pipes:N1', 'X1::pv', 'X1::power_lines:X3', 'X1::demand_heat',\n", + " 'N1::heat_pipes:X3', 'X2::supply_gas', 'X2::demand_electricity',\n", + " 'N1::heat_pipes:X2', 'X2::demand_heat', 'X1::demand_electricity',\n", + " 'N1::heat_pipes:X1', 'X2::boiler', 'X1::heat_pipes:N1',\n", + " 'X3::supply_gas', 'X3::demand_electricity'], dtype=' 2\u001b[0m m\u001b[39m.\u001b[39;49minputs\u001b[39m.\u001b[39;49mloc_techs_energy_capacity_constraint\n", - "File \u001b[0;32m~/miniconda3/envs/calliope-dev/lib/python3.9/site-packages/xarray/core/common.py:246\u001b[0m, in \u001b[0;36mAttrAccessMixin.__getattr__\u001b[0;34m(self, name)\u001b[0m\n\u001b[1;32m 244\u001b[0m \u001b[39mwith\u001b[39;00m suppress(\u001b[39mKeyError\u001b[39;00m):\n\u001b[1;32m 245\u001b[0m \u001b[39mreturn\u001b[39;00m source[name]\n\u001b[0;32m--> 246\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mAttributeError\u001b[39;00m(\n\u001b[1;32m 247\u001b[0m \u001b[39m\"\u001b[39m\u001b[39m{!r}\u001b[39;00m\u001b[39m object has no attribute \u001b[39m\u001b[39m{!r}\u001b[39;00m\u001b[39m\"\u001b[39m\u001b[39m.\u001b[39mformat(\u001b[39mtype\u001b[39m(\u001b[39mself\u001b[39m)\u001b[39m.\u001b[39m\u001b[39m__name__\u001b[39m, name)\n\u001b[1;32m 248\u001b[0m )\n", + "Cell \u001b[0;32mIn[18], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[39m# It is these constraint sets that we cannot see in m.inputs\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m m\u001b[39m.\u001b[39;49minputs\u001b[39m.\u001b[39;49mloc_techs_energy_capacity_constraint\n", + "File \u001b[0;32m~/miniconda3/envs/calliope_dev/lib/python3.9/site-packages/xarray/core/common.py:239\u001b[0m, in \u001b[0;36mAttrAccessMixin.__getattr__\u001b[0;34m(self, name)\u001b[0m\n\u001b[1;32m 237\u001b[0m \u001b[39mwith\u001b[39;00m suppress(\u001b[39mKeyError\u001b[39;00m):\n\u001b[1;32m 238\u001b[0m \u001b[39mreturn\u001b[39;00m source[name]\n\u001b[0;32m--> 239\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mAttributeError\u001b[39;00m(\n\u001b[1;32m 240\u001b[0m \u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m{\u001b[39;00m\u001b[39mtype\u001b[39m(\u001b[39mself\u001b[39m)\u001b[39m.\u001b[39m\u001b[39m__name__\u001b[39m\u001b[39m!r}\u001b[39;00m\u001b[39m object has no attribute \u001b[39m\u001b[39m{\u001b[39;00mname\u001b[39m!r}\u001b[39;00m\u001b[39m\"\u001b[39m\n\u001b[1;32m 241\u001b[0m )\n", "\u001b[0;31mAttributeError\u001b[0m: 'Dataset' object has no attribute 'loc_techs_energy_capacity_constraint'" ] } @@ -4091,36 +4146,36 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[2023-01-10 15:31:29] INFO Backend: starting model run\n", - "[2023-01-10 15:31:30] INFO Loading sets\n", - "[2023-01-10 15:31:30] INFO Loading parameters\n", - "[2023-01-10 15:31:30] INFO constraints are loaded in the following order: ['capacity', 'dispatch', 'policy', 'energy_balance', 'costs', 'network', 'conversion', 'group', 'conversion_plus', 'export', 'milp']\n", - "[2023-01-10 15:31:30] INFO creating capacity constraints\n", - "[2023-01-10 15:31:30] INFO creating dispatch constraints\n", - "[2023-01-10 15:31:30] INFO creating policy constraints\n", - "[2023-01-10 15:31:30] INFO creating energy_balance constraints\n", - "[2023-01-10 15:31:30] INFO creating costs constraints\n", - "[2023-01-10 15:31:30] INFO creating network constraints\n", - "[2023-01-10 15:31:30] INFO creating conversion constraints\n", - "[2023-01-10 15:31:30] INFO creating group constraints\n", - "[2023-01-10 15:31:30] INFO creating conversion_plus constraints\n", - "[2023-01-10 15:31:30] INFO creating export constraints\n", - "[2023-01-10 15:31:30] INFO creating milp constraints\n", - "[2023-01-10 15:31:30] INFO Backend: model generated. Time since start of model run: 0:00:00.830890\n", - "[2023-01-10 15:31:30] INFO Backend: sending model to solver\n", - "[2023-01-10 15:31:31] INFO Backend: solver finished running. Time since start of model run: 0:00:01.338561\n", - "[2023-01-10 15:31:31] INFO Backend: loaded results\n", - "[2023-01-10 15:31:31] INFO Backend: generated solution array. Time since start of model run: 0:00:01.432837\n", - "[2023-01-10 15:31:31] INFO Postprocessing: started\n", - "[2023-01-10 15:31:31] INFO Postprocessing: All values < 1e-10 set to 0 in system_balance\n", - "[2023-01-10 15:31:31] INFO Postprocessing: ended. Time since start of model run: 0:00:01.578373\n" + "[2023-01-18 13:21:19] INFO Backend: starting model run\n", + "[2023-01-18 13:21:19] INFO Loading sets\n", + "[2023-01-18 13:21:19] INFO Loading parameters\n", + "[2023-01-18 13:21:19] INFO constraints are loaded in the following order: ['capacity', 'dispatch', 'policy', 'energy_balance', 'costs', 'network', 'conversion', 'group', 'conversion_plus', 'export', 'milp']\n", + "[2023-01-18 13:21:19] INFO creating capacity constraints\n", + "[2023-01-18 13:21:19] INFO creating dispatch constraints\n", + "[2023-01-18 13:21:19] INFO creating policy constraints\n", + "[2023-01-18 13:21:19] INFO creating energy_balance constraints\n", + "[2023-01-18 13:21:19] INFO creating costs constraints\n", + "[2023-01-18 13:21:19] INFO creating network constraints\n", + "[2023-01-18 13:21:19] INFO creating conversion constraints\n", + "[2023-01-18 13:21:19] INFO creating group constraints\n", + "[2023-01-18 13:21:19] INFO creating conversion_plus constraints\n", + "[2023-01-18 13:21:19] INFO creating export constraints\n", + "[2023-01-18 13:21:19] INFO creating milp constraints\n", + "[2023-01-18 13:21:19] INFO Backend: model generated. Time since start of model run: 0:00:00.692113\n", + "[2023-01-18 13:21:19] INFO Backend: sending model to solver\n", + "[2023-01-18 13:21:21] INFO Backend: solver finished running. Time since start of model run: 0:00:02.575869\n", + "[2023-01-18 13:21:21] INFO Backend: loaded results\n", + "[2023-01-18 13:21:21] INFO Backend: generated solution array. Time since start of model run: 0:00:02.712495\n", + "[2023-01-18 13:21:21] INFO Postprocessing: started\n", + "[2023-01-18 13:21:22] INFO Postprocessing: All values < 1e-10 set to 0 in system_balance\n", + "[2023-01-18 13:21:22] INFO Postprocessing: ended. Time since start of model run: 0:00:02.827880\n" ] } ], @@ -4130,7 +4185,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -4488,23 +4543,35 @@ " fill: currentColor;\n", "}\n", "
<xarray.Dataset>\n",
-       "Dimensions:                                 (loc_techs: 26, loc_tech_carriers_prod: 21, timesteps: 48, loc_tech_carriers_con: 19, costs: 1, loc_techs_cost: 20, loc_techs_area: 3, loc_techs_supply_plus: 3, loc_tech_carriers_export: 4, loc_techs_om_cost: 8, loc_techs_investment_cost: 20, loc_carriers: 10, loc_carriers_system_balance_constraint: 10, loc_techs_balance_demand_constraint: 6, loc_techs_cost_investment_constraint: 20, carriers: 3, techs: 16)\n",
+       "Dimensions:                                 (loc_techs: 26,\n",
+       "                                             loc_tech_carriers_prod: 21,\n",
+       "                                             timesteps: 48,\n",
+       "                                             loc_tech_carriers_con: 19,\n",
+       "                                             costs: 1, loc_techs_cost: 20,\n",
+       "                                             loc_techs_area: 3,\n",
+       "                                             ...\n",
+       "                                             loc_techs_investment_cost: 20,\n",
+       "                                             loc_carriers: 10,\n",
+       "                                             loc_carriers_system_balance_constraint: 10,\n",
+       "                                             loc_techs_balance_demand_constraint: 6,\n",
+       "                                             loc_techs_cost_investment_constraint: 20,\n",
+       "                                             carriers: 3, techs: 16)\n",
        "Coordinates: (12/17)\n",
-       "  * loc_carriers                            (loc_carriers) object 'N1::heat' ...\n",
-       "  * loc_carriers_system_balance_constraint  (loc_carriers_system_balance_constraint) object ...\n",
-       "  * loc_tech_carriers_con                   (loc_tech_carriers_con) object 'N...\n",
-       "  * loc_tech_carriers_export                (loc_tech_carriers_export) object ...\n",
-       "  * loc_tech_carriers_prod                  (loc_tech_carriers_prod) object '...\n",
-       "  * loc_techs_balance_demand_constraint     (loc_techs_balance_demand_constraint) object ...\n",
-       "    ...                                      ...\n",
        "  * techs                                   (techs) object 'boiler' ... 'supp...\n",
        "  * carriers                                (carriers) <U11 'electricity' ......\n",
-       "  * costs                                   (costs) object 'monetary'\n",
-       "  * loc_techs                               (loc_techs) object 'X3::heat_pipe...\n",
-       "  * loc_techs_area                          (loc_techs_area) object 'X2::pv' ...\n",
+       "  * costs                                   (costs) <U8 'monetary'\n",
+       "  * loc_carriers                            (loc_carriers) <U15 'X1::gas' ......\n",
+       "  * loc_carriers_system_balance_constraint  (loc_carriers_system_balance_constraint) <U15 ...\n",
+       "  * loc_tech_carriers_con                   (loc_tech_carriers_con) <U35 'X3:...\n",
+       "    ...                                      ...\n",
+       "  * loc_techs_cost                          (loc_techs_cost) <U21 'X3::power_...\n",
+       "  * loc_techs_cost_investment_constraint    (loc_techs_cost_investment_constraint) <U21 ...\n",
+       "  * loc_techs_investment_cost               (loc_techs_investment_cost) <U21 ...\n",
+       "  * loc_techs_om_cost                       (loc_techs_om_cost) <U21 'X1::sup...\n",
+       "  * loc_techs_supply_plus                   (loc_techs_supply_plus) <U6 'X2::...\n",
        "  * timesteps                               (timesteps) datetime64[ns] 2005-0...\n",
        "Data variables: (12/19)\n",
-       "    energy_cap                              (loc_techs) float64 10.38 ... 192.8\n",
+       "    energy_cap                              (loc_techs) float64 45.78 ... 64.93\n",
        "    carrier_prod                            (loc_tech_carriers_prod, timesteps) float64 ...\n",
        "    carrier_con                             (loc_tech_carriers_con, timesteps) float64 ...\n",
        "    cost                                    (costs, loc_techs_cost) float64 0...\n",
@@ -4520,71 +4587,67 @@
        "Attributes:\n",
        "    termination_condition:     optimal\n",
        "    objective_function_value:  842.3529094335404\n",
-       "    solution_time:             1.432837\n",
-       "    time_finished:             2023-01-10 15:31:31\n",
-       "    calliope_version:          0.6.8\n",
+       "    solution_time:             2.712495\n",
+       "    time_finished:             2023-01-18 13:21:21\n",
+       "    calliope_version:          0.6.10\n",
        "    applied_overrides:         \n",
        "    scenario:                  None\n",
-       "    defaults:                  available_area: null\\ncarrier_ratios: null\\nch...\n",
+       "    defaults:                  carrier_ratios:\\ncharge_rate:\\nenergy_cap_per_...\n",
        "    allow_operate_mode:        1\n",
-       "    model_config:              calliope_version: 0.6.8\\nname: Urban-scale exa...\n",
-       "    run_config:                backend: pyomo\\nbigM: 1000000.0\\ncyclic_storag...