Skip to content

Commit 8c4df98

Browse files
authored
Merge pull request #25 from tdulcet/svg
Updated CI to save SVG graphs
2 parents 3467dc5 + 0da98d4 commit 8c4df98

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.github/workflows/gnu-data.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,21 @@ jobs:
143143
with:
144144
default_author: github_actions
145145
message: "Refresh the GNU graph"
146-
add: gnu-results.png
146+
add: gnu-results.svg
147147

148148
- name: Add & Commit the busybox graph
149149
uses: EndBug/add-and-commit@v9.1.4
150150
with:
151151
default_author: github_actions
152152
message: "Refresh the busybox graph"
153-
add: busybox-results.png
153+
add: busybox-results.svg
154154

155155
- name: Add & Commit the toybox graph
156156
uses: EndBug/add-and-commit@v9.1.4
157157
with:
158158
default_author: github_actions
159159
message: "Refresh the toybox graph"
160-
add: toybox-results.png
160+
add: toybox-results.svg
161161

162162
- name: Add & Commit the individual size graph
163163
uses: EndBug/add-and-commit@v9.1.4
@@ -171,4 +171,4 @@ jobs:
171171
with:
172172
default_author: github_actions
173173
message: "Refresh the size graph"
174-
add: size-results.png
174+
add: size-results.svg

individual-size-graph.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111

1212
df = pd.read_json(sys.argv[1], orient="index")
1313

14-
Path("individual-size-results").mkdir(exist_ok=True)
14+
df.index = pd.to_datetime(df.index, utc=True)
1515

16+
Path("individual-size-results").mkdir(exist_ok=True)
1617

17-
for name in df.sizes.values[0]:
18-
# Check if the name exists in each dictionary
19-
sizes = df.sizes.map(lambda v: v.get(name))
2018

19+
for name, series in df["sizes"].apply(pd.Series).items():
2120
# Filter out None values which indicate missing data for 'name'
22-
sizes = sizes[sizes.notnull()]
21+
sizes = series.dropna()
2322

2423
if not sizes.empty:
2524
print(name)
@@ -30,6 +29,6 @@
3029
fig.autofmt_xdate()
3130
plt.margins(0.01)
3231
plt.savefig(f"individual-size-results/{name}.svg", format="svg", dpi=199, bbox_inches="tight")
33-
plt.clf()
32+
plt.close(fig)
3433
else:
3534
print(f"Warning: No data found for '{name}'")

0 commit comments

Comments
 (0)