Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'u/soehms/knotinfo' of git://trac.sagemath.org/sage into…
Browse files Browse the repository at this point in the history
… knotinfo_30352
  • Loading branch information
soehms committed Nov 7, 2020
2 parents acddc12 + 092cd4c commit b5c0b1a
Show file tree
Hide file tree
Showing 13 changed files with 3,440 additions and 4 deletions.
35 changes: 35 additions & 0 deletions build/pkgs/database_knotinfo/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
database_knotinfo
=================

Description
-----------

Database for named knots and links provided at

https://knotinfo.math.indiana.edu/

and

https://linkinfo.sitehost.iu.edu'

Dependencies
------------

- Sage library

Changelog
---------

- 20200713 (Sebastian Oehms, 13 Juli 2020, :trac:`30352`, initial version)

The tarball has been created from the both download files at the
given date:

``knotinfo_data_complete.xls``
``linkinfo_data_complete.xlsx``

exporting them to CSV via LibreOffice.

The second file has been changed manually deleting one character:
a trailing "}" occuring in the homfly_polynomial column of the last
link ``L11n459{1,1,1}``.
5 changes: 5 additions & 0 deletions build/pkgs/database_knotinfo/checksums.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tarball=knotinfo-20200713.tar.bz2
sha1=ec6c8436d5565fdd140cd3e4b301d215cd62b0d0
md5=1d84f176290bdd3a752757242512fca2
cksum=3419853512
upstream_url=https://trac.sagemath.org/raw-attachment/ticket/30352/knotinfo-20200713.tar.bz2
5 changes: 5 additions & 0 deletions build/pkgs/database_knotinfo/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
| $(SAGERUNTIME)

----------
All lines of this file are ignored except the first.
It is copied by SAGE_ROOT/build/make/install into SAGE_ROOT/build/make/Makefile.
1 change: 1 addition & 0 deletions build/pkgs/database_knotinfo/package-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20200713
10 changes: 10 additions & 0 deletions build/pkgs/database_knotinfo/spkg-check.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd $SAGE_ROOT/src/sage/

echo "Testing databases/knotinfo_db.py"
sage -t --optional="sage,database_knotinfo" databases/knotinfo_db.py || sdh_die "Error testing KnotInfo databases"

echo "Testing knots/knotinfo.py"
sage -t --optional="sage,database_knotinfo" knots/knotinfo.py || sdh_die "Error testing KnotInfo funcionality"

echo "Testing knots/link.py"
sage -t --optional="sage,database_knotinfo" knots/link.py || sdh_die "Error testing KnotInfo funcionality"
21 changes: 21 additions & 0 deletions build/pkgs/database_knotinfo/spkg-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
INSTALL="yes"
TARGET="${SAGE_SHARE}/knotinfo"
VERSION=`cat package-version.txt`
if [ -d $TARGET ]
then
diff package-version.txt $TARGET > /dev/null 2>&1
if [ $? -eq 0 ]
then
INSTALL="no"
echo "Version $VERSION of knotinfo already installed"
else
OLD_VERSION=`cat $TARGET/package-version.txt`
echo "Removing former version $OLD_VERSION of knotinfo"
rm -rf $TARGET
fi
fi

if [ "$INSTALL" = "yes" ]
then
exec sage-python23 spkg-install.py
fi
15 changes: 15 additions & 0 deletions build/pkgs/database_knotinfo/spkg-install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os
from sage.all import save
from sage.env import SAGE_SHARE
from sage.misc.misc import sage_makedirs
from sage.databases.knotinfo_db import KnotInfoDataBase

install_root = os.path.join(SAGE_SHARE, 'knotinfo')

if __name__ == '__main__':
sage_makedirs(install_root)
print("Creating the KnotInfo database.")
ki_db = KnotInfoDataBase()
ki_db.create_col_dict_sobj()
ki_db.create_data_sobj()
os.system('cp package-version.txt %s' %install_root)
1 change: 1 addition & 0 deletions build/pkgs/database_knotinfo/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optional
1 change: 1 addition & 0 deletions src/doc/en/reference/databases/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ database engine.
sage/databases/cunningham_tables
sage/databases/db_class_polynomials
sage/databases/db_modular_polynomials
sage/databases/knotinfo_db

.. include:: ../footer.txt
1 change: 1 addition & 0 deletions src/doc/en/reference/knots/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ Knot Theory

sage/knots/knot
sage/knots/link
sage/knots/knotinfo

.. include:: ../footer.txt
Loading

0 comments on commit b5c0b1a

Please sign in to comment.