Skip to content

Conversation

@FelixCAAuer
Copy link
Contributor

Add safety catch in compare excels if color property of cell is None

Add safety catch in compare excels if color property of cell is None
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 PR adds a new NREL-118 data reader module and fixes a None-safety issue in the Excel comparison utility. The new nrel118-reader.py module provides functions to read power inflow and VRES profile data from NREL-118 source files and convert them to the LEGO data format. The ExcelReader fix prevents AttributeError exceptions when comparing Excel files with cells that have None color properties.

  • Adds reader functions for NREL-118 power inflows and VRES profiles
  • Implements safety checks for None color properties in Excel cell comparison
  • Includes data validation and clipping options for VRES profiles

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
nrel118-reader.py New module with two reader functions to convert NREL-118 hydro inflow and VRES profile data to LEGO format
ExcelReader.py Adds None checks to prevent AttributeError when comparing Excel cell colors
Comments suppressed due to low confidence (2)

nrel118-reader.py:1

  • The condition on line 508 will raise AttributeError if target_cell.font.color is None, since getattr cannot be called on None. The condition should be: (target_cell.font.color is not None and v2 != getattr(target_cell.font.color, k2)).
import os

nrel118-reader.py:1

  • The condition on line 521 will raise AttributeError if target_cell.fill.color is None, since getattr cannot be called on None. The condition should be: (target_cell.fill.color is not None and v2 != getattr(target_cell.fill.color, k2)).
import os

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

@FelixCAAuer FelixCAAuer merged commit bc2d23f into main Nov 19, 2025
6 of 7 checks passed
@FelixCAAuer FelixCAAuer deleted the feature/NREL-118Update branch November 19, 2025 15:52
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