Custom Types

Warning

This module is under active development and may change significantly in future versions.

class s2.graph.PaperId

A valid S2 Paper Identifier string.

class s2.graph.AuthorId

A valid S2 Author Identifier string.

class s2.graph.S2PaperMap

MutableMapping of PaperId to S2Paper.

It is recommended to use objects of type s2.store.S2DataStore, but for rapid prototyping this can be a simple dictionary.

class s2.graph.S2AuthorMap

MutableMapping of AuthorId to S2Author.

It is recommended to use objects of type s2.store.S2DataStore, but for rapid prototyping this can be a simple dictionary.

class s2.graph.EdgeType

Either of ‘references’, ‘citations’, or ‘author’.

class s2.graph.EdgeMeta

Dict for storing any additional edge meta-information.

class s2.graph.Neighbours

MutableMapping of EdgeType to list of (PaperId, EdgeMeta) tuples for neighbouring papers.

class s2.graph.EdgeMap

MutableMapping of PaperId to Neighbours.

class s2.graph.HopFrom

Tuple of PaperId (the paper being hopped from) and EdgeType (the type of the edge being hopped across)

class s2.graph.HopTo

Tuple of PaperId (the paper being hopped to) and EdgeType (the type of the edge being hopped across).

Note that unlike HopFrom, the edge type can be None if the paper “being hopped to” is actually the first paper being visited (i.e. without any edge traversal).

class s2.graph.GraphPath

List of HopTo for the path traversed in a S2Graph.