Compare commits

...

5 Commits

Author SHA1 Message Date
⑆ Neveda ⑈
df0c65e8b7
Merge 2e4fbf4117 into b0d29f01b0 2024-08-02 19:30:36 +00:00
dependabot[bot]
b0d29f01b0
Bump anyhow from 1.0.80 to 1.0.86 (#762)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.80 to 1.0.86.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.80...1.0.86)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-01 08:52:19 +02:00
Spreadcat
ef9e1409c6
add: legend modification parameters and output DPI (#758)
* add: legend modification parameters and output DPI

This commit adds a CLI parameter to plot_histogram in order to position
the legend of the plot on the diagram.
It also defines the output DPI for the plot to 600 dpi.

Plot_progression gets a CLI paramter to add a custom label and to
overwrite the default one.

---------

Co-authored-by: dbv <jt@dbv03.linpro.no>
Co-authored-by: dbv <spreadcat.github@micronarrativ.org>
2024-07-17 20:40:12 +02:00
Antonin Décimo
824aafbd69 Fix typos README.md 2024-07-09 10:31:45 +02:00
Neveda
2e4fbf4117 Add short flag counterparts 2023-10-06 14:16:02 +02:00
4 changed files with 23 additions and 6 deletions

4
Cargo.lock generated
View File

@ -72,9 +72,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.80"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1"
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "approx"

View File

@ -213,14 +213,14 @@ pacman -S hyperfine
### On Debian Linux
On Debian Linux, hyperfine can be installed [from the testing repositories](https://packages.debian.org/testing/main/hyperfine)
On Debian Linux, hyperfine can be installed [from the testing repositories](https://packages.debian.org/testing/main/hyperfine):
```
apt install hyperfine
```
### On Exherbo Linux
On Exherbo Linux, hyperfine can be installed [from the rust repositories]([https://packages.debian.org/testing/main/hyperfine](https://gitlab.exherbo.org/exherbo/rust/-/tree/master/packages/sys-apps/hyperfine)
On Exherbo Linux, hyperfine can be installed [from the rust repositories](https://gitlab.exherbo.org/exherbo/rust/-/tree/master/packages/sys-apps/hyperfine):
```
cave resolve -x repository/rust
cave resolve -x hyperfine

View File

@ -6,6 +6,7 @@ import argparse
import json
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.font_manager
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("file", help="JSON file with benchmark results")
@ -14,6 +15,11 @@ parser.add_argument(
"--labels", help="Comma-separated list of entries for the plot legend"
)
parser.add_argument("--bins", help="Number of bins (default: auto)")
parser.add_argument(
"--legend-location", help="Location of the legend on plot (default: upper center)",
choices=["upper center", "lower center", "right", "left", "best", "upper left", "upper right", "lower left", "lower right", "center left", "center right", "center"],
default="upper center"
)
parser.add_argument(
"--type", help="Type of histogram (*bar*, barstacked, step, stepfilled)"
)
@ -47,6 +53,7 @@ t_max = float(args.t_max) if args.t_max else np.max(list(map(np.max, all_times))
bins = int(args.bins) if args.bins else "auto"
histtype = args.type if args.type else "bar"
plt.figure(figsize=(10, 5))
plt.hist(
all_times,
label=labels,
@ -54,7 +61,12 @@ plt.hist(
histtype=histtype,
range=(t_min, t_max),
)
plt.legend(prop={"family": ["Source Code Pro", "Fira Mono", "Courier New"]})
plt.legend(
loc=args.legend_location,
fancybox=True,
shadow=True,
prop={"size": 7, "family": ["Source Code Pro", "Fira Mono", "Courier New"]}
)
plt.xlabel("Time [s]")
if args.title:
@ -66,6 +78,6 @@ else:
plt.ylim(0, None)
if args.output:
plt.savefig(args.output)
plt.savefig(args.output, dpi=600)
else:
plt.show()

View File

@ -225,6 +225,7 @@ fn build_command() -> Command {
.arg(
Arg::new("style")
.long("style")
.short('l')
.action(ArgAction::Set)
.value_name("TYPE")
.value_parser(["auto", "basic", "full", "nocolor", "color", "none"])
@ -240,6 +241,7 @@ fn build_command() -> Command {
.arg(
Arg::new("sort")
.long("sort")
.short('t')
.action(ArgAction::Set)
.value_name("METHOD")
.value_parser(["auto", "command", "mean-time"])
@ -314,6 +316,7 @@ fn build_command() -> Command {
.arg(
Arg::new("show-output")
.long("show-output")
.short('d')
.action(ArgAction::SetTrue)
.conflicts_with("style")
.help(
@ -326,6 +329,7 @@ fn build_command() -> Command {
.arg(
Arg::new("output")
.long("output")
.short('O')
.conflicts_with("show-output")
.action(ArgAction::Set)
.value_name("WHERE")
@ -349,6 +353,7 @@ fn build_command() -> Command {
.arg(
Arg::new("input")
.long("input")
.short('I')
.action(ArgAction::Set)
.num_args(1)
.value_name("WHERE")