open-reaction-database / ord-schema

Schema for the Open Reaction Database
https://open-reaction-database.org
Apache License 2.0
92 stars 26 forks source link

Fix enumeration issue when amount is undefined in template #679

Closed connorcoley closed 1 year ago

connorcoley commented 1 year ago

Fixes a bug where a reaction template with undefined amounts was leading to an uninformative type error. Note: templated reactions with amounts won't pass the validation checks, but should work with the script when using --no-validate

We may also want to expand the logic for checking empty definitions to remove products where product SMILES are not defined, as currently we only check for inputs in terms of identifiers/amounts

codecov[bot] commented 1 year ago

Codecov Report

Merging #679 (c4ea817) into main (e3dd467) will increase coverage by 0.02%. The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #679      +/-   ##
==========================================
+ Coverage   69.59%   69.62%   +0.02%     
==========================================
  Files          23       23              
  Lines        2276     2278       +2     
  Branches      567      568       +1     
==========================================
+ Hits         1584     1586       +2     
  Misses        586      586              
  Partials      106      106              
Impacted Files Coverage Δ
ord_schema/orm/database.py 92.18% <ø> (ø)
ord_schema/scripts/parse_uspto.py 0.00% <ø> (ø)
ord_schema/validations.py 70.62% <ø> (-0.06%) :arrow_down:
ord_schema/orm/mappers.py 95.62% <33.33%> (ø)
ord_schema/__init__.py 100.00% <100.00%> (ø)
ord_schema/orm/rdkit_mappers.py 92.07% <100.00%> (ø)
ord_schema/scripts/enumerate_dataset.py 87.50% <100.00%> (ø)
ord_schema/templating.py 95.16% <100.00%> (+0.24%) :arrow_up: