sMPA package

Submodules

sMPA.pajekUtil module

sMPA.pathTopic module

sMPA.pathTopicTem module

sMPA.queue_set module

This code provides a series of utilities for queue operation

class sMPA.queue_set.Queue_Set

Bases: object

get()

pop an element from the queue

Returns

an element of any type

Return type

elment

getSize()

return size of queue

Returns

Return type

int

isEmpty()

judge if the queue is empty

Returns

Return type

boolean

put(i)

add an element into the queue

Parameters

i – element of any type

Returns

indicates whether this operation is successfully done

Return type

boolean

sMPA.semanticRoadMap module

sMPA.xgmml module

sMPA.xgmml.addEdge(fid, source, target, ID, Label='', directed='1', SourceArrowShape='ARROW', TargetArrowShape='ARROW', SourceArrowColor='#000000', TargetArrowColor='#000000', LineType='SOLID', LineWidth=2.0, LineColor='#333333')

addEdge Add the content of a new edge to an XGMML file.

Parameters
  • fid (file) – The file handle of the XGMML file.

  • source (int) – The start node of the edge.

  • target (int) – The end node of the edge.

  • ID (int) – The ID of the edge, which must be special.

  • Label (str) – The label of the edge, which will be present on the graph but not necessarily special.

  • directed (str) – Whether the edge is directed.

  • SourceArrowShape (str) – The shape of the source arrow. {‘ARROW’,’DELTA’,’CIRCLE’,’HALF_BOTTOM’,’DIAMOND’,’HALF_TOP’,’NONE’,’T’}

  • TargetArrowShape (str) – The shape of the target arrow. {‘ARROW’,’DELTA’,’CIRCLE’,’HALF_BOTTOM’,’DIAMOND’,’HALF_TOP’,’NONE’,’T’}

  • SourceArrowColor (str) – The color of the source arror. (unselected)

  • TargetArrowColor (str) – The color of the target arrow. (unselected)

  • LineType (str) – The presented type of the line. {‘SOLID’,’DASHDOT’,’ZIGZAG’,’FORWARD_SLASH’,’SINEWAVE’,’SEPARATE_ARROW’, ‘BACKWARD_SLASH’,’EQUAL_DASH’,’PARALLEL_LINES’,’DASH’,’VERTICAL_SLASH’, ‘CONTIGUOUS_ARROW’,’DOTS’}

  • LineWidth (float) – The width of the line.

  • LineColor (str) – The color of the line.

Returns

True

Return type

boolean

sMPA.xgmml.addHead(fid, GraphID)

Add the head content of an XGMML file to a file handle.

Parameters
  • fid (file) – The file handle of the XGMML file.

  • GraphID (str) – The name of the graph.

Returns

True

Return type

boolean

sMPA.xgmml.addNode(fid, Label, ID, fill='#ff0000', shape='ELLIPSE', x=0.0, y=0.0, w=35.0, h=35.0, FontSize=15, LabelColor='#000000', Transparency=255, LabelPosition='C,C,c,0,0')

Add the content of a new node to an XGMML file.

Parameters
  • fid (file) – The file handle of the XGMML file.

  • Label (str) – The label of the node.

  • ID (int) – ID of the node.

  • fill (str) – The color of the node.

  • shape (str) – The shape of the node. {‘ELLIPSE’,’ROUND_RECTANGLE’,’TRIANGLE’,’DIAMOND’, ‘PARALLELOGRAM’,’HEXAGON’,’RECTANGLE’,’OCTAGON’,’V’}

  • y (x &) – The coordinates of the node.

  • h (w &) – The width and height of the node.

  • FontSize (int) – The font size of the label.

  • LabelColor (str) – The color of the label.

  • Transparency (int) – The transparency of the node.

  • LabelPosition (str) – The label position.

Returns

True

Return type

boolean

Module contents