README.md 2.36 KB
Newer Older
scmalte's avatar
scmalte committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
# README

## 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 `<python3>/Lib/site-packages/mossum/mossum.py` with `MODIFIED-mossum.py`
  * http://networkx.github.io/
  * `pip install networkx`

## 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/<user>` are the individual user directories

* Assumption: relevant files per submission are `<user>/details.json` and `<user>/files/main.cpp`, whereas all other files and directories can be deleted:

* Delete irrelevant files, and directory `cx_data`:

  ```plain
  $ cd ./bonus_exercise_1

  $ find -type f ! \( -iname details.json -or -iname main.cpp \) -delete
  
  $ find . -type d -iname cx_data -delete
  ```

* Move `<user>/files/main.cpp` to `<user>/main.cpp` and delete the (now empty) directory `<user>/files`:

  ```plain
  $ cd ./bonus_exercise_1

  $ find . -type d -iname files -execdir mv ./files/main.cpp . \;

  $ find . -type d -iname files -delete
  ```

## 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 `<user>/details.json` provides the Legi number.

* Execute `rename_to_legi.sh` from e.g. `./bonus_exercise_1/`:

  ```plain
  $ cd ./bonus_exercise_1

  $ ../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