Skip to content

Commit

Permalink
Merge branch 'develop' into integration
Browse files Browse the repository at this point in the history
  • Loading branch information
perrotcap committed Oct 25, 2024
2 parents 318dedc + f289d6d commit be4680c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,16 @@ def pimp_string(val: str):

new_chart_energy = TwoAxesInstanciatedChart(GlossaryEnergy.Years, 'Invest [G$]',
chart_name=chart_name, stacked_bar=True)

# max budget constraint charts
max_budget_df = self.get_sosdisc_inputs(GlossaryEnergy.MaxBudgetValue)
max_budget = max_budget_df[GlossaryEnergy.MaxBudgetValue].values
years = max_budget_df[GlossaryEnergy.Years].values
if max_budget.max() > 0:
serie_max_budget = InstanciatedSeries(list(years), list(max_budget), GlossaryEnergy.MaxBudgetValue,
'dash_lines')
new_chart_energy.add_series(serie_max_budget)

energy_list = self.get_sosdisc_inputs(GlossaryEnergy.energy_list)
ccs_list = self.get_sosdisc_inputs(GlossaryEnergy.ccs_list)

Expand Down Expand Up @@ -373,23 +383,6 @@ def pimp_string(val: str):

instanciated_charts.insert(1, new_chart_energy_ratio)

#max budget constraint charts
max_budget_df = self.get_sosdisc_inputs(GlossaryEnergy.MaxBudgetValue)
max_budget = max_budget_df[GlossaryEnergy.MaxBudgetValue].values
years = max_budget_df[GlossaryEnergy.Years].values
if max_budget.max() > 0 :

chart_max_budget = TwoAxesInstanciatedChart(GlossaryEnergy.Years, GlossaryEnergy.MaxBudgetDf['unit'],
chart_name=GlossaryEnergy.MaxBudgetConstraintValue, stacked_bar=True)

serie_max_budget = InstanciatedSeries(list(years), list(max_budget), GlossaryEnergy.MaxBudgetValue, 'dash_lines')
chart_max_budget.add_series(serie_max_budget)

energy_invests = self.get_sosdisc_outputs(GlossaryEnergy.EnergyInvestmentsWoTaxValue)[GlossaryEnergy.EnergyInvestmentsWoTaxValue].values * 1000
serie_invests = InstanciatedSeries(list(years), list(energy_invests), "Invests",
'bar')
chart_max_budget.add_series(serie_invests)
instanciated_charts.insert(1, chart_max_budget)


return instanciated_charts
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@ def make_dspace_utilisation_ratio(self) -> pd.DataFrame:

def make_func_df(self):
func_df = pd.DataFrame({
"variable": [GlossaryEnergy.CO2EmissionsObjectiveValue, GlossaryEnergy.CO2EmissionsObjectiveValue, GlossaryEnergy.TargetProductionConstraintValue, GlossaryEnergy.MaxBudgetConstraintValue,],
"variable": [GlossaryEnergy.ObjectiveEnergyNonUseCapital, GlossaryEnergy.CO2EmissionsObjectiveValue, GlossaryEnergy.TargetProductionConstraintValue, GlossaryEnergy.MaxBudgetConstraintValue,],
"parent": ["objectives", "objectives", "constraints", "constraints"],
"ftype": [FunctionManagerDisc.OBJECTIVE, FunctionManagerDisc.OBJECTIVE, FunctionManagerDisc.INEQ_CONSTRAINT, FunctionManagerDisc.INEQ_CONSTRAINT],
"weight": [1.0, .0, .0, 100.0,],
"weight": [1.0, 1.0, .0, 100.0,],
FunctionManagerDisc.AGGR_TYPE: [FunctionManager.AGGR_TYPE_SUM, FunctionManager.AGGR_TYPE_SUM, FunctionManager.INEQ_NEGATIVE_WHEN_SATIFIED_AND_SQUARE_IT, FunctionManager.INEQ_NEGATIVE_WHEN_SATIFIED_AND_SQUARE_IT,],
"namespace": [GlossaryEnergy.NS_FUNCTIONS] * 4
})
Expand Down

0 comments on commit be4680c

Please sign in to comment.