Skip to content

Commit 5daff03

Browse files
committed
Fix paths
1 parent e43dcc0 commit 5daff03

File tree

9 files changed

+25
-24
lines changed

9 files changed

+25
-24
lines changed

config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import os
22

33
PROJECT_ROOT = os.path.dirname(__file__)
4-
OUTPUT_DIRECTORY_TOPLEVEL = os.path.join('./output')
5-
VECTOR_OUTPUT_DIRECTORY = './output/vectors'
4+
OUTPUT_DIRECTORY_TOPLEVEL = os.path.join('../output')
5+
VECTOR_OUTPUT_DIRECTORY = '../output/vectors'
66
DATA_FILES_DIR = os.path.join(PROJECT_ROOT, "output/data/")
77
ML_INPUTS_PATH = os.path.join(PROJECT_ROOT, "output/ml_inputs/")
88

@@ -15,11 +15,11 @@
1515
W2V_VEC_LENGTH = 14
1616
NUMBER_OF_TYPES = 1000
1717

18-
OUTPUT_EMBEDDINGS_DIRECTORY = './resources'
18+
OUTPUT_EMBEDDINGS_DIRECTORY = '.,/resources'
1919
W2V_MODEL_CODE_DIR = os.path.join(OUTPUT_EMBEDDINGS_DIRECTORY, 'w2v_code_model.bin')
2020
W2V_MODEL_LANGUAGE_DIR = os.path.join(OUTPUT_EMBEDDINGS_DIRECTORY, 'w2v_language_model.bin')
2121

22-
MODEL_DIR = "./output/models/"
22+
MODEL_DIR = ".,/output/models/"
2323
RETURN_DATAPOINTS_X = os.path.join(VECTOR_OUTPUT_DIRECTORY, "return_datapoints_x.npy")
2424
RETURN_DATAPOINTS_Y = os.path.join(VECTOR_OUTPUT_DIRECTORY, "return_datapoints_y.npy")
2525
PARAM_DATAPOINTS_X = os.path.join(VECTOR_OUTPUT_DIRECTORY, "param_datapoints_x.npy")

learning/learn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def load_m4():
310310

311311

312312
def get_datapoints(dataset: str) -> Tuple[str, str, str, str]:
313-
base = f"./input_datasets/{dataset}/vectors/"
313+
base = f"../input_datasets/{dataset}/vectors/"
314314
return base + "return_datapoints_x.npy", base + "return_datapoints_y.npy", base + "param_datapoints_x.npy", base + "param_datapoints_y.npy"
315315

316316

preprocessing/cloner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class Cloner:
7-
def clone(self, author: str, repo: str, destination: str = './projects') -> str:
7+
def clone(self, author: str, repo: str, destination: str = '../projects') -> str:
88
"""
99
Clone projects from GitHub
1010

preprocessing/nl_preprocessing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from functools import reduce
33
from typing import Optional
44

5-
from extractor import Function
5+
from preprocessing.extractor import Function
66
import re
77
import nltk
88

preprocessing/pipeline.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
import pandas as pd
99
from joblib import delayed
1010

11-
from cloner import Cloner
12-
from extractor import Extractor, ParseError
13-
from nl_preprocessing import NLPreprocessor
14-
from project_filter import ProjectFilter
15-
from utils import ParallelExecutor
11+
from preprocessing.cloner import Cloner
12+
from preprocessing.extractor import Extractor, ParseError
13+
from preprocessing.nl_preprocessing import NLPreprocessor
14+
from preprocessing.project_filter import ProjectFilter
15+
from preprocessing.utils import ParallelExecutor
1616

1717
cloner = Cloner()
1818
project_filter = ProjectFilter()

preprocessing/test_cloner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import os
22
import shutil
33
import unittest
4-
from cloner import Cloner
4+
from preprocessing.cloner import Cloner
55

66

77
class TestCloner(unittest.TestCase):
88
def test_cloning_a_repository(self) -> None:
99
"""
1010
Tests that we can actually clone a real repository.
1111
"""
12-
shutil.rmtree('./projects/requests__requests')
12+
# shutil.rmtree('../projects/requests__requests')
1313

1414
Cloner().clone('requests', 'requests')
1515

16-
self.assertTrue(os.path.isfile('./projects/requests__requests/README.md'))
16+
self.assertTrue(os.path.isfile('../projects/requests__requests/README.md'))
1717

1818

1919
if __name__ == '__main__':

preprocessing/test_extractor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from extractor import Extractor, Function
2+
from preprocessing.extractor import Extractor, Function
33

44

55
class TestExtractor(unittest.TestCase):
@@ -26,7 +26,7 @@ class TestExtractor(unittest.TestCase):
2626
}
2727

2828
def setUp(self):
29-
with open("./resources/example.py") as file:
29+
with open("./../resources/example.py") as file:
3030
program = file.read()
3131
self.fns = Extractor().extract(program)
3232

preprocessing/test_nl_preprocessing.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
2-
from extractor import Function
3-
from nl_preprocessing import NLPreprocessor
2+
from preprocessing.extractor import Function
3+
from preprocessing.nl_preprocessing import NLPreprocessor
44

55

66
class TestExtractor(unittest.TestCase):
@@ -114,13 +114,13 @@ def test_preprocessing_a_function_with_a_lot_of_punctuation_and_text(self):
114114

115115
self.assertEqual(Function(
116116
'validate clip with axis',
117-
'summary line. nd frame clip call via numpy library third parameter signature . take ndarray check axis '
118-
+ 'parameter instance ndarray. since axis either integer none param ndarray axis first parameter. param '
119-
+ 'list args second parameter. return description return value rtype bool',
117+
'summary line nd frame clip call via numpy library third parameter signature take ndarray check axis '
118+
+ 'parameter instance ndarray since axis either integer none param ndarray axis first parameter param '
119+
+ 'list args second parameter return description return value rtype bool',
120120
'summary line',
121121
['axis', 'args', 'kwargs'],
122122
['ndarray', 'list', 'list'],
123-
['the first parameter', 'the second parameter', ''],
123+
['first parameter', 'second parameter', ''],
124124
'ndarray',
125125
['axis'],
126126
'description return value'

preprocessing/test_project_filter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import unittest
22
import tempfile
33
from os import path
4-
from project_filter import ProjectFilter
4+
5+
from preprocessing.project_filter import ProjectFilter
56

67

78
class TestCloner(unittest.TestCase):

0 commit comments

Comments
 (0)