There was a circular import die to the family of XYZMapper classes that import ProteinRecord. Due to the sdRDM action pulling imports from all-over the code to the top, the circular dependency cannot be resolved by leaving the import within the method in ProteinRecord.
This PR inverts the problem and pulls the ProteinRecord into the XYZMapper class methods. For type annotations that are using ProteinRecord the TYPE_CHECKING pattern has been employed to preserve type checking while not inducing circular imports. I have also added a test to check circular dependencies.
I would advise you to pull out any higher logic from the core module to prevent this from happening.
I have changed the psycopg2 dependency to psycopg2-binary since the former requires external binaries, often leading to problems upon installing the library. I hate this 😵
There was a circular import die to the family of
XYZMapper
classes that importProteinRecord
. Due to the sdRDM action pulling imports from all-over the code to the top, the circular dependency cannot be resolved by leaving the import within the method inProteinRecord
.This PR inverts the problem and pulls the
ProteinRecord
into theXYZMapper
class methods. For type annotations that are usingProteinRecord
theTYPE_CHECKING
pattern has been employed to preserve type checking while not inducing circular imports. I have also added a test to check circular dependencies.I would advise you to pull out any higher logic from the
core
module to prevent this from happening.