open-reaction-database / ord-schema

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

Quick input definition by string #456

Closed connorcoley closed 4 years ago

connorcoley commented 4 years ago

Fixes #444 and fixes #372

This adds a very simple parsing tool to "quick add" an input. Only two patterns are supported and they are quite rigid:

(1) [AMOUNT] of [NAME] (2) [AMOUNT] of [CONCENTRATION] [SOLUTE] in [SOLVENT]

Any thoughts on making it more flexible? I'll leave it to Steve if he wants to get fancy with regex. This is at least functional and does seem to add a bit of convenience.

codecov[bot] commented 4 years ago

Codecov Report

Merging #456 into main will increase coverage by 0.05%. The diff coverage is 71.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #456      +/-   ##
==========================================
+ Coverage   76.71%   76.76%   +0.05%     
==========================================
  Files          22       23       +1     
  Lines        2349     2393      +44     
  Branches      485      489       +4     
==========================================
+ Hits         1802     1837      +35     
- Misses        402      410       +8     
- Partials      145      146       +1     
Impacted Files Coverage Δ
ord_schema/units.py 90.47% <ø> (ø)
editor/py/serve.py 77.54% <30.76%> (-1.82%) :arrow_down:
ord_schema/resolvers.py 77.01% <77.01%> (ø)
ord_schema/updates.py 97.50% <100.00%> (+17.93%) :arrow_up:
ord_schema/message_helpers.py 83.46% <0.00%> (+0.78%) :arrow_up: