Import error
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- bioinformatics
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.
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
- Dominant language
- Python
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
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.
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100