Skip to content

Commit

Permalink
A few more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed May 12, 2021
1 parent 082dead commit 4e8192f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
15 changes: 8 additions & 7 deletions mathics/packages/KnotTheory/IndianaData.m
Original file line number Diff line number Diff line change
@@ -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}]
Expand Down
12 changes: 10 additions & 2 deletions test/test_knottheory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from .helper import evaluate, check_evaluation

import pytest

evaluate(
"""
Needs["KnotTheory`"]
Expand All @@ -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
Expand Down

0 comments on commit 4e8192f

Please sign in to comment.