From 1673405c28d04aece89ea3a681e90a2e709367e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 19 May 2021 22:57:46 +0300 Subject: [PATCH] first test figure --- Makefile | 27 +++++++++++++++++---------- layer2img.py | 6 +++--- mj-msc.tex | 11 ++++++++--- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 7b4717d..be6bd55 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,13 @@ SLIDES = slides-2021-03-29.pdf NON_ARCHIVABLES = notes.txt referatui.txt slides-2021-03-29.txt ARCHIVABLES = $(filter-out $(NON_ARCHIVABLES),$(shell git ls-files .)) +GIT_DEP= ifeq ($(shell git rev-parse --is-inside-git-dir),true) GIT_DEP=$(shell git rev-parse --show-toplevel)/.git -else -GIT_DEP= endif .PHONY: test -test: tests.sql .faux.db - ./db -f tests.sql +test: .faux_test .PHONY: test-integration test-integration: .faux_filter-rivers @@ -22,7 +20,8 @@ test-integration: .faux_filter-rivers .PHONY: clean clean: -./db stop - -rm .faux_filter-rivers .faux_import-osm .faux.db $(SLIDES) + -rm .faux_test .faux_filter-rivers .faux_import-osm .faux.db \ + $(SLIDES) .PHONY: clean-tables clean-tables: @@ -33,7 +32,7 @@ clean-tables: .PHONY: slides slides: $(SLIDES) -mj-msc.pdf: mj-msc.tex version.tex bib.bib +mj-msc.pdf: mj-msc.tex test-figures.pdf version.tex bib.bib latexmk -shell-escape -g -pdf $< mj-msc-all.pdf: mj-msc.pdf version.tex $(ARCHIVABLES) @@ -45,11 +44,12 @@ mj-msc-all.pdf: mj-msc.pdf version.tex $(ARCHIVABLES) done mv .tmp-$@ $@ -slides-2021-03-29.pdf: slides-2021-03-29.txt - pandoc -t beamer -i $< -o $@ +test-figures.pdf: layer2img.py tests.sql + python ./layer2img.py --group1-table=figures --outfile=$@ -slides-2021-03-29.html: slides-2021-03-29.txt - pandoc --verbose -t slidy --self-contained $< -o $@ $(SLIDY_ARGS) +.faux_test: tests.sql wm.sql .faux.db + ./db -f tests.sql + touch $@ .faux_filter-rivers: .faux_import-osm ./db -v where="$(WHERE)" -f aggregate-rivers.sql @@ -74,3 +74,10 @@ version.tex: Makefile $(GIT_DEP) ( \ TZ=UTC date '+\gdef\VCDescribe{%F ($(REF))}%'; \ ) > $@ + +# slides +slides-2021-03-29.pdf: slides-2021-03-29.txt + pandoc -t beamer -i $< -o $@ + +slides-2021-03-29.html: slides-2021-03-29.txt + pandoc --verbose -t slidy --self-contained $< -o $@ $(SLIDY_ARGS) diff --git a/layer2img.py b/layer2img.py index c27d1e3..4401d10 100644 --- a/layer2img.py +++ b/layer2img.py @@ -142,7 +142,7 @@ def add_lines(ax, group): for geom in getattr(g, 'geoms', [g]): x, y = zip(*geom.coords) narrs = geom.length / 16 - arrowplot(ax, np.array(x), np.array(y), narrs=narrs) + #arrowplot(ax, np.array(x), np.array(y), narrs=narrs) def main(): args = parse_args() @@ -159,10 +159,10 @@ def main(): ax.set_ylim(bottom=c[1], top=c[3]) if group1 is not None: - group1.plot(ax=ax, color=PURPLE) + group1.plot(ax=ax, color=ORANGE) add_lines(ax, group1) if group2 is not None: - group2.plot(ax=ax, color=ORANGE) + group2.plot(ax=ax, color=PURPLE) add_lines(ax, group2) if group3 is not None: group3.plot(ax=ax, color=GREEN) diff --git a/mj-msc.tex b/mj-msc.tex index 1c2aa42..f5e2bd5 100644 --- a/mj-msc.tex +++ b/mj-msc.tex @@ -155,8 +155,8 @@ generalization. \subsection{Modern approaches} Due to their simplicity and ubiquity, {\DP} and {\VW} have been established as -go-to algorithms for line generalization. During recent years, more modern -replacement algorithms have emerged. These fall into roughly two categories: +go-to algorithms for line generalization. During recent years, alternatives +have emerged. These modern replacements fall into roughly two categories: \begin{itemize} \item Cartographic knowledge was encoded to an algorithm (bottom-up @@ -204,7 +204,12 @@ The full test suite can be executed with a single command, and completes in a few seconds. Having an easily accessible test suite boosts confidence that no unexpected regressions have been added while modifying the algorithm. - +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{test-figures} + \caption{Visualized figures for automated text cases} + \label{fig:test-figures} +\end{figure} \section{Description of the implementation}