From e701dc5c15ce421955fe1c3a14576d2f5c4a11f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sim=C3=A3o=20Rodrigues?= Date: Tue, 26 Nov 2024 09:03:44 +0100 Subject: [PATCH] ruff fix --- data_energy/fitting/gaseous_bioenergy.py | 13 +++++++------ data_energy/fitting/hydropower.py | 8 ++++---- data_energy/fitting/windpower.py | 16 +++++++--------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/data_energy/fitting/gaseous_bioenergy.py b/data_energy/fitting/gaseous_bioenergy.py index f8b1bd12..b607e6f2 100644 --- a/data_energy/fitting/gaseous_bioenergy.py +++ b/data_energy/fitting/gaseous_bioenergy.py @@ -14,21 +14,22 @@ limitations under the License. ''' import os +import pickle +from copy import deepcopy import numpy as np import pandas as pd -import pickle +from climateeconomics.glossarycore import GlossaryCore from scipy.interpolate import interp1d from scipy.optimize import minimize from sostrades_core.execution_engine.execution_engine import ExecutionEngine +from sostrades_core.tools.bspline.bspline import BSpline from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import ( - InstanciatedSeries, - TwoAxesInstanciatedChart, + InstanciatedSeries, + TwoAxesInstanciatedChart, ) -from sostrades_core.tools.bspline.bspline import BSpline + from energy_models.glossaryenergy import GlossaryEnergy -from climateeconomics.glossarycore import GlossaryCore -from copy import deepcopy """ This script is used to calibrate the gaseous bioenergy invest so that the energy production matches the IEA NZE scenario diff --git a/data_energy/fitting/hydropower.py b/data_energy/fitting/hydropower.py index 9d9d38aa..9b202a8f 100644 --- a/data_energy/fitting/hydropower.py +++ b/data_energy/fitting/hydropower.py @@ -14,19 +14,19 @@ limitations under the License. ''' import os +import pickle +from copy import deepcopy import numpy as np import pandas as pd -import pickle -from copy import deepcopy from climateeconomics.glossarycore import GlossaryCore from scipy.interpolate import interp1d from scipy.optimize import minimize from sostrades_core.execution_engine.execution_engine import ExecutionEngine from sostrades_core.tools.bspline.bspline import BSpline from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import ( - InstanciatedSeries, - TwoAxesInstanciatedChart, + InstanciatedSeries, + TwoAxesInstanciatedChart, ) from energy_models.glossaryenergy import GlossaryEnergy diff --git a/data_energy/fitting/windpower.py b/data_energy/fitting/windpower.py index 196d9e0c..102cc573 100644 --- a/data_energy/fitting/windpower.py +++ b/data_energy/fitting/windpower.py @@ -14,28 +14,26 @@ limitations under the License. ''' import os -from functools import reduce import pickle +from copy import deepcopy +from functools import reduce + import numpy as np import pandas as pd -from copy import deepcopy from climateeconomics.glossarycore import GlossaryCore from scipy.interpolate import interp1d from scipy.optimize import minimize from sostrades_core.execution_engine.execution_engine import ExecutionEngine +from sostrades_core.tools.bspline.bspline import BSpline from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import ( InstanciatedSeries, TwoAxesInstanciatedChart, ) -from sostrades_core.tools.bspline.bspline import BSpline + +from energy_models.glossaryenergy import GlossaryEnergy from energy_models.models.electricity.wind_onshore.wind_onshore_disc import ( WindOnshoreDiscipline, ) -from energy_models.models.electricity.wind_offshore.wind_offshore_disc import ( - WindOffshoreDiscipline, -) -from energy_models.glossaryenergy import GlossaryEnergy - """ This script is used to calibrate the windpower invest so that the electricity production matches the IEA NZE scenario @@ -69,7 +67,7 @@ invest_year_start = 80. #G$ construction_delay = GlossaryEnergy.TechnoConstructionDelayDict['WindOffshore'] # same construction delay for windonshore and windoffshore if construction_delay != GlossaryEnergy.TechnoConstructionDelayDict['WindOnshore']: - raise ValueError(f"must adapt script as construction delay for windOnshore and windOffshore differ") + raise ValueError("must adapt script as construction delay for windOnshore and windOffshore differ") name = 'usecase_witness_optim_nze_eval' model_name_onshore = f"WITNESS_MDO.WITNESS_Eval.WITNESS.EnergyMix.electricity.{GlossaryEnergy.WindOnshore}"