Skip to content

Commit

Permalink
Merge pull request #74 from nschloe/dufte
Browse files Browse the repository at this point in the history
Dufte
  • Loading branch information
nschloe authored May 13, 2020
2 parents 58fe95b + 8519595 commit 0f3b81e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ tag:
# git push --tags
curl -H "Authorization: token `cat $(HOME)/.github-access-token`" -d '{"tag_name": "v$(VERSION)"}' https://api.github.com/repos/nschloe/stressberry/releases

# https://packaging.python.org/distributing/#id72
upload: setup.py
upload:
@if [ "$(shell git rev-parse --abbrev-ref HEAD)" != "master" ]; then exit 1; fi
rm -f dist/*
# python3 setup.py sdist bdist_wheel
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ plots which can easily be compared.
custom case with fans (@flyingferret, [#21](https://github.com/nschloe/stressberry/issues/21)) | [KKSB case](https://kksb-cases.com/products/kksb-raspberry-pi-4-case-aluminium) (@JohBod, [#31](https://github.com/nschloe/stressberry/issues/31)) | [Argon One case](https://www.argon40.com/argon1/argon-one-pi4.html) (@jholloway, [#37](https://github.com/nschloe/stressberry/issues/37))
<img src="https://nschloe.github.io/stressberry/hex-wrench.png" width="70%"> | <img src="https://nschloe.github.io/stressberry/coolipi.jpg" width="70%"> | <img src="https://nschloe.github.io/stressberry/ice-tower.jpg" width="70%">
[hex wrench case](https://www.amazon.ca/Aluminum-Model-Raspberry-Wrench-Enclosure/dp/B07W6FT1DD?th=1) (@patrickpoirier51, [#45](https://github.com/nschloe/stressberry/issues/45)) | [CooliPi](https://www.coolipi.com/) (@CooliPi, [#47](https://github.com/nschloe/stressberry/issues/47), [#48](https://github.com/nschloe/stressberry/issues/48)) | [low-profile ice tower case](https://www.aliexpress.com/i/4000288119233.html) (@leonhess, [#54](https://github.com/nschloe/stressberry/issues/54))
<img src="https://nschloe.github.io/stressberry/flirc4b.jpeg" width="70%"> | |
[Flirc case](https://flirc.tv/more/raspberry-pi-4-case) (@RichardKav, [#73](https://github.com/nschloe/stressberry/issues/73)) | |


### Raspberry Pi 3B+
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = stressberry
version = 0.3.0
version = 0.3.1
author = Nico Schlömer
email = [email protected]
description = Stress tests for the Raspberry Pi
Expand All @@ -27,7 +27,7 @@ classifiers =
packages = find:
# importlib_metadata can be removed when we support Python 3.8+ only
install_requires =
cleanplotlib
dufte
importlib_metadata
matplotlib
pyyaml
Expand Down
18 changes: 8 additions & 10 deletions stressberry/cli/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@


def plot(argv=None):
import cleanplotlib as cpl
import dufte
import matplotlib.pyplot as plt

plt.style.use(dufte.style)

parser = _get_parser_plot()
args = parser.parse_args(argv)

Expand All @@ -17,28 +19,24 @@ def plot(argv=None):
# actually plot it
fig = plt.figure()
ax1 = fig.add_subplot(1, 1, 1)
a = []
b = []
c = []
for d in data:
temperature_data = d["temperature"]
if args.delta_t:
temperature_data = []
zip_object = zip(d["temperature"], d["ambient"])
for d["temperature"], d["ambient"] in zip_object:
temperature_data.append(d["temperature"] - d["ambient"])
a.append(d["time"])
b.append(temperature_data)
c.append(d["name"])

cpl.multiplot(a, b, c)
plt.plot(d["time"], temperature_data, label=d["name"])

dufte.legend()

if args.delta_t:
plot_yaxis_label = "Δ temperature [°C over ambient]"
else:
plot_yaxis_label = "temperature [°C]"
cpl.xlabel("time [s]")
cpl.ylabel(plot_yaxis_label)
plt.xlabel("time [s]")
plt.ylabel(plot_yaxis_label)

if args.temp_lims:
ax1.set_ylim(*args.temp_lims)
Expand Down

0 comments on commit 0f3b81e

Please sign in to comment.