datamol-io / datamol

Molecular Processing Made Easy.
https://docs.datamol.io
Apache License 2.0
462 stars 48 forks source link

Fix bug in unique id #88

Closed maclandrol closed 2 years ago

maclandrol commented 2 years ago

Checklist:


PR to fix this bug essentially.

dm.unique_id("CCCCCCCC[*]") == dm.unique_id("C1CNNC1[*]") == dm.unique_id("") == 'd41d8cd98f00b204e9800998ecf8427e'

New behaviour returns None

Also fixed evaluation order on input. Conversion to dm.Mol is now performed before checking if None

codecov[bot] commented 2 years ago

Codecov Report

Merging #88 (34607c3) into main (f35f56c) will increase coverage by 0.13%. The diff coverage is 96.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
+ Coverage   82.09%   82.22%   +0.13%     
==========================================
  Files          45       45              
  Lines        3138     3150      +12     
==========================================
+ Hits         2576     2590      +14     
+ Misses        562      560       -2     
Flag Coverage Δ
unittests 82.22% <96.42%> (+0.13%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
datamol/convert.py 92.57% <96.42%> (+1.16%) :arrow_up:
datamol/mol.py 95.92% <0.00%> (+0.31%) :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 f35f56c...34607c3. Read the comment docs.

hadim commented 2 years ago

Thanks. I'll let you merge once green.

I'll bump once on main.