Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 173-193 (lines=21) @@
170
171
        dataset = config.settings()["egon-data"]["--dataset-boundary"]
172
173
        if dataset == "Schleswig-Holstein":
174
            sources_scn = config.datasets()["scenario_input"]["sources"]
175
176
            path = Path(
177
                f"./data_bundle_egon_data/nep2035_version2021/"
178
                f"{sources_scn['eGon2035']['capacities']}"
179
            ).resolve()
180
181
            total_2035 = (
182
                pd.read_excel(
183
                    path,
184
                    sheet_name="1.Entwurf_NEP2035_V2021",
185
                    index_col="Unnamed: 0",
186
                ).at["PV (Aufdach)", "Summe"]
187
                * 1000
188
            )
189
            sh_2035 = scenario_data(scenario="eGon2035").capacity.sum()
190
191
            share = sh_2035 / total_2035
192
193
            target *= share
194
195
        demand["share_country"] = demand.demand / demand.demand.sum()
196

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

@@ 772-792 (lines=21) @@
769
770
            dataset = config.settings()["egon-data"]["--dataset-boundary"]
771
772
            if dataset == "Schleswig-Holstein":
773
                sources = config.datasets()["scenario_input"]["sources"]
774
775
                path = Path(
776
                    f"./data_bundle_egon_data/nep2035_version2021/"
777
                    f"{sources['eGon2035']['capacities']}"
778
                ).resolve()
779
780
                total_2035 = (
781
                    pd.read_excel(
782
                        path,
783
                        sheet_name="1.Entwurf_NEP2035_V2021",
784
                        index_col="Unnamed: 0",
785
                    ).at["PV (Aufdach)", "Summe"]
786
                    * 1000
787
                )
788
                sh_2035 = scenario_data(scenario="eGon2035").capacity.sum()
789
790
                share = sh_2035 / total_2035
791
792
                target *= share
793
794
            assert isclose(
795
                target,