From 9fd64db34903e8dc99f0f667c191a7be7970c234 Mon Sep 17 00:00:00 2001 From: fredrikr79 Date: Mon, 3 Nov 2025 11:17:58 +0100 Subject: [PATCH] ex7: add `diff` and `compare` target - simplifies the `check` target - plots the differences or prints the differences of arbitrary data points --- exercise7/Makefile | 11 +++++++---- flake.nix | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/exercise7/Makefile b/exercise7/Makefile index 690b227..b14a03b 100644 --- a/exercise7/Makefile +++ b/exercise7/Makefile @@ -18,13 +18,16 @@ images/%.png: data/%.dat ./plot_image.sh $< movie: ${IMAGES} ffmpeg -y -an -i images/%5d.png -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 -r 12 wave.mp4 -check: dirs sequential parallel +data: dirs sequential parallel mkdir -p data_sequential ./sequential cp -rf ./data/* ./data_sequential ./parallel - python3 compare.py data_sequential/00000.dat data/00000.dat - python3 compare.py data_sequential/00075.dat data/00075.dat - rm -rf data_sequential +compare/%: data + python3 compare.py data_sequential/$(shell printf "%05d" $*).dat data/$(shell printf "%05d" $*).dat +diff/%: data + python3 plot_differences.py data_sequential/$(shell printf "%05d" $*).dat data/$(shell printf "%05d" $*).dat +check: compare/0 compare/75 clean: -rm -fr sequential parallel data images wave.mp4 + rm -rf data_sequential diff --git a/flake.nix b/flake.nix index c262d49..0d5f3f5 100644 --- a/flake.nix +++ b/flake.nix @@ -53,6 +53,7 @@ binutils uv python3Packages.numpy + python3Packages.matplotlib ]; shellHook = '' echo welcome!