Code Duplication    Length = 9-9 lines in 2 locations

src/oemof/solph/flows/_simple_flow_block.py 2 locations

@@ 494-502 (lines=9) @@
491
                    )
492
493
            for i, o in self.LIFETIME_AGE_FLOWS:
494
                if valid_sequence(m.flows[i, o].fixed_costs, len(m.TIMESTEPS)):
495
                    range_limit = min(
496
                        m.es.end_year_of_optimization,
497
                        m.flows[i, o].lifetime - m.flows[i, o].age,
498
                    )
499
                    fixed_costs += sum(
500
                        m.flows[i, o].nominal_capacity
501
                        * m.flows[i, o].fixed_costs[pp]
502
                        for pp in range(range_limit)
503
                    )
504
505
        self.variable_costs = Expression(expr=variable_costs)
@@ 482-490 (lines=9) @@
479
480
            # Fixed costs for units with limited lifetime
481
            for i, o in self.LIFETIME_FLOWS:
482
                if valid_sequence(m.flows[i, o].fixed_costs, len(m.TIMESTEPS)):
483
                    range_limit = min(
484
                        m.es.end_year_of_optimization,
485
                        m.flows[i, o].lifetime,
486
                    )
487
                    fixed_costs += sum(
488
                        m.flows[i, o].nominal_capacity
489
                        * m.flows[i, o].fixed_costs[pp]
490
                        for pp in range(range_limit)
491
                    )
492
493
            for i, o in self.LIFETIME_AGE_FLOWS: