first test figure

This commit is contained in:
Motiejus Jakštys 2021-04-01 19:30:20 +03:00
parent 896b4a2714
commit 56318e1596
3 changed files with 28 additions and 16 deletions

View File

@ -5,15 +5,13 @@ SLIDES = slides-2021-03-29.pdf
NON_ARCHIVABLES = notes.txt referatui.txt slides-2021-03-29.txt NON_ARCHIVABLES = notes.txt referatui.txt slides-2021-03-29.txt
ARCHIVABLES = $(filter-out $(NON_ARCHIVABLES),$(shell git ls-files .)) ARCHIVABLES = $(filter-out $(NON_ARCHIVABLES),$(shell git ls-files .))
GIT_DEP=
ifeq ($(shell git rev-parse --is-inside-git-dir),true) ifeq ($(shell git rev-parse --is-inside-git-dir),true)
GIT_DEP=$(shell git rev-parse --show-toplevel)/.git GIT_DEP=$(shell git rev-parse --show-toplevel)/.git
else
GIT_DEP=
endif endif
.PHONY: test .PHONY: test
test: tests.sql .faux.db test: .faux_test
./db -f tests.sql
.PHONY: test-integration .PHONY: test-integration
test-integration: .faux_filter-rivers test-integration: .faux_filter-rivers
@ -22,7 +20,8 @@ test-integration: .faux_filter-rivers
.PHONY: clean .PHONY: clean
clean: clean:
-./db stop -./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 .PHONY: clean-tables
clean-tables: clean-tables:
@ -33,7 +32,7 @@ clean-tables:
.PHONY: slides .PHONY: slides
slides: $(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 $< latexmk -shell-escape -g -pdf $<
mj-msc-all.pdf: mj-msc.pdf version.tex $(ARCHIVABLES) 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 done
mv .tmp-$@ $@ mv .tmp-$@ $@
slides-2021-03-29.pdf: slides-2021-03-29.txt test-figures.pdf: layer2img.py tests.sql
pandoc -t beamer -i $< -o $@ python ./layer2img.py --group1-table=figures --outfile=$@
slides-2021-03-29.html: slides-2021-03-29.txt .faux_test: tests.sql wm.sql .faux.db
pandoc --verbose -t slidy --self-contained $< -o $@ $(SLIDY_ARGS) ./db -f tests.sql
touch $@
.faux_filter-rivers: .faux_import-osm .faux_filter-rivers: .faux_import-osm
./db -v where="$(WHERE)" -f aggregate-rivers.sql ./db -v where="$(WHERE)" -f aggregate-rivers.sql
@ -74,3 +74,10 @@ version.tex: Makefile $(GIT_DEP)
( \ ( \
TZ=UTC date '+\gdef\VCDescribe{%F ($(REF))}%'; \ 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)

View File

@ -142,7 +142,7 @@ def add_lines(ax, group):
for geom in getattr(g, 'geoms', [g]): for geom in getattr(g, 'geoms', [g]):
x, y = zip(*geom.coords) x, y = zip(*geom.coords)
narrs = geom.length / 16 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(): def main():
args = parse_args() args = parse_args()
@ -159,10 +159,10 @@ def main():
ax.set_ylim(bottom=c[1], top=c[3]) ax.set_ylim(bottom=c[1], top=c[3])
if group1 is not None: if group1 is not None:
group1.plot(ax=ax, color=PURPLE) group1.plot(ax=ax, color=ORANGE)
add_lines(ax, group1) add_lines(ax, group1)
if group2 is not None: if group2 is not None:
group2.plot(ax=ax, color=ORANGE) group2.plot(ax=ax, color=PURPLE)
add_lines(ax, group2) add_lines(ax, group2)
if group3 is not None: if group3 is not None:
group3.plot(ax=ax, color=GREEN) group3.plot(ax=ax, color=GREEN)

View File

@ -155,8 +155,8 @@ generalization.
\subsection{Modern approaches} \subsection{Modern approaches}
Due to their simplicity and ubiquity, {\DP} and {\VW} have been established as Due to their simplicity and ubiquity, {\DP} and {\VW} have been established as
go-to algorithms for line generalization. During recent years, more modern go-to algorithms for line generalization. During recent years, alternatives
replacement algorithms have emerged. These fall into roughly two categories: have emerged. These modern replacements fall into roughly two categories:
\begin{itemize} \begin{itemize}
\item Cartographic knowledge was encoded to an algorithm (bottom-up \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 few seconds. Having an easily accessible test suite boosts confidence that no
unexpected regressions have been added while modifying the algorithm. unexpected regressions have been added while modifying the algorithm.
<TODO: expand with a screenshot> \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} \section{Description of the implementation}