From a8ea67497bf3887876ccfff870d0c89e4475f406 Mon Sep 17 00:00:00 2001 From: Malte Schwerhoff Date: Tue, 5 May 2020 14:35:49 +0200 Subject: [PATCH] Improved READMEs --- README.md | 12 +++++---- preprocessing/README.md | 55 +++++++---------------------------------- 2 files changed, 16 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 0d1955f..05b2603 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,10 @@ A collection for useful scripts for working with Moss in the context of ETH (eDo ## Installation -``` -$ pip install --upgrade git+https://gitlab.ethz.ch/scmalte/mossutils.git` +```shell +$ pip install --upgrade git+https://gitlab.ethz.ch/scmalte/mossutils.git +... +Successfully installed [...] mossutils [...] ``` Argument `--upgrade` (re)installs the package, even if the version number hasn't changed. @@ -14,11 +16,11 @@ Argument `--upgrade` (re)installs the package, even if the version number hasn't **TODO:** Add instructions for how to obtain and prepare the involved data. See also `preprocessing/README.md`. -1. Obtain and prepare data +1. Obtain and prepare data, see `preprocessing/README.md`. -1. Run `mu-moss --help` for arguments that can/must be configured. Afterwards, run `mu-moss` as desired. +1. Run `mu-moss --help` for arguments that can/must be configured. Afterwards, run `mu-moss` as desired, e.g. `mu-moss -u 1234 -n 300 "./ex1/*/main.cpp"`. - `mu-moss` connects to the Moss service, uploads submissions and downloads the generated report. + `mu-moss` connects to the Moss service, uploads submissions and downloads the generated report. This may take a while, and will probably not work for large `-n` values (3000 worked for me, 10,000 didn't). 1. Run `mu-revise`. diff --git a/preprocessing/README.md b/preprocessing/README.md index 6978b47..25d124f 100644 --- a/preprocessing/README.md +++ b/preprocessing/README.md @@ -2,25 +2,16 @@ ## Prerequisites -* Tested with Python 3.7 -* Script `run_-_moss.py` - * https://pypi.org/project/mosspy/ - * `pip install mosspy` * Script `rename_to_legi.sh`: * https://stedolan.github.io/jq/ * Download `jq` and add to path -* Script `visualize.py` - * https://github.com/hjalti/mossum - * `pip3 install git+https://github.com/hjalti/mossum@master` - * Replace `/Lib/site-packages/mossum/mossum.py` with `MODIFIED-mossum.py` - * http://networkx.github.io/ - * `pip install networkx` + * TODO: Re-implement shell script in Python ## Tidying up files and directories * `cx-dump_bonus-exercise-1_2020-04-17.zip` contains the latest submission from each user -* Execute next commands on the level of the user directories, e.g. in `./bonus_exercise_1`, so that, e.g. `./bonus_exercise_1/` are the individual user directories +* Execute commands on the level of the user directories, e.g. in `./bonus_exercise_1`, so that, e.g. `./bonus_exercise_1/` are the individual user directories * Assumption: relevant files per submission are `/details.json` and `/files/main.cpp`, whereas all other files and directories can be deleted: @@ -29,9 +20,9 @@ ```plain $ cd ./bonus_exercise_1 - $ find -type f ! \( -iname details.json -or -iname main.cpp \) -delete + $ find -type f ! \( -iname details.json -or -iname main.cpp \) -delete -print - $ find . -type d -iname cx_data -delete + $ find . -type d -iname cx_data -delete -print ``` * Move `/files/main.cpp` to `/main.cpp` and delete the (now empty) directory `/files`: @@ -39,11 +30,13 @@ ```plain $ cd ./bonus_exercise_1 - $ find . -type d -iname files -execdir mv ./files/main.cpp . \; + $ find . -type d -iname files -execdir mv ./files/main.cpp . \; -print - $ find . -type d -iname files -delete + $ find . -type d -iname files -delete -print ``` +* Now, each `` directory should only have two files in it: `/main.cpp` and `/details.json` + ## Renaming user directories * Rename directories from user names to Legi numbers before submitting data to Moss, e.g. rename `scmalte` to `01-234-567`. The file `/details.json` provides the Legi number. @@ -53,37 +46,7 @@ ```plain $ cd ./bonus_exercise_1 - $ ../rename_to_legi.sh + $ /rename_to_legi.sh ``` The script prompts for confirmation before the first renaming is executed. - -## Moss - -### moss.py - -* Edit `moss.py` and check configuration - -* Execute `moss.py` from e.g. `./bonus_exercise_1/`: - - ```plain - $ cd ./bonus_exercise_1/ - - $ python ../moss.py - ``` - -* If not configured otherwise, open `./bonus_exercise_1/moss-report.html` in your browser - -### clusters.py - -* Edit `clusters.py` and check configuration - -* Execute `clusters.py` from e.g. `./bonus_exercise_1/`: - - ```plain - $ cd ./bonus_exercise_1/ - - $ python ../clusters.py - ``` - -* If not configured otherwise, open `./bonus_exercise_1/clusters.html` in your browser -- GitLab