Skip to content

Commit 68e2b9d

Browse files
committed
Fix Dicey module import paths as a result of Python 3 migration
1 parent f6f0ab2 commit 68e2b9d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/primer-design/classes/Dicey.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
from typing import Any, Dict, List, Optional
1212

1313
# get the global root path from the Config object
14-
sys.path.append("..")
14+
sys.path.append(os.path.realpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "helpers")))
1515
from Config3 import Config
1616

1717

1818
class Dicey:
1919
"""
2020
Dicey is used to run in silico PCR on a pair of primers.
2121
"""
22-
def __init__(self, sequences: List[str], temperature: int, genome: str):
22+
def __init__(self, sequences: List[str], temperature: str, genome: str):
2323
assert len(sequences) == 2, "Exactly two primers required"
2424
self.config = Config()
2525
self.sequences = sequences
@@ -45,7 +45,7 @@ def command(self) -> List[str]:
4545
]
4646

4747

48-
def run(self) -> Optional[Dict[Any]]:
48+
def run(self) -> Optional[Dict[str, Any]]:
4949
# Dicey does not support using standard input, symlinks, or process substitution for its inputs
5050
with NamedTemporaryFile(mode="w", encoding="utf-8") as sequences:
5151
sequences.write(f">leftPrimer\n{self.sequences[0]}\n>rightPrimer\n{self.sequences[1]}\n")

src/primer-design/web/ajaxCalls/primerQA.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
# import external classes based on relative file location
1313
dir_path = os.path.dirname(os.path.abspath(__file__))
14-
sys.path.append(os.path.join(dir_path, '../../../helpers'))
15-
from Config import Config
1614
sys.path.append(os.path.join(dir_path,'../..'))
1715
from classes.Dicey import Dicey
1816

@@ -30,7 +28,7 @@ def main():
3028
genome = args.getvalue('genome')
3129

3230
if primers:
33-
primerQA = Dicey(primers, 50, genome)
31+
primerQA = Dicey(primers, '50', genome)
3432
result = primerQA.run()
3533
print(json.dumps(result))
3634
else:

0 commit comments

Comments
 (0)