Skip to content

baseline

Classes:

Name Description
Baseline

Adding up option

dscim.menu.baseline.Baseline

Bases: MainRecipe

Adding up option

Methods:

Name Description
global_consumption_calculation

Calculate global consumption

global_damages_calculation

Call global damages

Source code in src/dscim/menu/baseline.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class Baseline(MainRecipe):
    """Adding up option"""

    NAME = "adding_up"
    __doc__ = MainRecipe.__doc__

    def ce_cc(self):
        pass

    def ce_no_cc(self):
        pass

    def global_damages_calculation(self):
        """Call global damages"""
        return self.adding_up_damages.to_dataframe("damages").reset_index()

    def calculated_damages(self):
        pass

    def ce_cc_calculation(self):
        pass

    def ce_test(self):
        pass

    def ce_no_cc_calculation(self):
        pass

    def global_consumption_calculation(self, disc_type):
        """Calculate global consumption"""

        if (disc_type == "constant") or ("ramsey" in disc_type):
            global_cons_no_cc = self.gdp.sum(dim=["region"])

        elif disc_type == "constant_model_collapsed":
            global_cons_no_cc = self.gdp.sum(dim=["region"]).mean(dim=["model"])

        elif "gwr" in disc_type:
            global_cons_no_cc = self.gdp.sum(dim=["region"]).mean(dim=["model", "ssp"])

        global_cons_no_cc.name = f"global_cons_{disc_type}"

        return global_cons_no_cc

dscim.menu.baseline.Baseline.global_consumption_calculation

global_consumption_calculation(disc_type)

Calculate global consumption

Source code in src/dscim/menu/baseline.py
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def global_consumption_calculation(self, disc_type):
    """Calculate global consumption"""

    if (disc_type == "constant") or ("ramsey" in disc_type):
        global_cons_no_cc = self.gdp.sum(dim=["region"])

    elif disc_type == "constant_model_collapsed":
        global_cons_no_cc = self.gdp.sum(dim=["region"]).mean(dim=["model"])

    elif "gwr" in disc_type:
        global_cons_no_cc = self.gdp.sum(dim=["region"]).mean(dim=["model", "ssp"])

    global_cons_no_cc.name = f"global_cons_{disc_type}"

    return global_cons_no_cc

dscim.menu.baseline.Baseline.global_damages_calculation

global_damages_calculation()

Call global damages

Source code in src/dscim/menu/baseline.py
16
17
18
def global_damages_calculation(self):
    """Call global damages"""
    return self.adding_up_damages.to_dataframe("damages").reset_index()