comparison README.md @ 1858:4a9be96f2569 feature/documenter_logo

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Sun, 12 Jan 2025 21:18:44 +0100
parents 654a2b7e6824
children
comparison
equal deleted inserted replaced
1857:ffde7dad9da5 1858:4a9be96f2569
1 # Sbplib 1 # Diffinitive
2 2
3 ## Running tests 3 ## Running tests
4 To run all tests simply run 4 To run all tests simply run
5 ``` 5 ```
6 (@v1.5) pkg> activate . 6 (@v1.5) pkg> activate .
7 (Sbplib) pkg> test 7 (Diffinitive) pkg> test
8 ``` 8 ```
9 9
10 If you want to run tests from a specific file in `test/`, you can do 10 If you want to run tests from a specific file in `test/`, you can do
11 ``` 11 ```
12 julia> using Pkg 12 julia> using Pkg
26 ``` 26 ```
27 Pkg.test(test_args=["*/lazy_tensor_operations_test.jl", "Grids/*"]) 27 Pkg.test(test_args=["*/lazy_tensor_operations_test.jl", "Grids/*"])
28 ``` 28 ```
29 will run any file named `lazy_tensor_operations_test.jl` and all the files in the `Grids` folder. 29 will run any file named `lazy_tensor_operations_test.jl` and all the files in the `Grids` folder.
30 30
31 ## Running benchmarks
32 Benchmarks are defined in `benchmark/` and use the tools for benchmark suites
33 in BenchmarkTools.jl. The format is compatible with PkgBenchmark.jl which
34 helps with running the suite, comparing results and presenting the results in
35 a readable way. There are custom functions included for running the benchmarks
36 in this Mercurial repository.
37
38 `benchmark/` contains a julia environment with the necessary packages for
39 working with the benchmarks.
40
41 To run the benchmarks, either use `make` or run them manually from the REPL, as
42 explained further below.
43
44 Using `make` there are four targets for benchmarks
45 ```shell
46 make benchmark # Runs the suite for the current working directory
47 make benchmarkrev REV=rev # Runs the suite at the specified revision
48 make benchmarkcmp TARGET=target BASELINE=baseline # Compares two revisions
49 make cleanbenchmark # Cleans up benchmark tunings and results
50 ```
51 Here `rev`, `target` and `baseline` are any valid Mercurial revision
52 specifiers.
53
54 Alternatively, the benchmarks can be run from the REPL. To do this, first
55 activate the environment in `benchmark/` then include the file
56 `benchmark_utils.jl`. The suite can then be run using the function `main` in
57 one of the following ways
58
59 ```julia
60 main() # Runs the suite for the current working directory
61 main(rev="...") # Runs the suite at the specified revision
62 main(target="...", baseline="...") # Compares two revisions
63 ```
64
65 Again, `rev`, `target` and `baseline` are any valid Mercurial revision
66 specifiers.
67
68 PkgBenchmark can also be used directly.
69
70 ```julia
71 using PkgBenchmark
72 import Diffinitive
73 r = benchmarkpkg(Diffinitive)
74
75 export_markdown(stdout, r)
76 ```
31 77
32 ## Generating and using the documentation 78 ## Generating and using the documentation
33 Generating the documentation can be done using either `make` or through activating the `docs` environment and including the script `docs/make.jl` at the REPL. 79 Generating the documentation can be done using either `make` or through activating the `docs` environment and including the script `docs/make.jl` at the REPL.
34 80
35 Using `make` there are three targets 81 Using `make` there are four targets for documentation
36 ```shell 82 ```shell
37 make docs 83 make docs # generates files suitable for webserver deployment, i.e with `prettyurls=true`
38 make localdocs 84 make localdocs # generates files suitable for local viewing in a web browser, i.e `prettyurls=false`
39 make opendocs 85 make opendocs # build and view documentation locally
40 make help 86 make cleandocs # cleans up generated files
41 ```
42 The first variant generates files suitable for webserver deployment, i.e with `prettyurls=true`. The second generates files sutible for local viewing in a web browser, i.e `prettyurls=false`. To view the documentation locally simply open `docs/build/index.html` in your web browser. The documentation can be automatically built and opened using
43 ```shell
44 make opendocs
45 ``` 87 ```
46 88
47 When including the `docs/make.jl` script `prettyurls` is set to `false` by default. 89 Alternatively, to view the documentation locally simply open `docs/build/index.html` in your web browser. When including the `docs/make.jl` script `prettyurls` is set to `false` by default.
48 90
49 Including `docs/make.jl` from the REPL may be preferable when repeatadely building the documentation since this avoids compilation latency. 91 Including `docs/make.jl` from the REPL may be preferable when repeatedly building the documentation since this avoids compilation latency.