Skip to content

Refactor etrago/tools/constraints.py #862

Description

@KathiEsterl

etrago/tools/constraints.py has grown into a very large script combining multiple concerns in a single file. It currently contains constraint definitions for both Linopy and Pyomo, as well as logic related to optimization setup and execution.

The current structure also makes it difficult to identify the different responsibilities within the module and to navigate the code.

Possible refactoring ideas (to be discussed):

  • Remove legacy constraints that are no longer needed, or move them into a separate module.
  • Split constraint implementations by functionality and/or optimization backend (e.g. Linopy vs. Pyomo where appropriate).
  • Introduce a central function or mechanism that handles the registration and execution of optimization constraints.

The goal would be to improve maintainability, readability, and extensibility of the optimization framework.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions