Skip to content

Commit

Permalink
merge post_integration to validation
Browse files Browse the repository at this point in the history
  • Loading branch information
b4pm-devops committed Jun 26, 2024
2 parents 0555286 + 87a8dba commit 08f5c25
Show file tree
Hide file tree
Showing 251 changed files with 858 additions and 1,171 deletions.
41 changes: 12 additions & 29 deletions energy_models/core/ccus/ccus_disc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
Copyright 2022 Airbus SAS
Modifications on 2023/06/14-2023/11/16 Copyright 2023 Capgemini
Modifications on 2023/06/14-2024/06/24 Copyright 2023 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -18,23 +18,23 @@

import numpy as np
import pandas as pd

from climateeconomics.core.core_witness.climateeco_discipline import (
ClimateEcoDiscipline,
)
from energy_models.core.ccus.ccus import CCUS
from energy_models.core.energy_mix.energy_mix import EnergyMix
from energy_models.core.stream_type.carbon_models.carbon_capture import CarbonCapture
from energy_models.core.stream_type.carbon_models.carbon_dioxyde import CO2
from energy_models.core.stream_type.carbon_models.carbon_storage import CarbonStorage
from energy_models.glossaryenergy import GlossaryEnergy
from sostrades_core.execution_engine.sos_wrapp import SoSWrapp
from sostrades_core.tools.post_processing.charts.chart_filter import ChartFilter
from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import (
InstanciatedSeries,
TwoAxesInstanciatedChart,
)

from energy_models.core.ccus.ccus import CCUS
from energy_models.core.energy_mix.energy_mix import EnergyMix
from energy_models.core.stream_type.carbon_models.carbon_capture import CarbonCapture
from energy_models.core.stream_type.carbon_models.carbon_dioxyde import CO2
from energy_models.core.stream_type.carbon_models.carbon_storage import CarbonStorage
from energy_models.glossaryenergy import GlossaryEnergy


class CCUS_Discipline(SoSWrapp):
# ontology information
Expand Down Expand Up @@ -74,22 +74,12 @@ class CCUS_Discipline(SoSWrapp):
'co2_emissions_needed_by_energy_mix': {'type': 'dataframe', 'unit': 'Gt',
'visibility': SoSWrapp.SHARED_VISIBILITY, 'namespace': 'ns_energy',
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
GlossaryEnergy.carbon_capture: ('float', None, True),
'CO2 from Flue Gas (Mt)': ('float', None, True),
GlossaryEnergy.carbon_storage: ('float', None, True),
'carbon_capture from energy mix (Gt)': (
'float', None, True),
'carbon_capture needed by energy mix (Gt)': (
'float', None, True),
'carbon_capture needed by energy mix (Gt)': ('float', None, True),
}, },
'carbon_capture_from_energy_mix': {'type': 'dataframe', 'unit': 'Gt',
'visibility': SoSWrapp.SHARED_VISIBILITY, 'namespace': 'ns_energy',
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
GlossaryEnergy.carbon_capture: ('float', None, True),
'CO2 from Flue Gas (Mt)': ('float', None, True),
GlossaryEnergy.carbon_storage: ('float', None, True),
'carbon_capture from energy mix (Gt)': (
'float', None, True), }, }
'carbon_capture from energy mix (Gt)': ('float', None, True), }, }
}

DESC_OUT = {
Expand Down Expand Up @@ -136,18 +126,11 @@ def setup_sos_disciplines(self):
dynamic_inputs[f'{ccs_name}.{GlossaryEnergy.EnergyProductionValue}'] = {
'type': 'dataframe', 'unit': 'PWh', 'visibility': SoSWrapp.SHARED_VISIBILITY,
'namespace': GlossaryEnergy.NS_CCS,
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
GlossaryEnergy.carbon_capture: ('float', None, True),
'CO2 from Flue Gas (Mt)': ('float', None, True),
GlossaryEnergy.carbon_storage: ('float', None, True), }}
'dynamic_dataframe_columns': True}
dynamic_inputs[f'{ccs_name}.{GlossaryEnergy.EnergyPricesValue}'] = {
'type': 'dataframe', 'unit': '$/MWh', 'visibility': SoSWrapp.SHARED_VISIBILITY,
'namespace': GlossaryEnergy.NS_CCS,
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
GlossaryEnergy.carbon_capture: ('float', None, True),
'carbon_capture_wotaxes': ('float', None, True),
GlossaryEnergy.carbon_storage: ('float', None, True),
'carbon_storage_wotaxes': ('float', None, True), }}
'dynamic_dataframe_columns': True}
dynamic_inputs[f'{ccs_name}.{GlossaryEnergy.LandUseRequiredValue}'] = {
'type': 'dataframe', 'unit': 'Gha', 'visibility': SoSWrapp.SHARED_VISIBILITY,
'namespace': GlossaryEnergy.NS_CCS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
Copyright 2022 Airbus SAS
Modifications on 2023/04/21-2023/11/16 Copyright 2023 Capgemini
Modifications on 2023/04/21-2024/06/24 Copyright 2023 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,26 +17,26 @@
import logging

import numpy as np

from climateeconomics.core.core_witness.climateeco_discipline import (
ClimateEcoDiscipline,
)
from climateeconomics.sos_wrapping.sos_wrapping_agriculture.agriculture.agriculture_mix_disc import (
AgricultureMixDiscipline,
)
from sostrades_core.execution_engine.sos_wrapp import SoSWrapp
from sostrades_core.tools.post_processing.charts.chart_filter import ChartFilter
from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import (
InstanciatedSeries,
TwoAxesInstanciatedChart,
)

from energy_models.core.ccus.ccus import CCUS
from energy_models.core.consumption_CO2_emissions.consumption_CO2_emissions import (
ConsumptionCO2Emissions,
)
from energy_models.core.energy_mix.energy_mix import EnergyMix
from energy_models.core.stream_type.energy_models.biomass_dry import BiomassDry
from energy_models.glossaryenergy import GlossaryEnergy
from sostrades_core.execution_engine.sos_wrapp import SoSWrapp
from sostrades_core.tools.post_processing.charts.chart_filter import ChartFilter
from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import (
InstanciatedSeries,
TwoAxesInstanciatedChart,
)


class ConsumptionCO2EmissionsDiscipline(SoSWrapp):
Expand Down Expand Up @@ -182,12 +182,7 @@ def setup_sos_disciplines(self):
'type': 'dataframe', 'unit': 'PWh',
'visibility': SoSWrapp.SHARED_VISIBILITY,
'namespace': GlossaryEnergy.NS_CCS,
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
GlossaryEnergy.carbon_capture: ('float', None, True),
GlossaryEnergy.carbon_storage: ('float', None, True),
'CO2 from Flue Gas (Mt)': ('float', None, True),

}
'dynamic_dataframe_columns': True
}

self.add_inputs(dynamic_inputs)
Expand Down
4 changes: 2 additions & 2 deletions energy_models/core/demand/energy_demand.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
Copyright 2022 Airbus SAS
Modifications on 2023/09/04-2023/11/16 Copyright 2023 Capgemini
Modifications on 2023/09/04-2024/06/24 Copyright 2023 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@

import numpy as np
import pandas as pd
from sostrades_core.tools.base_functions.s_curve import s_curve

from energy_models.core.energy_mix.energy_mix import EnergyMix
from energy_models.core.stream_type.energy_models.biodiesel import BioDiesel
Expand All @@ -28,7 +29,6 @@
from energy_models.core.stream_type.energy_models.liquid_hydrogen import LiquidHydrogen
from energy_models.core.stream_type.energy_models.methane import Methane
from energy_models.glossaryenergy import GlossaryEnergy
from sostrades_core.tools.base_functions.s_curve import s_curve


class EnergyDemand(object):
Expand Down
12 changes: 6 additions & 6 deletions energy_models/core/demand/energy_demand_disc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
Copyright 2022 Airbus SAS
Modifications on 2023/06/14-2023/11/09 Copyright 2023 Capgemini
Modifications on 2023/06/14-2024/06/24 Copyright 2023 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,21 +17,21 @@
import logging

import numpy as np

from climateeconomics.core.core_witness.climateeco_discipline import (
ClimateEcoDiscipline,
)
from energy_models.core.demand.energy_demand import EnergyDemand
from energy_models.core.energy_mix.energy_mix import EnergyMix
from energy_models.core.stream_type.energy_models.electricity import Electricity
from energy_models.glossaryenergy import GlossaryEnergy
from sostrades_core.execution_engine.sos_wrapp import SoSWrapp
from sostrades_core.tools.post_processing.charts.chart_filter import ChartFilter
from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import (
InstanciatedSeries,
TwoAxesInstanciatedChart,
)

from energy_models.core.demand.energy_demand import EnergyDemand
from energy_models.core.energy_mix.energy_mix import EnergyMix
from energy_models.core.stream_type.energy_models.electricity import Electricity
from energy_models.glossaryenergy import GlossaryEnergy


class EnergyDemandDiscipline(SoSWrapp):
# ontology information
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
Copyright 2022 Airbus SAS
Modifications on 2023/11/07-2023/11/09 Copyright 2023 Capgemini
Modifications on 2023/11/07-2024/06/24 Copyright 2023 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,12 +17,12 @@

import numpy as np
import pandas as pd

from climateeconomics.core.core_emissions.ghg_emissions_model import GHGEmissions
from climateeconomics.glossarycore import GlossaryCore
from climateeconomics.sos_wrapping.sos_wrapping_agriculture.agriculture.agriculture_mix_disc import (
AgricultureMixDiscipline,
)

from energy_models.core.stream_type.base_stream import BaseStream
from energy_models.core.stream_type.carbon_models.carbon import Carbon
from energy_models.core.stream_type.carbon_models.carbon_capture import CarbonCapture
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
Copyright 2022 Airbus SAS
Modifications on 2023/04/19-2023/11/16 Copyright 2023 Capgemini
Modifications on 2023/04/19-2024/06/24 Copyright 2023 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,6 @@
import logging

import numpy as np

from climateeconomics.core.core_emissions.ghg_emissions_model import GHGEmissions
from climateeconomics.core.core_witness.climateeco_discipline import (
ClimateEcoDiscipline,
Expand All @@ -29,19 +28,20 @@
from climateeconomics.sos_wrapping.sos_wrapping_emissions.ghgemissions.ghgemissions_discipline import (
GHGemissionsDiscipline,
)
from sostrades_core.execution_engine.sos_wrapp import SoSWrapp
from sostrades_core.tools.post_processing.charts.chart_filter import ChartFilter
from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import (
InstanciatedSeries,
TwoAxesInstanciatedChart,
)

from energy_models.core.ccus.ccus import CCUS
from energy_models.core.energy_ghg_emissions.energy_ghg_emissions import (
EnergyGHGEmissions,
)
from energy_models.core.energy_mix.energy_mix import EnergyMix
from energy_models.core.stream_type.energy_models.biomass_dry import BiomassDry
from energy_models.glossaryenergy import GlossaryEnergy
from sostrades_core.execution_engine.sos_wrapp import SoSWrapp
from sostrades_core.tools.post_processing.charts.chart_filter import ChartFilter
from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import (
InstanciatedSeries,
TwoAxesInstanciatedChart,
)


class EnergyGHGEmissionsDiscipline(SoSWrapp):
Expand Down Expand Up @@ -173,32 +173,25 @@ def setup_sos_disciplines(self):
'type': 'dataframe', 'unit': 'kg/kWh', 'namespace': GlossaryEnergy.NS_WITNESS,
'visibility': SoSWrapp.SHARED_VISIBILITY,
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
GlossaryEnergy.N2OPerUse: ('float', None, True),
GlossaryEnergy.CO2PerUse: ('float', None, True),
GlossaryEnergy.CH4PerUse: ('float', None, True), }}
GlossaryEnergy.GhGPerUse.format(ghg): ('float', None, True)}}
dynamic_inputs[f'{AgricultureMixDiscipline.name}.{GlossaryEnergy.EnergyConsumptionValue}'] = {
'type': 'dataframe', 'unit': 'PWh', 'namespace': GlossaryEnergy.NS_WITNESS,
'visibility': SoSWrapp.SHARED_VISIBILITY,
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
f'{GlossaryEnergy.electricity} (TWh)': ('float', None, True),
'CO2_resource (Mt)': ('float', None, True), }}
'dynamic_dataframe_columns': True}

dynamic_inputs[f'{AgricultureMixDiscipline.name}.{GlossaryEnergy.EnergyProductionValue}'] = {
'type': 'dataframe', 'unit': 'PWh', 'namespace': GlossaryEnergy.NS_WITNESS,
'visibility': SoSWrapp.SHARED_VISIBILITY,
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
GlossaryEnergy.biomass_dry: ('float', None, True),
'CO2_resource (Mt)': ('float', None, True), }}
GlossaryEnergy.biomass_dry: ('float', None, True)}}
else:
for ghg in GHGEmissions.GHG_TYPE_LIST:
dynamic_inputs[f'{energy}.{ghg}_per_use'] = {
'type': 'dataframe', 'unit': 'kg/kWh',
'visibility': SoSWrapp.SHARED_VISIBILITY,
'namespace': 'ns_energy',
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
GlossaryEnergy.N2OPerUse: ('float', None, True),
GlossaryEnergy.CO2PerUse: ('float', None, True),
GlossaryEnergy.CH4PerUse: ('float', None, True), }
GlossaryEnergy.GhGPerUse.format(ghg): ('float', None, True),}
}
dynamic_inputs[f'{energy}.{GlossaryEnergy.EnergyConsumptionValue}'] = {
'type': 'dataframe', 'unit': 'PWh',
Expand All @@ -220,11 +213,7 @@ def setup_sos_disciplines(self):
'type': 'dataframe', 'unit': 'PWh',
'visibility': SoSWrapp.SHARED_VISIBILITY,
'namespace': GlossaryEnergy.NS_CCS,
'dataframe_descriptor': {GlossaryEnergy.Years: ('float', None, True),
GlossaryEnergy.carbon_capture: ('float', None, True),
GlossaryEnergy.carbon_storage: ('float', None, True),
'CO2 from Flue Gas (Mt)': ('float', None, True),
}
'dynamic_dataframe_columns': True
}

self.add_inputs(dynamic_inputs)
Expand Down
8 changes: 4 additions & 4 deletions energy_models/core/energy_mix/energy_mix.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
Copyright 2022 Airbus SAS
Modifications on 2023/05/31-2023/11/16 Copyright 2023 Capgemini
Modifications on 2023/05/31-2024/06/24 Copyright 2023 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -19,10 +19,12 @@

import numpy as np
import pandas as pd

from climateeconomics.sos_wrapping.sos_wrapping_agriculture.agriculture.agriculture_mix_disc import (
AgricultureMixDiscipline,
)
from sostrades_core.tools.base_functions.exp_min import compute_func_with_exp_min
from sostrades_core.tools.cst_manager.func_manager_common import smooth_maximum

from energy_models.core.stream_type.base_stream import BaseStream
from energy_models.core.stream_type.carbon_models.carbon import Carbon
from energy_models.core.stream_type.carbon_models.carbon_capture import CarbonCapture
Expand Down Expand Up @@ -55,8 +57,6 @@
ResourceGlossary,
)
from energy_models.glossaryenergy import GlossaryEnergy
from sostrades_core.tools.base_functions.exp_min import compute_func_with_exp_min
from sostrades_core.tools.cst_manager.func_manager_common import smooth_maximum


class EnergyMix(BaseStream):
Expand Down
Loading

0 comments on commit 08f5c25

Please sign in to comment.