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

Updates to readme.md

parent cf305b49
No related branches found
No related tags found
No related merge requests found
Showing
with 68 additions and 40 deletions
...@@ -7,7 +7,6 @@ if __name__ == "__main__": ...@@ -7,7 +7,6 @@ if __name__ == "__main__":
from jinjafy.bibliography_maker import make_bibliography from jinjafy.bibliography_maker import make_bibliography
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_private2.__path__[0] + "/../../examples/02631/instructor/programs/report1intro.py" fn = unitgrade_private2.__path__[0] + "/../../examples/02631/instructor/programs/report1intro.py"
......
# Use this guide: # Use this guide:
# https://packaging.python.org/tutorials/packaging-projects/ # https://packaging.python.org/tutorials/packaging-projects/
# py -m build && twine upload dist/*
# from unitgrade2.version import __version__ # from unitgrade2.version import __version__
import setuptools import setuptools
with open("src/unitgrade2/version.py", "r", encoding="utf-8") as fh: with open("src/unitgrade2/version.py", "r", encoding="utf-8") as fh:
...@@ -10,6 +10,7 @@ with open("src/unitgrade2/version.py", "r", encoding="utf-8") as fh: ...@@ -10,6 +10,7 @@ with open("src/unitgrade2/version.py", "r", encoding="utf-8") as fh:
with open("README.md", "r", encoding="utf-8") as fh: with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read() long_description = fh.read()
setuptools.setup( setuptools.setup(
name="unitgrade", name="unitgrade",
version=__version__, version=__version__,
...@@ -31,5 +32,5 @@ setuptools.setup( ...@@ -31,5 +32,5 @@ setuptools.setup(
packages=setuptools.find_packages(where="src"), packages=setuptools.find_packages(where="src"),
python_requires=">=3.8", python_requires=">=3.8",
license="MIT", license="MIT",
install_requires=['numpy', 'tabulate', 'tqdm', "pyfiglet", "colorama", "coverage"], install_requires=['numpy', 'tabulate', "pyfiglet", "coverage", "colorama", 'tqdm'],
) )
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: unitgrade Name: unitgrade
Version: 0.0.3 Version: 0.1.1
Summary: A student homework/exam evaluation framework build on pythons unittest framework. Summary: A student homework/exam evaluation framework build on pythons unittest framework.
Home-page: https://lab.compute.dtu.dk/tuhe/unitgrade Home-page: https://lab.compute.dtu.dk/tuhe/unitgrade
Author: Tue Herlau Author: Tue Herlau
...@@ -66,7 +66,7 @@ The file `cs101report1.py` is just an ordinary, non-obfuscated file which they c ...@@ -66,7 +66,7 @@ The file `cs101report1.py` is just an ordinary, non-obfuscated file which they c
| | | |_ __ _| |_| | \/_ __ __ _ __| | ___ | | | |_ __ _| |_| | \/_ __ __ _ __| | ___
| | | | '_ \| | __| | __| '__/ _` |/ _` |/ _ \ | | | | '_ \| | __| | __| '__/ _` |/ _` |/ _ \
| |_| | | | | | |_| |_\ \ | | (_| | (_| | __/ | |_| | | | | | |_| |_\ \ | | (_| | (_| | __/
\___/|_| |_|_|\__|\____/_| \__,_|\__,_|\___| v0.0.2, started: 03/09/2021 21:18:46 \___/|_| |_|_|\__|\____/_| \__,_|\__,_|\___| v0.0.3, started: 07/09/2021 00:42:25
Week 4: Looping (use --help for options) Week 4: Looping (use --help for options)
Question 1: Test the cluster analysis method Question 1: Test the cluster analysis method
...@@ -99,7 +99,7 @@ Question 4: Test the fermentation rate question ...@@ -99,7 +99,7 @@ Question 4: Test the fermentation rate question
* q4.4) fermentationRate([20.1, 19.3, 1.1, 18.2, 19.7, ...], 18.2, 20) = 19.500 ?..................................PASS * q4.4) fermentationRate([20.1, 19.3, 1.1, 18.2, 19.7, ...], 18.2, 20) = 19.500 ?..................................PASS
* q4) Total.................................................................................................... 10/10 * q4) Total.................................................................................................... 10/10
Total points at 21:18:46 (0 minutes, 0 seconds)....................................................................40/40 Total points at 00:42:25 (0 minutes, 0 seconds)....................................................................40/40
Provisional evaluation Provisional evaluation
--------- ----- --------- -----
q1) Total 10/10 q1) Total 10/10
...@@ -125,6 +125,7 @@ This runs the same tests, and generates a file `Report0_handin_18_of_18.token`. ...@@ -125,6 +125,7 @@ This runs the same tests, and generates a file `Report0_handin_18_of_18.token`.
## Running the tests in pycharm ## Running the tests in pycharm
Naturally, you can also run the tests in pycharm, and this offers you a lot of cool features such as integration with the debugger and the ability to see which tests have failed. Naturally, you can also run the tests in pycharm, and this offers you a lot of cool features such as integration with the debugger and the ability to see which tests have failed.
To do this, simply right-click on the `report.py`-file and select `Run as unittest` (or alternatively, `debug as unittest`). This will take you to a screen such as shown below: To do this, simply right-click on the `report.py`-file and select `Run as unittest` (or alternatively, `debug as unittest`). This will take you to a screen such as shown below:
![Using unittests in pycharm](https://gitlab.compute.dtu.dk/tuhe/unitgrade/-/raw/master/docs/pycharm.png) ![Using unittests in pycharm](https://gitlab.compute.dtu.dk/tuhe/unitgrade/-/raw/master/docs/pycharm.png)
You can see all tests are green indicating they all pass. If you click on a test you can see the console output it generates and you can You can see all tests are green indicating they all pass. If you click on a test you can see the console output it generates and you can
...@@ -185,3 +186,16 @@ No. Unitgrade makes no changes outside the courseware directory and it does not ...@@ -185,3 +186,16 @@ No. Unitgrade makes no changes outside the courseware directory and it does not
Please contact me and we can discuss your specific concerns. Please contact me and we can discuss your specific concerns.
# Citing
```bibtex
@online{unitgrade,
title={Unitgrade (0.0.3): \texttt{pip install unitgrade}},
url={https://lab.compute.dtu.dk/tuhe/unitgrade},
urldate = {2021-09-07},
month={9},
publisher={Technical University of Denmark (DTU)},
author={Tue Herlau},
year={2021},
}
```
...@@ -2,6 +2,11 @@ LICENSE ...@@ -2,6 +2,11 @@ LICENSE
README.md README.md
pyproject.toml pyproject.toml
setup.py setup.py
src/unitgrade/__init__.py
src/unitgrade/unitgrade.py
src/unitgrade/unitgrade_grade.py
src/unitgrade/unitgrade_helpers.py
src/unitgrade/version.py
src/unitgrade.egg-info/PKG-INFO src/unitgrade.egg-info/PKG-INFO
src/unitgrade.egg-info/SOURCES.txt src/unitgrade.egg-info/SOURCES.txt
src/unitgrade.egg-info/dependency_links.txt src/unitgrade.egg-info/dependency_links.txt
......
numpy numpy
tabulate tabulate
tqdm
pyfiglet pyfiglet
colorama
coverage coverage
colorama
tqdm
unitgrade
unitgrade2 unitgrade2
File moved
File moved
File moved
File moved
File moved
import os import unitgrade2.version as __version__
from unitgrade2.unitgrade2 import myround, mfloor, msum, ActiveProgress
from unitgrade2.unitgrade2 import Capturing, Report, UTestCase, cache, hide
# DONT't import stuff here since install script requires __version__ from unitgrade2.unitgrade_helpers2 import evaluate_report_student
def cache_write(object, file_name, verbose=True):
import compress_pickle
dn = os.path.dirname(file_name)
if not os.path.exists(dn):
os.mkdir(dn)
if verbose: print("Writing cache...", file_name)
with open(file_name, 'wb', ) as f:
compress_pickle.dump(object, f, compression="lzma")
if verbose: print("Done!")
# import os
# import lzma
# import pickle
def cache_exists(file_name): # DONT't import stuff here since install script requires __version__
# file_name = cn_(file_name) if cache_prefix else file_name
return os.path.exists(file_name)
def cache_read(file_name): # def cache_write(object, file_name, verbose=True):
import compress_pickle # Import here because if you import in top the __version__ tag will fail. # # raise Exception("bad")
# file_name = cn_(file_name) if cache_prefix else file_name # # import compress_pickle
if os.path.exists(file_name): # dn = os.path.dirname(file_name)
try: # if not os.path.exists(dn):
with open(file_name, 'rb') as f: # os.mkdir(dn)
return compress_pickle.load(f, compression="lzma") # if verbose: print("Writing cache...", file_name)
except Exception as e: # with lzma.open(file_name, 'wb', ) as f:
print("Tried to load a bad pickle file at", file_name) # pickle.dump(object, f)
print("If the file appears to be automatically generated, you can try to delete it, otherwise download a new version") # if verbose: print("Done!")
print(e) #
#
# def cache_exists(file_name):
# # file_name = cn_(file_name) if cache_prefix else file_name
# return os.path.exists(file_name)
#
#
# def cache_read(file_name):
# # import compress_pickle # Import here because if you import in top the __version__ tag will fail.
# # file_name = cn_(file_name) if cache_prefix else file_name
# if os.path.exists(file_name):
# try:
# with lzma.open(file_name, 'rb') as f:
# return pickle.load(f) # return pickle.load(f)
else: # except Exception as e:
return None # print("Tried to load a bad pickle file at", file_name)
# print("If the file appears to be automatically generated, you can try to delete it, otherwise download a new version")
# print(e)
# # return pickle.load(f)
# else:
# return None
from unitgrade2.unitgrade2 import myround, mfloor, msum, Capturing, ActiveProgress
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment