kienerj / pycdxml

Tools to automatically convert and proccess cdx and cdxml files in python
GNU General Public License v3.0
35 stars 5 forks source link

ValueError from CDXPositioningType when reading some CDX files #31

Closed rytheranderson closed 1 year ago

rytheranderson commented 1 year ago

When reading certain CDX files I get a ValueError from CDXPositioningType, here: https://github.com/kienerj/pycdxml/blob/6e1cddb49fc7f2267ed3f61607099922703e9b7d/pycdxml/cdxml_converter/chemdraw_types.py#L1968 The from_bytes method is expecting two bytes, but it seems only one is passed for some files. I'm not sure yet why, but I have attached an example CDX (zip archive) from ChemDraw21. I will add details as I continue to investigate. What I can say now is it seems to only happen for certain styles and when enhanced stereochemistry annotations are present.

kienerj commented 1 year ago

Thanks for reporting. Indeed this is an actual bug and I should accept input with 1 byte (it's an enum represented by an int8).

fixed by 0e33c97fd918be84b8e23e9d1a20cedc23770cda

rytheranderson commented 1 year ago

Thanks!