Code Duplication    Length = 21-21 lines in 2 locations

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,

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

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