aboutsummaryrefslogtreecommitdiff
path: root/reproduce/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/analysis')
-rw-r--r--reproduce/analysis/config/INPUTS.conf37
-rw-r--r--reproduce/analysis/make/download.mk2
-rw-r--r--reproduce/analysis/make/initialize.mk65
-rw-r--r--reproduce/analysis/make/paper.mk8
-rw-r--r--reproduce/analysis/make/verify.mk4
5 files changed, 82 insertions, 34 deletions
diff --git a/reproduce/analysis/config/INPUTS.conf b/reproduce/analysis/config/INPUTS.conf
index ee52abb..7d8bb50 100644
--- a/reproduce/analysis/config/INPUTS.conf
+++ b/reproduce/analysis/config/INPUTS.conf
@@ -5,30 +5,34 @@
#
# Necessary variables for each input dataset are listed below. Its good
# that all the variables of each file have the same base-name (in the
-# example below 'WFPC2') with descriptive suffixes, also put a short
-# comment above each group of variables for each dataset, shortly
-# explaining what it is.
+# example below 'DEMO') with descriptive suffixes, also put a short comment
+# above each group of variables for each dataset, shortly explaining what
+# it is.
#
-# 1) Local file name ('WFPC2IMAGE' below): this is the name of the dataset
+# 1) Local file name ('DEMO-DATA' below): this is the name of the dataset
# on the local system (in 'INDIR', given at configuration time). It is
# recommended that it be the same name as the online version of the
-# file like the case here (note how this variable is used in 'WFPC2URL'
+# file like the case here (note how this variable is used in 'DEMO-URL'
# for the dataset's full URL). However, this is not always possible, so
# the local and server filenames may be different. Ultimately, the file
# name is irrelevant, we check the integrity with the checksum.
#
-# 2) The MD5 checksum of the file ('WFPC2MD5' below): this is very
+# 2) The MD5 checksum of the file ('DEMO-MD5' below): this is very
# important for an automatic verification of the file. You can
-# calculate it by running 'md5sum' on your desired file.
+# calculate it by running 'md5sum' on your desired file. You can also
+# use any other checksum tool that you prefer, just be sure to correct
+# the respective command in 'reproduce/analysis/make/download.mk'.
#
-# 3) The human-readable size of the file ('WFPC2SIZE' below): this is an
-# optional feature which you can use for in the script that is loaded
-# at configure time ('reproduce/software/shell/configure.sh'). When
-# asking for the input-data directory, you can print some basic
-# information of the files for users to get a better feeling of the
-# volume. See that script for an example using this demo dataset.
+# 3) The human-readable size of the file ('DEMO-SIZE' below): this is an
+# optional variable, mainly to help a reader of your project get a
+# sense of the volume they need to download if they don't already have
+# the dataset. So it is highly recommended to add it (future readers of
+# your project's source will appreciate it!). You can get it from the
+# output of 'ls -lh' command on the file. Optionally you can use it in
+# messages during the configuration phase (when Maneage asks for the
+# input data directory), along with other info about the file(s).
#
-# 4) The full dataset URL ('WFPC2URL' below): this is the full URL
+# 4) The full dataset URL ('DEMO-URL' below): this is the full URL
# (including the file-name) that can be used to download the dataset
# when necessary. Also, see the description above on local filename.
#
@@ -39,6 +43,11 @@
# this notice are preserved. This file is offered as-is, without any
# warranty.
+
+
+
+
+# Dataset used in this analysis and its checksum for integrity checking.
MK20DATA = menke20.xlsx
MK20MD5 = 8e4eee64791f351fec58680126d558a0
MK20SIZE = 1.9MB
diff --git a/reproduce/analysis/make/download.mk b/reproduce/analysis/make/download.mk
index d5f8cef..fb3f21e 100644
--- a/reproduce/analysis/make/download.mk
+++ b/reproduce/analysis/make/download.mk
@@ -84,9 +84,11 @@ $(inputdatasets): $(indir)/%: | $(indir) $(lockdir)
sum=$$(md5sum $$unchecked | awk '{print $$1}')
if [ $$sum = $$mdf ]; then
mv $$unchecked $@
+ echo "Integrity confirmed, using $@ in this project."
else
echo; echo;
echo "Wrong MD5 checksum for input file '$$localname':"
+ echo " File location: $$unchecked"; \
echo " Expected MD5 checksum: $$mdf"; \
echo " Calculated MD5 checksum: $$sum"; \
echo; exit 1
diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk
index 6b25f02..fbd110f 100644
--- a/reproduce/analysis/make/initialize.mk
+++ b/reproduce/analysis/make/initialize.mk
@@ -302,27 +302,47 @@ $(project-package-contents): paper.pdf | $(texdir)
sed -e's|\\newcommand{\\makepdf}{}|%\\newcommand{\\makepdf}{}|' \
paper.tex > $$dir/paper.tex
- # Build the top-level directories.
- mkdir $$dir/reproduce $$dir/tex $$dir/tex/tikz $$dir/tex/build
-
- # Copy all the necessary `reproduce' and `tex' contents.
+ # Copy ONLY the version-controlled files in 'reproduce' and
+ # 'tex/src'. This is important because files like 'LOCAL.conf' (in
+ # 'reproduce/software/config') should not be archived, they contain
+ # information about the host computer and are irrelevant for
+ # others. Also some project authors may have temporary files here
+ # that are not under version control and thus shouldn't be archived
+ # (although this is bad practice, but that is up to the user).
+ #
+ # To keep the sub-directory structure, we are packaging the files
+ # with Tar, piping it, and unpacking it in the archive
+ # directory. So afterwards we need to come back to the current
+ # directory.
+ tar -c -f - $$(git ls-files reproduce tex/src) \
+ | (cd $$dir ; tar -x -f -)
+ cd $(curdir)
+
+ # Build the other two subdirectories of 'tex/' that we need in the
+ # archive (in the actual project, these are symbolic links to the
+ # build directory).
+ mkdir $$dir/tex/tikz $$dir/tex/build
+
+ # Copy the 'tex/build' directory into the archive (excluding the
+ # temporary archive directory that we are now copying to). We will
+ # be using Bash's extended globbing ('extglob') for excluding this
+ # directory.
shopt -s extglob
- cp -r tex/src $$dir/tex/src
- cp -r tex/img $$dir/tex/img
- cp tex/tikz/*.eps $$dir/tex/tikz
- cp -r reproduce/* $$dir/reproduce
+ cp -r tex/img $$dir/tex/img
+ cp tex/tikz/*.eps $$dir/tex/tikz
cp -r tex/build/!($(project-package-name)) $$dir/tex/build
- # Clean up un-necessary/local files: 1) the $(texdir)/build*
- # directories (when building in a group structure, there will be
- # `build-user1', `build-user2' and etc), are just temporary LaTeX
- # build files and don't have any relevant/hand-written files in
- # them. 2) The `LOCAL.conf' and `gnuastro-local.conf' files just
- # have this machine's local settings and are irrelevant for anyone
- # else.
+ # Clean up the $(texdir)/build* directories in the archive (when
+ # building in a group structure, there will be `build-user1',
+ # `build-user2' and etc). These are just temporary LaTeX build
+ # files and don't have any relevant/hand-written files in them.
rm -rf $$dir/tex/build/build*
- rm $$dir/reproduce/software/config/LOCAL.conf
- rm $$dir/reproduce/analysis/config/gnuastro/gnuastro-local.conf
+
+ # If the project has any PDFs in its 'tex/tikz' directory (TiKZ or
+ # PGFPlots was used to generate them), copy them too.
+ if ls tex/tikz/*.pdf &> /dev/null; then
+ cp tex/tikz/*.pdf $$dir/tex/tikz
+ fi
# When submitting to places like arXiv, they will just run LaTeX
# once and won't run `biber'. So we need to also keep the `.bbl'
@@ -474,3 +494,14 @@ $(mtexdir)/initialize.tex: | $(mtexdir)
# Zenodo identifier (necessary for download link):
v=$$(echo $(metadata-doi-zenodo) | sed -e's/\./ /g' | awk '{print $$NF}')
echo "\newcommand{\projectzenodoid}{$$v}" >> $@
+
+ # Calculate the latest Maneage commit used to build this
+ # project:
+ # - The '--dirty' option (used in 'project-commit-hash') isn't
+ # applicable to "commit-ishes" (direct quote from Git's error
+ # message!).
+ # - The project may not have the 'maneage' branch (for example
+ # after cloning from a fork that didn't include it!). In this
+ # case, we'll just return the string a clear string.
+ v=$$(git describe --always --long maneage) || v=maneage-ref-missing
+ echo "\newcommand{\maneageversion}{$$v}" >> $@
diff --git a/reproduce/analysis/make/paper.mk b/reproduce/analysis/make/paper.mk
index 90d71c1..2c08847 100644
--- a/reproduce/analysis/make/paper.mk
+++ b/reproduce/analysis/make/paper.mk
@@ -115,7 +115,13 @@ $(texbdir)/paper.bbl: tex/src/references.tex $(mtexdir)/dependencies-bib.tex \
export TEXINPUTS=$$p:
cd $(texbdir);
- # Note: the option '-shell-escape' is "normally disallowed for
+ # Delete any possibly existing target (a '.bbl' file) to avoid
+ # complications with LaTeX being run before the command that
+ # generates it. Otherwise users will have to manually delete
+ # it. It will be built anyway once this rule is done.
+ rm -f $@
+
+ # The pdflatex option '-shell-escape' is "normally disallowed for
# security reasons" according to the `info pdflatex' manual, but
# is enabled here in order to allow the use of PGFPlots. If you
# do not use PGFPlots, then you should remove the `-shell-escape'
diff --git a/reproduce/analysis/make/verify.mk b/reproduce/analysis/make/verify.mk
index dd224d6..fe828dd 100644
--- a/reproduce/analysis/make/verify.mk
+++ b/reproduce/analysis/make/verify.mk
@@ -22,7 +22,7 @@
# Verification functions
# ----------------------
#
-# These functions are used by the final rule in this Makefil
+# These functions are used by the final rule in this Makefile
verify-print-error-start = \
echo; \
echo "VERIFICATION ERROR"; \
@@ -87,7 +87,7 @@ verify-txt-no-comments-no-space = \
# -------------------------------------------
#
# This is the FINAL analysis step (before going onto the paper. Please use
-# this step to veryify the contents of the figures/tables used in the paper
+# this step to verify the contents of the figures/tables used in the paper
# and the LaTeX macros generated from all your processing. It should depend
# on all the LaTeX macro files that are generated (their contents will be
# checked), and any files that go into the tables/figures of the paper