grimme-lab / mctc-lib

Modular computation tool chain library
https://grimme-lab.github.io/mctc-lib
Apache License 2.0
15 stars 17 forks source link

Improve error reporting for input readers #28

Closed awvwgk closed 2 years ago

awvwgk commented 2 years ago

Much improved error messages for users to make input errors easier to spot

Error: Cannot read charges
  --> struc.mol:29:23-25
   |
29 | M  CHG  3   1   1   3   b   2  -1
   |                       ^^^ expected integer value
   |
Error: Cannot read eht entry
  --> struc.coord:18:13-15
   |
18 | $eht charge=one unpaired=0
   |             ^^^ expected integer value
   |
Error: Impossible number of atoms provided
 --> struc.xyz:1:1-2
  |
1 | -3
  | ^^ expected positive integer value
  |
codecov[bot] commented 2 years ago

Codecov Report

Merging #28 (4b20258) into main (9c17afb) will increase coverage by 3.04%. The diff coverage is 83.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #28      +/-   ##
==========================================
+ Coverage   64.43%   67.48%   +3.04%     
==========================================
  Files          56       56              
  Lines        5281     6018     +737     
  Branches     1743     1866     +123     
==========================================
+ Hits         3403     4061     +658     
+ Misses        678      670       -8     
- Partials     1200     1287      +87     
Impacted Files Coverage Δ
src/mctc/io/utils.f90 55.47% <35.71%> (-4.71%) :arrow_down:
src/mctc/io/read/xyz.f90 64.91% <57.14%> (ø)
src/mctc/io/read/turbomole.f90 76.71% <68.57%> (-1.71%) :arrow_down:
src/mctc/io/read/ctfile.f90 73.50% <71.66%> (+9.50%) :arrow_up:
src/mctc/io/read/gaussian.f90 68.85% <71.79%> (+35.51%) :arrow_up:
src/mctc/io/read/aims.f90 58.90% <77.77%> (+0.57%) :arrow_up:
src/mctc/io/read/pdb.f90 78.94% <85.71%> (+21.50%) :arrow_up:
test/test_read_gaussian.f90 81.81% <87.50%> (+15.15%) :arrow_up:
test/test_read_turbomole.f90 81.28% <89.50%> (+3.70%) :arrow_up:
test/test_read_ctfile.f90 86.43% <95.12%> (+1.64%) :arrow_up:
... and 7 more

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 9c17afb...4b20258. Read the comment docs.