Extract shared parsing utilities from DissociationConstantData
#10
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every annotation processor needs to do the same handful of things: pull CID and SID out of an
AnnotationEntry, extract the PCLID from a datum, get the string value fromStringWithMarkup, parse a temperature like"at 25 °C"or"(25 °C)", and build a DataFrame from a list ofTypedDictrows while handling the empty case. Right now, all of that lives as static methods onDissociationConstantData. Adding a second processor means copying them. Adding a third means copying them again.Scope
Create
pcdigitizer/data/base.py(orutils.py) and move these functions into it:extract_ids,extract_pclid,extract_string_value,parse_temperature, and optionally abuild_dataframehelper. RefactorDissociationConstantDatato import and use them.This is a pure refactor. No behavior changes, no new features. All existing tests must stay green.
Definition of done
Shared utilities extracted.
DissociationConstantDatarefactored to use them. All tests pass.