Code Duplication    Length = 21-21 lines in 2 locations

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

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

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