[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken axis and minor fixes #23

Merged
merged 4 commits into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix building for numeric-only commits. Fix order of ratios in broken …
…axis
  • Loading branch information
MassimoGirondi committed Nov 26, 2021
commit de7e8930fdb5785c6ffa99917983349dd92737fb
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ This section is in rework.
###### Scaling and axis limits
* **var_log**, [THROUGHPUT,LATENCY] Define variables that should be shown in a log axis in base 2
* **var_log_base**, {THROUGHPUT:2} Define variables that should be shown in a log axis, with the specified base (default is 2 with var_log)
* **var_lim**, {THROUGHPUT:0-100} Define the range for some variables, useful to cap graphs. One can produce "broken axis" graphes by giving multiple ranges separated by a + sign. For instance {THROUGHPUT:0-10+50-100}.
* **var_lim**, {THROUGHPUT:0-100} Define the range for some variables, useful to cap graphs. One can produce "broken axis" graphes by giving multiple ranges separated by a + sign. For instance {THROUGHPUT:0-10+50-100}. One can also control the ratio between one part and the other by setting a third number after the range: {THROUGHPUT:0-10-20+0-30-100-80} will create a plot where the first range is 20% and the second 80% of the total axis.
* **var_format**={THROUGHPUT:%dGbps} Printf like formating of va And the prefix should be changed.riables. Eg this example will display all visualisation of the value of throughput (eg in the axis) as XGbps. Use in combination to var_divider.
* You can also pass `eng` to have an engineering formatting (e.g. 1 k, 2 M, ...).
Optionally, `eng.2` will print engineering format with 2 decimal places, while `eng.2.Hz` will print e.g. `2.44 kHz`.
Expand Down
31 changes: 31 additions & 0 deletions integration/broken_axis.npf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
%info
Use this to test broken axis features:
~/npf/npf-compare.py local --test broken_axis.npf --config n_runs=1 --no-test --graph-size 6.5 2.5 --tags TAGS

Settings TAGS to a combination of x, y, y_prop, x_prop, both, eng, engHz, engHz3 should change the output

%variables

X=[0-100]

%config

var_lim={}
var_format={VALUE:%d}
y:var_lim={VALUE:0-10+30-1000}
x:var_lim={X:0-10+30-40}


yprop:var_lim={VALUE:0-15-3+33-40-6}
xprop:var_lim={X:0-150-10+100-200-20+250-300-100}

both:var_lim={VALUE:0-15-3+33-40-6+50-60-1,X:0-150-1+100-200-2+250-300}

eng:var_lim={VALUE:0-1500-3+50000-200000-3+5000000-15000000-3}

eng:var_format={VALUE:eng}
engHz:var_format={VALUE:eng-0-Hz}
engHz3:var_format={VALUE:eng-3-Hz}

%script
echo "RESULT-VALUE $(( ($X * $X) ))"
2 changes: 1 addition & 1 deletion npf/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, repo, version, result_path=None):
self.n_tests = 0
self.n_passed = 0
self.repo = repo
self.version = version
self.version = str(version)
self._pretty_name = None
self._marker = '.'
self._line = '-'
Expand Down
4 changes: 2 additions & 2 deletions npf/grapher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@ def generate_plot_for_graph(self, i, i_subplot, figure, n_cols, n_lines, vars_va
if nbrokenY * nbrokenX > 1:
fig = plt.figure(constrained_layout=False)

heights = [ broken_axes_ratio(values) for values in reversed(brokenaxesY)]
widths = [ broken_axes_ratio(values) for values in reversed(brokenaxesX)]
heights = [ broken_axes_ratio(values) for values in brokenaxesY]
widths = [ broken_axes_ratio(values) for values in brokenaxesX]
spec = fig.add_gridspec(ncols=nbrokenX, nrows = nbrokenY, height_ratios = heights, width_ratios = widths)
spec.update(left=0.15, bottom=0.2)

Expand Down