PeriodicCell

Tools for working with a periodic cell of spacecurves.

API documentation

class pyknotid.spacecurves.periodiccell.Cell(lines, shape, periodic=True, cram=False, downsample=None)[source]

Bases: object

Class for holding the vertices of some number of lines with periodic boundary conditions.

Parameters:
  • lines (list) – Must be a list of Knots or ndarrays of vertices.
  • shape (tuble or int) – The shape of the cell, in whatever units the lines use.
  • periodic (bool) – Whether the cell is periodic. If True, lines are marked as ‘nth’ or ‘loop’ in self.line_types. Defaults to True.
classmethod from_qwer(qwer, shape, **kwargs)[source]

Returns an instance of Cell from a quartet of differently classified lines in periodic boundaries.

Parameters:
  • qwer (tuple) – Should be a 4-tuple of lists q, w, e, r. q is closed loops, w is lines with non-trivial homology, e is lines that terminate on the boundaries of the cell, r is any remaining (unclassified) lines.
  • shape (int or tuple) – The size of the cell along each axis. If a single number is passed, all axes are assumed to be the same length.
linking_matrix()[source]

Get the linking numbers of each line in the cell with every other.

smooth(repeats=1, window_len=10)[source]

Smooth each line in the curve, equivalent to smooth().