Skip to content

Feature/technical representation#26

Merged
FelixCAAuer merged 23 commits intomainfrom
feature/TechnicalRepresentation
Feb 26, 2026
Merged

Feature/technical representation#26
FelixCAAuer merged 23 commits intomainfrom
feature/TechnicalRepresentation

Conversation

@FelixCAAuer
Copy link
Contributor

No description provided.

Add method to CaseStudy to cluster it
Adjust to newest LEGO format
Add inplace flag
Improve computational performance (vectorized instead of iterrows)
Remove adjustment of VRESProfiles (is now dependent on g instead of i)
Fix filter_representative_periods for dataframes set to None
@FelixCAAuer FelixCAAuer self-assigned this Feb 25, 2026
Copilot AI review requested due to automatic review settings February 25, 2026 23:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements functionality for technical representation in power system modeling, focusing on:

  1. Security enhancement: Adds rich.markup.escape() to all printer methods to prevent markup injection vulnerabilities
  2. Refactoring: Splits the monolithic apply_kmedoids_aggregation function into three composable functions (get_kmedoids_representative_periods, apply_representative_periods, and apply_kmedoids_aggregation)
  3. SQLite enhancements: Adds automatic objective decomposition, dual values, solver statistics, and run parameters to SQLite output
  4. Bug fixes:
    • Corrects dPower_Demand index order from ['rp', 'i', 'k'] to ['rp', 'k', 'i']
    • Fixes 'long' to 'lon' for longitude column name
    • Improves merge_single_node_buses with zone name handling and better aggregation logic
  5. API improvements: Adds wrapper methods to CaseStudy class for kmedoids operations, improves copy() method, adds equal_to() comparison method
  6. New features:
    • Adds linear expression printing to Printer class
    • Adds validation for pEnableInvest values in Power_Network
    • Adds weight adjustment logic to filter_timesteps method
    • Removes unused xlrd dependency

Changes:

  • Enhanced security by escaping user input in printer methods
  • Refactored kmedoids aggregation into composable functions
  • Added comprehensive SQLite database export features (objective decomposition, dual values, solver stats)
  • Fixed multiple bugs in data handling and method return values

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
printer.py Added escape() for security, new linear_expression() method, pyomo import
environment.yml Removed unused xlrd dependency
Utilities.py Refactored kmedoids functions, fixed dPower_Demand index order
SQLiteWriter.py Added objective decomposition, dual values, solver statistics, and run parameters export
ExcelWriter.py Added TYPE_CHECKING import pattern to avoid circular imports
ExcelReader.py Added validation for pEnableInvest column values
CaseStudy.py Enhanced copy(), added equal_to(), fixed merge_single_node_buses, added kmedoids wrappers, improved filter_timesteps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Fix some output strings
Add printer to Utilities, add solver for kmedoids
@FelixCAAuer FelixCAAuer merged commit 5ca1140 into main Feb 26, 2026
1 check passed
@FelixCAAuer FelixCAAuer deleted the feature/TechnicalRepresentation branch February 26, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants