diff --git a/.github/workflows/gnu-data.yml b/.github/workflows/gnu-data.yml index d5774b26ed..dd6d8c554d 100644 --- a/.github/workflows/gnu-data.yml +++ b/.github/workflows/gnu-data.yml @@ -143,21 +143,21 @@ jobs: with: default_author: github_actions message: "Refresh the GNU graph" - add: gnu-results.png + add: gnu-results.svg - name: Add & Commit the busybox graph uses: EndBug/add-and-commit@v9.1.4 with: default_author: github_actions message: "Refresh the busybox graph" - add: busybox-results.png + add: busybox-results.svg - name: Add & Commit the toybox graph uses: EndBug/add-and-commit@v9.1.4 with: default_author: github_actions message: "Refresh the toybox graph" - add: toybox-results.png + add: toybox-results.svg - name: Add & Commit the individual size graph uses: EndBug/add-and-commit@v9.1.4 @@ -171,4 +171,4 @@ jobs: with: default_author: github_actions message: "Refresh the size graph" - add: size-results.png + add: size-results.svg diff --git a/individual-size-graph.py b/individual-size-graph.py index 1650733364..404c21c376 100644 --- a/individual-size-graph.py +++ b/individual-size-graph.py @@ -11,15 +11,14 @@ df = pd.read_json(sys.argv[1], orient="index") -Path("individual-size-results").mkdir(exist_ok=True) +df.index = pd.to_datetime(df.index, utc=True) +Path("individual-size-results").mkdir(exist_ok=True) -for name in df.sizes.values[0]: - # Check if the name exists in each dictionary - sizes = df.sizes.map(lambda v: v.get(name)) +for name, series in df["sizes"].apply(pd.Series).items(): # Filter out None values which indicate missing data for 'name' - sizes = sizes[sizes.notnull()] + sizes = series.dropna() if not sizes.empty: print(name) @@ -30,6 +29,6 @@ fig.autofmt_xdate() plt.margins(0.01) plt.savefig(f"individual-size-results/{name}.svg", format="svg", dpi=199, bbox_inches="tight") - plt.clf() + plt.close(fig) else: print(f"Warning: No data found for '{name}'")