summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/NEWS12
-rw-r--r--debian/changelog33
-rw-r--r--debian/compat1
-rw-r--r--debian/control53
-rw-r--r--debian/copyright28
-rw-r--r--debian/libphat-dev.install1
-rw-r--r--debian/patches/0001-Don-t-force-CMAKE_BUILD_TYPE-Release.patch23
-rw-r--r--debian/patches/series1
-rw-r--r--debian/phat-utils.install1
-rw-r--r--debian/phat-utils.manpages1
-rw-r--r--debian/phat.140
-rwxr-xr-xdebian/rules13
-rw-r--r--debian/source/format1
-rw-r--r--debian/source/lintian-overrides0
-rw-r--r--debian/tests/control7
-rwxr-xr-xdebian/tests/python.py46
-rwxr-xr-xdebian/tests/python.sh11
-rw-r--r--debian/tests/reference/single_triangle.txt4
-rwxr-xr-xdebian/tests/utils.sh32
-rw-r--r--debian/watch3
20 files changed, 311 insertions, 0 deletions
diff --git a/debian/NEWS b/debian/NEWS
new file mode 100644
index 0000000..663e37e
--- /dev/null
+++ b/debian/NEWS
@@ -0,0 +1,12 @@
+phat (1.5-3) unstable; urgency=medium
+
+ This NEWS entry describes a change introduced in version 1.5-1 of the package,
+ but the entry was only added in -3.
+
+ An entirely unrelated "phat" source package existed in the Debian archives
+ from 2005 to 2014, before being removed in bug #751276. The current source
+ and binary reuse the package name, given the fact that the old package was
+ abandoned upstream (and so is unlikely to reappear), and the long gap between
+ removal of the old and addition of the new package.
+
+ -- Gard Spreemann <gspr@nonempty.org> Thu, 15 Aug 2019 10:56:51 +0200 \ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..4e3ddef
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,33 @@
+phat (1.5-5) unstable; urgency=medium
+
+ * Allow tests to output to stderr without causing failure.
+
+ -- Gard Spreemann <gspr@nonempty.org> Sat, 14 Mar 2020 11:19:04 +0100
+
+phat (1.5-4) unstable; urgency=medium
+
+ * Add tests.
+ * Standards-version 4.5.0. No changes needed.
+
+ -- Gard Spreemann <gspr@nonempty.org> Fri, 13 Mar 2020 13:57:54 +0100
+
+phat (1.5-3) unstable; urgency=medium
+
+ * Add NEWS entry describing reused package name.
+
+ -- Gard Spreemann <gspr@nonempty.org> Thu, 15 Aug 2019 11:05:29 +0200
+
+phat (1.5-2) unstable; urgency=medium
+
+ * Standards-version 4.4.0.1. No changes needed.
+ * Update maintainer email address.
+ * Re-upload as source-only.
+ * Remove Lintian override that's no longer needed.
+
+ -- Gard Spreemann <gspr@nonempty.org> Thu, 15 Aug 2019 09:36:51 +0200
+
+phat (1.5-1) unstable; urgency=medium
+
+ * Initial release (Closes: #920912)
+
+ -- Gard Spreemann <gspreemann@gmail.com> Wed, 20 Feb 2019 13:03:51 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..48082f7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+12
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..319f160
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,53 @@
+Source: phat
+Maintainer: Gard Spreemann <gspr@nonempty.org>
+Section: math
+Priority: optional
+Standards-Version: 4.5.0
+Build-Depends: cmake,
+ debhelper (>= 12),
+ dh-python,
+ python3-all-dev,
+ python3-pybind11,
+ python3-setuptools
+Rules-Requires-Root: no
+Homepage: https://bitbucket.org/phat-code/phat
+Vcs-Browser: https://git.nonempty.org/debian-phat
+Vcs-Git: https://git.nonempty.org/debian-phat -b debian/sid
+
+Package: libphat-dev
+Section: libdevel
+Architecture: all
+Multi-Arch: foreign
+Depends: ${misc:Depends}
+Suggests: phat-utils
+Description: C++ library for boundary matrix reductions over Z/2Z
+ PHAT is a header-only C++ library for performing the filtered Z/2Z
+ (co)boundary matrix operations commonly needed when computing
+ (persistent) (co)homology in topological data analysis.
+ .
+ This package contains the header files. A standalone program exposing
+ some of the features is available in phat-utils.
+
+Package: phat-utils
+Section: math
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Utilities from the PHAT library
+ PHAT is a header-only C++ library for performing the filtered Z/2Z
+ (co)boundary matrix operations commonly needed when computing
+ (persistent) (co)homology in topological data analysis.
+ .
+ This package contains some standalone utilities built using the PHAT
+ library, such as persistent homology of a given filtered boundary
+ matrix.
+
+Package: python3-phat
+Section: python
+Architecture: any
+Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends}
+Description: Python 3 interface for the PHAT library
+ PHAT is a header-only C++ library for performing the filtered Z/2Z
+ (co)boundary matrix operations commonly needed when computing
+ (persistent) (co)homology in topological data analysis.
+ .
+ This package contains the library's Python 3 interface.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..1f069de
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,28 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: phat
+Source: https://bitbucket.org/phat-code/phat
+
+Files: *
+Copyright: 2013-2019 IST Austria
+License: LGPL-3+
+
+Files: debian/*
+Copyright: 2019 Gard Spreemann <gspr@nonempty.org>
+License: LGPL-3+
+
+License: LGPL-3+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3".
diff --git a/debian/libphat-dev.install b/debian/libphat-dev.install
new file mode 100644
index 0000000..7c252b1
--- /dev/null
+++ b/debian/libphat-dev.install
@@ -0,0 +1 @@
+include/phat/ usr/include/
diff --git a/debian/patches/0001-Don-t-force-CMAKE_BUILD_TYPE-Release.patch b/debian/patches/0001-Don-t-force-CMAKE_BUILD_TYPE-Release.patch
new file mode 100644
index 0000000..c8f17e8
--- /dev/null
+++ b/debian/patches/0001-Don-t-force-CMAKE_BUILD_TYPE-Release.patch
@@ -0,0 +1,23 @@
+From: Gard Spreemann <gspreemann@gmail.com>
+Date: Wed, 30 Jan 2019 13:22:13 +0100
+Subject: Don't force CMAKE_BUILD_TYPE=Release.
+
+---
+ CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1d2c34e..7417d30 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 2.8)
+
+ project("Phat")
+
+-set(CMAKE_BUILD_TYPE "Release")
++if (NOT CMAKE_BUILD_TYPE)
++ set(CMAKE_BUILD_TYPE "Release")
++endif()
+
+ INCLUDE(CheckCXXSourceCompiles)
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..1e0f266
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Don-t-force-CMAKE_BUILD_TYPE-Release.patch
diff --git a/debian/phat-utils.install b/debian/phat-utils.install
new file mode 100644
index 0000000..277b349
--- /dev/null
+++ b/debian/phat-utils.install
@@ -0,0 +1 @@
+build/phat usr/bin/ \ No newline at end of file
diff --git a/debian/phat-utils.manpages b/debian/phat-utils.manpages
new file mode 100644
index 0000000..135ffdc
--- /dev/null
+++ b/debian/phat-utils.manpages
@@ -0,0 +1 @@
+debian/phat.1
diff --git a/debian/phat.1 b/debian/phat.1
new file mode 100644
index 0000000..61478e9
--- /dev/null
+++ b/debian/phat.1
@@ -0,0 +1,40 @@
+.TH PHAT 1
+.SH NAME
+phat \- persistent homology utility from the PHAT library
+.SH SYNOPSIS
+.B phat
+[\fIoptions\fR]
+\fIinput_file\fR
+\fIoutput_file\fR
+.SH DESCRIPTION
+.B phat
+is a simple persistent homology utility built using the PHAT
+library. It reads a (filtered) boundary matrix and applies an
+algorithm of the user's choosing to compute the associated persistent
+homology module.
+.SH OPTIONS
+.TP
+.BR \-\-ascii
+Use ASCII input file.
+.TP
+.BR \-\-binary
+Use binary input file (default).
+.TP
+.BR \-\-help
+Print help screen.
+.TP
+.BR \-\-dualize
+Use dualization approach.
+.TP
+.BR \-\-vector_vector ", " \-\-vector_heap ", " \-\-vector_set ", " \-\-vector_list ", " \-\-full_pivot_column ", " \-\-sparse_pivot_column ", " \-\-heap_pivot_column ", " \-\-bit_tree_pivot_column
+Choose a matrix representation. Default is \fB\-\-bit_tree_pivot_column\fR.
+.TP
+.BR --standard ", " \-\-twist ", " \-\-chunk ", " \-\-chunk_sequential ", " \-\-spectral_sequence ", " \-\-row
+Choose a reduction algorithm. Default is \fB\-\-twist\fR.
+.SH ARGUMENTS
+.TP
+.BR input_file
+Input boundary matrix file.
+.TP
+.BR output_file
+Output file for persistence diagram.
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..d923eef
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+
+#export DH_VERBOSE = 1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export PYBUILD_NAME = phat
+
+# To avoid autodetecting upstream's CMakeFile, which doesn't build the
+# Python extension.
+export PYBUILD_SYSTEM = distutils
+
+%:
+ dh $@ --buildsystem=cmake --builddirectory=build
+ dh $@ --with python3 --buildsystem=pybuild
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/debian/source/lintian-overrides
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..613d0c7
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,7 @@
+Tests: utils.sh
+Depends: phat-utils, shunit2
+Restrictions: allow-stderr
+
+Tests: python.sh
+Depends: python3-all, python3-phat
+Restrictions: allow-stderr
diff --git a/debian/tests/python.py b/debian/tests/python.py
new file mode 100755
index 0000000..eaad48f
--- /dev/null
+++ b/debian/tests/python.py
@@ -0,0 +1,46 @@
+import phat
+
+def main():
+ files = ["single_triangle"]
+
+ for file in files:
+ ref = []
+ with open("debian/tests/reference/%s.txt" %(file), "r") as f:
+ f.readline()
+ for line in f:
+ splitline = line.strip().split(" ")
+ assert(len(splitline) == 2)
+ ref.append((int(splitline[0]), int(splitline[1])))
+ ref.sort()
+
+ cols = []
+ with open("examples/%s.dat" %(file), "r") as f:
+ for line in f:
+ if not line.startswith("#") and line.strip() != "":
+ splitline = line.rstrip().split(" ")
+ cols.append((int(splitline[0]), [int(x) for x in splitline[1:]]))
+
+ for repr in phat.representations:
+ for alg in phat.reductions:
+ for dualize in [False, True]:
+ print("File %s, representation %s, algorithm %s, dualization %s" %(file, repr, alg, str(dualize)))
+
+ bd = phat.boundary_matrix(representation=repr)
+ bd.columns = cols
+ if dualize:
+ pairs = list(bd.compute_persistence_pairs_dualized(reduction=alg))
+ else:
+ pairs = list(bd.compute_persistence_pairs(reduction=alg))
+ pairs.sort()
+
+ if ref == pairs:
+ print("OK!")
+ else:
+ print("ERROR!")
+ print("Got", pairs)
+ print("Expected", ref)
+ exit(1)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/debian/tests/python.sh b/debian/tests/python.sh
new file mode 100755
index 0000000..b66e101
--- /dev/null
+++ b/debian/tests/python.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+for py3ver in $(py3versions -vs)
+do
+ echo "Running tests with Python ${py3ver}."
+ /usr/bin/python${py3ver} -B debian/tests/python.py
+ echo "---------"
+done
+
diff --git a/debian/tests/reference/single_triangle.txt b/debian/tests/reference/single_triangle.txt
new file mode 100644
index 0000000..04ffc17
--- /dev/null
+++ b/debian/tests/reference/single_triangle.txt
@@ -0,0 +1,4 @@
+3
+1 3
+2 4
+5 6
diff --git a/debian/tests/utils.sh b/debian/tests/utils.sh
new file mode 100755
index 0000000..6798f82
--- /dev/null
+++ b/debian/tests/utils.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+files="single_triangle"
+reprs="vector_vector vector_heap vector_set vector_list full_pivot_column sparse_pivot_column heap_pivot_column bit_tree_pivot_column"
+algos="standard twist chunk chunk_sequential spectral_sequence row"
+
+oneTimeSetUp() {
+ set -u
+}
+
+parse() {
+ tail -n +2 $1 | sort
+}
+
+test() {
+ for file in $files
+ do
+ for repr in $reprs
+ do
+ for algo in $algos
+ do
+ tmpfile=$(mktemp -p $AUTOPKGTEST_TMP)
+ ( set -x; /usr/bin/phat --ascii --${repr} --${algo} examples/${file}.dat ${tmpfile} )
+ assertEquals "Non-zero return code." 0 $?
+ [ "$(parse debian/tests/reference/${file}.txt)" == "$(parse $tmpfile)" ]
+ assertEquals "Wrong result." 0 $?
+ done
+ done
+ done
+}
+
+. shunit2
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..80b57a7
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=4
+opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/phat-$1\.tar\.gz/,uversionmangle=s/-?(RC|rc)/~rc/ \
+ https://bitbucket.org/phat-code/phat/downloads/?tab=tags .*/get/v(\d\S+)\.tar\.gz \ No newline at end of file