22:import numpy as n
23:import numpy as np
24:import sys
27:    from pyknotid.spacecurves import chelpers
29:    print('Could not import cythonised chelpers, using Python '
====
'''
This module provides functions for creating knotted or linked space
curves, for inspection or use as examples.

All knot creating functions are available in the pyknotid.make
namespace, although they are distributed amongst other modules as below.

'''
# from pyknotid.make import knot
# from pyknotid.make import randomwalks

# from pyknotid.make.ideal import available_ideal_knots, ideal_knot
from pyknotid.make.torus import torus_knot, torus_link
from pyknotid.make.named import *
__init__.py
named.py
periodic_knot.py
torus.py
====

import pyknotid.spacecurves.knot as spknot
import pyknotid.make as mk

from functools import wraps
import os
from os import path

import numpy as np

import pytest

def pass_trefoil(func):
    def new_func():
        return func(spknot.Knot(mk.trefoil()))
    return new_func

@pass_trefoil
def test_invariants(k):
    assert k.determinant() == 3
    assert k.alexander_at_root((2,3,4)) == [3, 2, 1]
    assert k.vassiliev_degree_2() == 1
    assert k.vassiliev_degree_3() == -1


@pass_trefoil
def test_identify(k):
    try:
        import pyknotid.spacecurves.chelpers
    except ImportError:
        return  # chelpers not installed
====


import pyknotid.spacecurves.spacecurve as sp
import pyknotid.make as mk

from functools import wraps
import os
from os import path

import numpy as np

import pytest

def pass_trefoil(func):
    def new_func():
        return func(sp.SpaceCurve(mk.trefoil()))
    return new_func


@pass_trefoil
def test_init(k):
    pass

@pass_trefoil
def test_copy(k):
    k2 = k.copy()
    assert np.all(k2.points == k.points)
    assert k2.points is not k.points

@pass_trefoil
def test_points(k):
    assert isinstance(k.points, np.ndarray)

@pass_trefoil
def test_translate(k):
    pos = k.points[0]
    k.translate([10., 20., 30.])
    new_pos = k.points[0]

    assert new_pos[0] - pos[0] == 10.
