From 4e8192fa66413d3eb77035f112253a859a99f29a Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 12 May 2021 05:26:21 -0400 Subject: [PATCH] A few more tests --- mathics/packages/KnotTheory/IndianaData.m | 15 ++++++++------- test/test_knottheory.py | 12 ++++++++++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/mathics/packages/KnotTheory/IndianaData.m b/mathics/packages/KnotTheory/IndianaData.m index 948913c32c..6edff0d317 100644 --- a/mathics/packages/KnotTheory/IndianaData.m +++ b/mathics/packages/KnotTheory/IndianaData.m @@ -1,18 +1,19 @@ (* Script generated - do not edit *) (* Data from http://www.indiana.edu/~knotinfo/ *) - - BeginPackage["KnotTheory`IndianaData`", {"KnotTheory`"}] - Message[KnotTheory::loading, "IndianaData`"] - + +BeginPackage["KnotTheory`IndianaData`"] +(* Needs["KnotTheory`"] *) +Message[KnotTheory::loading, "IndianaData`"] + {BraidIndex, BridgeIndex, NakanishiIndex, SuperBridgeIndex, SymmetryType, ThreeGenus, UnknottingNumber} - Begin["`Private`"] - +Begin["`Private`"] + SD[K_, data_] := MapThread[ (#1[K] = #2)&, {fields, data /. NA -> NotAvailable} ] - + fields = {BraidIndex, BridgeIndex, NakanishiIndex, SuperBridgeIndex, SymmetryType, ThreeGenus, UnknottingNumber} SD[Knot[0, 1], {1, 1, NA, NA, "", 0, 0}] diff --git a/test/test_knottheory.py b/test/test_knottheory.py index 9dc48aa18b..44e94fa8a1 100644 --- a/test/test_knottheory.py +++ b/test/test_knottheory.py @@ -4,8 +4,6 @@ from .helper import evaluate, check_evaluation -import pytest - evaluate( """ Needs["KnotTheory`"] @@ -24,6 +22,16 @@ def test_knottheory(): ) for str_expr, str_expected in ( (r"Crossings[K]", "6"), + # ("PD[BR[4, {-1, 2, 3, -2, -1}]]", + # "D[X[8, 2, 3, 1], X[10, 4, 9, 3], X[5, 5, 6, 4], X[9, 6, 10, 7], X[1, 7, 2, 8]]"), + ("BR[TorusKnot[5, 4]]", + "BR[4, {1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3}]", + ), + ("Crossings[TorusKnot[5, 4]]", + "15"), + ("Crossings[TorusKnot[20, 34]]", + "660"), + # ("SymmetryType[Knot[4, 1]]", "FullyAmphicheiral"), # ( # "ColouredJones[Knot[4, 1], 3][q]", # """3 + 1 / q ^ 12 - 1 / q ^ 11 - 1 / q ^ 10