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

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