IAMconsortium / pyam

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

Feature/pyam error improvement #589

Closed phackstock closed 3 years ago

phackstock commented 3 years ago

Please confirm that this PR has done the following:

Description of PR

This PR addresses closes #588. In pyam/utils.py in format_data the casting to float now uses pd.to_numeric instead of pd.DataFrame.astype("float"). The advantage is that to_numeric gives the exact row number where the error occurred making it easier for the user to fix. The error is reported using raise_data_error and gives the combination of model, scenario, region, variable, unit and year where the error originated.

codecov[bot] commented 3 years ago

Codecov Report

Merging #589 (281610f) into main (5a0dd96) will increase coverage by 0.0%. The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #589   +/-   ##
=====================================
  Coverage   94.1%   94.2%           
=====================================
  Files         50      50           
  Lines       5318    5331   +13     
=====================================
+ Hits        5009    5022   +13     
  Misses       309     309           
Impacted Files Coverage Δ
pyam/utils.py 91.8% <100.0%> (+0.1%) :arrow_up:
tests/test_core.py 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5a0dd96...281610f. Read the comment docs.