Closed mathpluscode closed 3 years ago
In the current code, we use relative imports such as https://github.com/DeepChainBio/bio-transformers/blob/main/biotransformers/esm_wrappers.py#L12
I believe the absolute imports are recommended.
In general, absolute imports are preferred over relative imports. https://chrisyeh96.github.io/2017/08/08/definitive-guide-python-imports.html#absolute-vs-relative-import
In general, absolute imports are preferred over relative imports.
https://chrisyeh96.github.io/2017/08/08/definitive-guide-python-imports.html#absolute-vs-relative-import
Thus, our package named bio-transformers, the source folder is biotransformers, we should import like
bio-transformers
biotransformers
from biotransformers.transformers_wrappers import ( NATURAL_AAS, TransformersInferenceConfig, TransformersModelProperties, TransformersWrapper, )
instead of
from .transformers_wrappers import ( NATURAL_AAS, TransformersInferenceConfig, TransformersModelProperties, TransformersWrapper, )
I think this is clearer? What do you think?
I think that we should follow the best practices, I saw a lot of my favorite package which are using relative import, but considering we are flexible, we will switch to absolute import
In the current code, we use relative imports such as https://github.com/DeepChainBio/bio-transformers/blob/main/biotransformers/esm_wrappers.py#L12
I believe the absolute imports are recommended.
Thus, our package named
bio-transformers
, the source folder isbiotransformers
, we should import likeinstead of
I think this is clearer? What do you think?