IAMconsortium / pyam

Analysis & visualization of energy & climate scenarios
https://pyam-iamc.readthedocs.io/
Apache License 2.0
221 stars 115 forks source link

Validation for illegal column names in `data` #734

Closed danielhuppmann closed 1 year ago

danielhuppmann commented 1 year ago

Please confirm that this PR has done the following:

Description of PR

During review of #729, I noticed that there may be issues when initializing an IamDataFrame with an unnamed column (None or empty string) - both could give unexpected behavior. This PR adds these two corner cases to the validation routine.

codecov[bot] commented 1 year ago

Codecov Report

Merging #734 (7318209) into main (e07d3b9) will increase coverage by 0.0%. The diff coverage is 98.2%.

@@          Coverage Diff          @@
##            main    #734   +/-   ##
=====================================
  Coverage   95.0%   95.1%           
=====================================
  Files         59      59           
  Lines       6020    6044   +24     
=====================================
+ Hits        5725    5748   +23     
- Misses       295     296    +1     
Impacted Files Coverage Δ
pyam/utils.py 92.7% <97.8%> (+0.1%) :arrow_up:
tests/test_core.py 100.0% <100.0%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.