Code Duplication    Length = 21-21 lines in 2 locations

src/egon/data/datasets/power_plants/pv_rooftop.py 1 location

@@ 163-183 (lines=21) @@
160
161
        dataset = config.settings()["egon-data"]["--dataset-boundary"]
162
163
        if dataset == "Schleswig-Holstein":
164
            sources_scn = config.datasets()["scenario_input"]["sources"]
165
166
            path = Path(
167
                f"./data_bundle_egon_data/nep2035_version2021/"
168
                f"{sources_scn['eGon2035']['capacities']}"
169
            ).resolve()
170
171
            total_2035 = (
172
                pd.read_excel(
173
                    path,
174
                    sheet_name="1.Entwurf_NEP2035_V2021",
175
                    index_col="Unnamed: 0",
176
                ).at["PV (Aufdach)", "Summe"]
177
                * 1000
178
            )
179
            sh_2035 = scenario_data(scenario="eGon2035").capacity.sum()
180
181
            share = sh_2035 / total_2035
182
183
            target *= share
184
185
        demand["share_country"] = demand.demand / demand.demand.sum()
186

src/egon/data/datasets/sanity_checks.py 1 location

@@ 789-809 (lines=21) @@
786
787
            dataset = config.settings()["egon-data"]["--dataset-boundary"]
788
789
            if dataset == "Schleswig-Holstein":
790
                sources = config.datasets()["scenario_input"]["sources"]
791
792
                path = Path(
793
                    f"./data_bundle_egon_data/nep2035_version2021/"
794
                    f"{sources['eGon2035']['capacities']}"
795
                ).resolve()
796
797
                total_2035 = (
798
                    pd.read_excel(
799
                        path,
800
                        sheet_name="1.Entwurf_NEP2035_V2021",
801
                        index_col="Unnamed: 0",
802
                    ).at["PV (Aufdach)", "Summe"]
803
                    * 1000
804
                )
805
                sh_2035 = scenario_data(scenario="eGon2035").capacity.sum()
806
807
                share = sh_2035 / total_2035
808
809
                target *= share
810
811
            assert isclose(
812
                target,