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

Additional error handling for ctfiles in non-V2000 format #31

Closed awvwgk closed 2 years ago

awvwgk commented 2 years ago

Reject V3000 ctfiles, which we currently cannot parse.

Example:

Error: Format version not supported
 --> bug566.mol:4:35-39
  |
4 |   0  0  0  0  0  0  0  0  0  0999 V3000
  |                                   ^^^^^ invalid format version
  |
Compound 11
     RDKit          3D

  0  0  0  0  0  0  0  0  0  0999 V3000
M  V30 BEGIN CTAB
M  V30 COUNTS 17 16 0 0 0
M  V30 BEGIN ATOM
M  V30 1 O -2.821131 -0.276238 -0.753131 0
M  V30 2 C -2.076407 0.000289 0.175864 0
M  V30 3 O -2.469860 0.872693 1.126516 0
M  V30 4 C -0.648307 -0.508439 0.384207 0 CFG=1
M  V30 5 N -0.553725 -1.908221 -0.092137 0
M  V30 6 C 0.306640 0.448659 -0.352110 0
M  V30 7 C 1.764852 0.167437 -0.097096 0
M  V30 8 C 2.575104 0.984442 0.587951 0
M  V30 9 H -3.391314 1.091514 0.873612 0
M  V30 10 H -0.438887 -0.513473 1.460318 0
M  V30 11 H 0.421206 -2.197466 -0.111774 0
M  V30 12 H -0.893195 -1.946576 -1.055443 0
M  V30 13 H 0.073377 1.483235 -0.066299 0
M  V30 14 H 0.129860 0.396798 -1.434760 0
M  V30 15 H 2.179323 -0.745345 -0.519251 0
M  V30 16 H 2.219589 1.914253 1.021797 0
M  V30 17 H 3.622875 0.736438 0.730780 0
M  V30 END ATOM
M  V30 BEGIN BOND
M  V30 1 2 1 2
M  V30 2 1 2 3
M  V30 3 1 4 2
M  V30 4 1 4 5
M  V30 5 1 4 6
M  V30 6 1 6 7
M  V30 7 2 7 8 CFG=2
M  V30 8 1 3 9
M  V30 9 1 4 10 CFG=1
M  V30 10 1 5 11
M  V30 11 1 5 12
M  V30 12 1 6 13
M  V30 13 1 6 14
M  V30 14 1 7 15
M  V30 15 1 8 16
M  V30 16 1 8 17
M  V30 END BOND
M  V30 BEGIN COLLECTION
M  V30 MDLV30/STERAC1 ATOMS=(1 4)
M  V30 END COLLECTION
M  V30 END CTAB
M  END
codecov[bot] commented 2 years ago

Codecov Report

Merging #31 (4f8af6e) into main (9e2ebec) will increase coverage by 0.37%. The diff coverage is 92.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
+ Coverage   67.47%   67.85%   +0.37%     
==========================================
  Files          56       56              
  Lines        6020     6112      +92     
  Branches     1867     1877      +10     
==========================================
+ Hits         4062     4147      +85     
  Misses        670      670              
- Partials     1288     1295       +7     
Impacted Files Coverage Δ
src/mctc/io/read/ctfile.f90 73.22% <70.00%> (-0.28%) :arrow_down:
test/test_read_ctfile.f90 87.62% <95.12%> (+1.19%) :arrow_up:

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 9e2ebec...4f8af6e. Read the comment docs.