Import error
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
When importing any method from versalign.scoring before importing a method from either the aligner, msa, or pairwise modules will results in an ImportError:
Traceback (most recent call last):
File "/Users/davidmeijer/repos/CLM/./harvest/scripts/parse_retromol_results.py", line 14, in <module>
from versalign.scoring import create_substituion_matrix_dynamically
File "/Users/davidmeijer/miniforge3/envs/clm/lib/python3.10/site-packages/versalign/scoring.py", line 9, in <module>
from versalign.aligner import substitution_matrices
File "/Users/davidmeijer/miniforge3/envs/clm/lib/python3.10/site-packages/versalign/aligner.py", line 8, in <module>
from versalign.scoring import T
ImportError: cannot import name 'T' from partially initialized module 'versalign.scoring' (most likely due to a circular import) (/Users/davidmeijer/miniforge3/envs/clm/lib/python3.10/site-packages/versalign/scoring.py)
The issue can be mitigated by importing the scoring module after importing either aligner, msa, or pairwise module first. This will work, for example:
from versalign.aligner import setup_aligner
from versalign.scoring import create_substituion_matrix_dynamically
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the imports shown in versalign/scoring.py and versalign/aligner.py, then reproduce the failure by importing from versalign.scoring before the aligner, msa, or pairwise modules. The issue is done when scoring imports successfully without requiring another module to be imported first, and the documented import order is no longer needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- bioinformatics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100