rdkit / mmpdb

A package to identify matched molecular pairs and use them to predict property changes.
Other
197 stars 55 forks source link

[WIP] Fragdb proposal #39

Closed adalke closed 6 months ago

adalke commented 2 years ago

This is a work-in-progress to replace the JSON-Lines fragment file with SQLite-based file.

For full details see https://github.com/rdkit/mmpdb/issues/37 .

The current code needs another cleanup pass.

I will first investigate if using SQLAlchemy simplifies the tedious manual ORM of this work-in-progress.

adalke commented 2 years ago

Just switched the implementation over to use dataclasses instead of the manual class definitions using __slots__, __init__ and __repr__.

After tuning, the overall performance is the same as the hand-written code.

I also cleaned up the SQL code to make better use of the dataclass information, which helps reduce the amount of typing to convert SQL column names to local variable names to class instance names.