Skip to content
Snippets Groups Projects
Commit dd9095a1 authored by tuhe's avatar tuhe
Browse files

updates

parent afeeff3c
Branches
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ if __name__ == "__main__": ...@@ -8,7 +8,7 @@ if __name__ == "__main__":
bibtex = make_bibliography("../setup.py", "./") bibtex = make_bibliography("../setup.py", "./")
out = subprocess.check_output("python --version").decode("utf-8") out = subprocess.check_output("python --version").decode("utf-8")
fn = unitgrade_private.__path__[0] + "/../../examples/02631/instructor/week5/report1intro.py" fn = unitgrade_private.__path__[0] + "/../../examples/02631/instructor/week5/looping_tests.py"
out = subprocess.check_output(f"cd {os.path.dirname(fn)} && python {os.path.basename(fn)} --noprogress", shell=True, encoding='utf8', errors='strict') out = subprocess.check_output(f"cd {os.path.dirname(fn)} && python {os.path.basename(fn)} --noprogress", shell=True, encoding='utf8', errors='strict')
out = out.replace("", "") out = out.replace("", "")
......
...@@ -10,3 +10,4 @@ colorama ...@@ -10,3 +10,4 @@ colorama
numpy numpy
scikit_learn scikit_learn
snipper snipper
importnb # Experimental notebook inclusion feature. May not be required.
\ No newline at end of file
...@@ -251,6 +251,7 @@ class UTestCase(unittest.TestCase): ...@@ -251,6 +251,7 @@ class UTestCase(unittest.TestCase):
if "def" in lines2[j] or "class" in lines2[j]: if "def" in lines2[j] or "class" in lines2[j]:
break break
from snipper.legacy import gcoms from snipper.legacy import gcoms
fun = lines2[j] fun = lines2[j]
comments, _ = gcoms("\n".join(lines2[j:l])) comments, _ = gcoms("\n".join(lines2[j:l]))
if rel not in cc: if rel not in cc:
...@@ -479,7 +480,8 @@ class UTestCase(unittest.TestCase): ...@@ -479,7 +480,8 @@ class UTestCase(unittest.TestCase):
if self._cache_contains(key): if self._cache_contains(key):
CC = self._cache_get(key) CC = self._cache_get(key)
cl, m = self.cache_id() cl, m = self.cache_id()
gprint(f"> An error occured while solving: {cl}.{m}. The files/methods you need to edit are:") # For the test {id} in {file} you should edit:") # Insert newline to get better formatting.
gprint(f"\n> An error occured during the test: {cl}.{m}. The following files/methods has code in them you are supposed to edit and may therefore be the cause of the problem:")
for file in CC: for file in CC:
rec = CC[file] rec = CC[file]
gprint(f"> * {file}") gprint(f"> * {file}")
......
...@@ -13,7 +13,7 @@ _CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"]) ...@@ -13,7 +13,7 @@ _CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"])
def gprint(s): def gprint(s):
print(f"{Fore.GREEN}{s}") print(f"{Fore.LIGHTGREEN_EX}{s}")
myround = lambda x: np.round(x) # required for obfuscation. myround = lambda x: np.round(x) # required for obfuscation.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment