From 1cf21ffe63e85c28fa21f8d78e051f304aeb553e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Mar 2024 18:30:15 +0100 Subject: [PATCH] docs: updated docs to reflect new cli path --- scripts/extract-all-stats.sh | 3 +-- scripts/extract-top-stats.sh | 3 +-- wiki/Overview.md | 18 ++++++++++-------- wiki/Setup.md | 2 +- wiki/Thesis.md | 6 ++++-- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/scripts/extract-all-stats.sh b/scripts/extract-all-stats.sh index 7c6d761d75..a906388d36 100755 --- a/scripts/extract-all-stats.sh +++ b/scripts/extract-all-stats.sh @@ -27,8 +27,7 @@ for ((i = 0; i < ${#CONTAINED[@]}; i += size)); do mkdir -p "${dirBasis}/${chunkNumber}/" # shellcheck disable=SC2068 - npm run stats -- ${chunk[@]} --output-dir "${dirBasis}/${chunkNumber}/" > "${dirBasis}/${chunkNumber}/full.log" 2>&1 & + npm run stats --prefix ../cli -- ${chunk[@]} --output-dir "${dirBasis}/${chunkNumber}/" > "${dirBasis}/${chunkNumber}/full.log" 2>&1 & # printf '%s\n' "${chunk[@]}" done - diff --git a/scripts/extract-top-stats.sh b/scripts/extract-top-stats.sh index d312d925bc..01410a33f0 100755 --- a/scripts/extract-top-stats.sh +++ b/scripts/extract-top-stats.sh @@ -15,5 +15,4 @@ done DIR="./statistics-out/top-$(date +%Y-%m-%d-%H-%M-%S)/" mkdir -p "${DIR}" -npm run stats -- "${arr[@]}" --output-dir "${DIR}" |& tee -a "./full.log" - +npm run stats --prefix ../cli -- "${arr[@]}" --output-dir "${DIR}" |& tee -a "./full.log" diff --git a/wiki/Overview.md b/wiki/Overview.md index 15ea3432fe..eb6aeaeaec 100644 --- a/wiki/Overview.md +++ b/wiki/Overview.md @@ -141,7 +141,7 @@ To generate a slice you need to provide two things: 1. A [slicing criterion](https://github.com/Code-Inspect/flowr/wiki/Terminology#slicing-criterion): the location of a single variable or several variables of interest to slice for, like "`12@product`" 2. The path to an R file that should be sliced. -For example, you can run +For example, from the `cli` directory, you can run ```shell npm run slicer -- --criterion "12@product" "test/testfiles/example.R" @@ -150,7 +150,7 @@ npm run slicer -- --criterion "12@product" "test/testfiles/example.R" This slices for the first use of the variable `product` in line 12 of the source file at `test/testfiles/example.R` (see the [slicing criterion](https://github.com/Code-Inspect/flowr/wiki/Terminology#slicing-criterion) definition for more information). By default, the resulting slice is output to the standard output. -For more options see, +For more options, run the following from the `cli` directory: ```shell npm run slicer -- --help @@ -172,13 +172,13 @@ Within the original [thesis](https://github.com/Code-Inspect/flowr/wiki/Thesis), The corresponding *benchmark* script ultimately allows to do the same thing as the *slicing* script, but 1) parallel for many files and 2) for a wider selection of slicing points. By default, it starts by collecting all variables in a script, producing a slice for each of them. -For example, to run the benchmark on 500 randomly picked files of the folder `` using 8 threads and writing the output to ``, you can use: +For example, to run the benchmark on 500 randomly picked files of the folder `` using 8 threads and writing the output to ``, you can run this from the `cli` directory: ```shell npm run benchmark -- --limit 500 --parallel 8 --output "" "" ``` -For more options see, +For more options, run the following from the `cli` directory: ```shell npm run benchmark -- --help @@ -187,7 +187,7 @@ npm run benchmark -- --help #### Summarizing the Benchmark Results The resulting JSON file can be rather larger (starting off with a couple of hundred megabytes). Therefore, you probably want to summarize the results of the benchmark. -For this, you can make use of the *summarizer* script like this: +For this, you can make use of the *summarizer* script from within the `cli` directory like this: ```shell npm run summarizer -- "" @@ -200,7 +200,7 @@ Please note that the summarizer may require a long time as it parses, normalizes As the ultimate summary is much quicker, you can re-run it by specifically adding the `--ultimate-only` flag (although this is only really of use if you modify what should be summarized within the source code of *flowR*). -For more options see, +For more options, run the following from the `cli` directory: ```shell npm run summarizer -- --help @@ -210,7 +210,7 @@ npm run summarizer -- --help If you want to reproduce the statistics as presented in my [master's thesis](http://dx.doi.org/10.18725/OPARU-50107), see the corresponding [wiki page](https://github.com/Code-Inspect/flowr/wiki/Thesis#how-to-reproduce-the-statistics-from-the-masters-thesis). -See +For more information, run the following from the `cli` directory: ```shell npm run stats -- --help @@ -218,7 +218,9 @@ npm run stats -- --help ### Export RDF N-Quads -If you know what the RDF N-Quads refer to, then you are good to go! If not, you do not have to worry - you probably do not need them (they are for a graph search that is based on *flowR*). See the following for more information: +If you know what the RDF N-Quads refer to, then you are good to go! If not, you do not have to worry - you probably do not need them (they are for a graph search that is based on *flowR*). + +For more information, run the following from the `cli` directory: ```shell npm run export-quads -- --help diff --git a/wiki/Setup.md b/wiki/Setup.md index 30f2ae799d..9623e892b7 100644 --- a/wiki/Setup.md +++ b/wiki/Setup.md @@ -44,7 +44,7 @@ After cloning the repository,<2> npm i ``` -After that, you should be fine! You may test *flowR* by running: +After that, you should be fine! You may test *flowR*'s command-line interface by running the following from the `cli` directory: ```shell npm run slicer -- --criterion "12@product" test/testfiles/example.R diff --git a/wiki/Thesis.md b/wiki/Thesis.md index 485908a094..9a4b7bb2fd 100644 --- a/wiki/Thesis.md +++ b/wiki/Thesis.md @@ -40,11 +40,13 @@ The (sorted) results should be versioned and can be found in [scripts/top-r-down ``` 4. Now you can run the statistics program on the downloaded sources. - You can do this in two ways (check `npm run stats -- --help` for more information). + You can do this in two ways (run `npm run stats -- --help` from the `cli` directory for more information). In any case, the extraction may take a long time, so be prepared for that! Furthermore, you may want to store the output of the tool as it provides additional information. - **On the complete folder** + + First, make sure you are currently in the `cli` directory to allow running command-line interface commands. ```shell npm run stats -- --input --output-dir @@ -64,7 +66,7 @@ The (sorted) results should be versioned and can be found in [scripts/top-r-down of course limited to only those files that have been processed so far. 5. Afterward, your output folder should contain several folders with the recorded stats of all extracted features. - To make sense of them, you need to use the post-processor, which prints the summarized information to the command-line: + To make sense of them, you need to use the command-line interface's post-processor, which prints the summarized information to the command-line: ```shell npm run stats -- --post-process "./statistics-out/cran-500" --no-ansi > "./statistics-out/cran-500/cran-500-summary.log"