-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: generate results | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
|
||
|
||
jobs: | ||
generate-results: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- run: pip install jinja2 pandas pytz seaborn | ||
- run: python generate-results.py | ||
- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version. | ||
with: | ||
add: 'Results.md *.png' | ||
author_name: ilastik-bot | ||
committer_name: ilastik bot | ||
message: '(bot) Updated results' | ||
new_branch: results | ||
push: '--force' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Results | ||
|
||
generated {{ now }}, from results of {{ n_hosts }} machines | ||
|
||
## Unique | ||
|
||
### Memory usage | ||
|
||
[![unique-memory-usage](unique-max-memory.png)] | ||
|
||
### Time | ||
|
||
[![unique-runningtime](unique-runningtime.png)] | ||
|
||
## Bincount | ||
|
||
### Memory usage | ||
|
||
[![unique-memory-usage](unique-max-memory.png)] | ||
|
||
### Time | ||
|
||
[![unique-runningtime](unique-runningtime.png)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import datetime | ||
from datetime import timedelta, timezone | ||
from pathlib import Path | ||
|
||
import pandas | ||
import pytz | ||
import seaborn as sns | ||
from jinja2 import Template | ||
|
||
utctzinfo = timezone(timedelta(hours=0)) | ||
timeformat = "%Y-%m-%dT%H:%M:%S" | ||
|
||
|
||
def gen_plots(): | ||
shape_index_mapping = { | ||
"(512, 128, 1)": "0", # numpy.prod((512, 128, 1)), | ||
"(1024, 512, 1)": "1", # numpy.prod((1024, 512, 1)), | ||
"(2048, 1024, 1)": "2", # numpy.prod((2048, 1024, 1)), | ||
"(512, 512, 32)": "3", # numpy.prod((512, 512, 32)), | ||
"(1024, 1024, 256)": "4", # numpy.prod((1024, 1024, 256)) | ||
} | ||
|
||
results_unique = pandas.read_csv("results-unique.csv", sep="\t") | ||
|
||
results_unique["shape_ind"] = results_unique["shape"].map(shape_index_mapping) | ||
|
||
p = sns.lineplot(x="shape_ind", y="t", hue="method", data=results_unique) | ||
p.set(yscale="log") | ||
fig = p.get_figure() | ||
fig.savefig("unique-runningtime.png") | ||
|
||
p.clear() | ||
|
||
p = sns.lineplot(x="shape_ind", y="mem_max", hue="method", data=results_unique) | ||
p.set(yscale="log") | ||
fig = p.get_figure() | ||
fig.savefig("unique-max-memory.png") | ||
|
||
p.clear() | ||
|
||
results_bincount = pandas.read_csv("results-bincount.csv", sep="\t") | ||
|
||
results_bincount["shape_ind"] = results_bincount["shape"].map(shape_index_mapping) | ||
|
||
p = sns.lineplot(x="shape_ind", y="t", hue="method", data=results_bincount) | ||
p.set(yscale="log") | ||
fig = p.get_figure() | ||
fig.savefig("bincount-runningtime.png") | ||
|
||
p.clear() | ||
|
||
p = sns.lineplot(x="shape_ind", y="mem_max", hue="method", data=results_bincount) | ||
p.set(yscale="log") | ||
fig = p.get_figure() | ||
fig.savefig("bincount-max-memory.png") | ||
|
||
p.clear() | ||
|
||
|
||
def main(): | ||
template = Template(Path("Results.md.in").read_text()) | ||
gen_plots() | ||
n_hosts = len(pandas.read_csv("results-unique.csv", sep="\t")["host"].unique()) | ||
|
||
tz = pytz.timezone("Europe/Berlin") | ||
now = datetime.datetime.now(tz) | ||
|
||
# render | ||
rendered = template.render(now=now.strftime(timeformat), n_hosts=n_hosts) | ||
|
||
Path("Results.md").write_text(rendered) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |