3.1.2. Config

3.1.2.1. Class LabelType

class mod.LabelType

Selector for which type of label to use in algorithms.

String

Vertices and edges are considered to be labelled with character strings. If only first-order terms are present, then strings are generated as a serialisation of the term.

Term

Vertices and edges are considered to be labelled with first-order terms. If only strings are present, then first-order terms are generated by parsing the strings. This may result in an TermParsingError if a string can not be parsed.

3.1.2.2. Class LabelRelation

class mod.LabelRelation

Selector for which type of labelled morphism to use in an algorithm. For strings they are all defined to be equivalent to string equality.

Isomorphism

Terms are considered isomorphic when their most general unifier is a renaming.

Specialisation

A term \(t_2\) is more special than, or isomorphic to, a term \(t_1\) if there is a substitution which can be applied to :math: t_1 to make the terms equal. This relation means that the right-hand side of a comparison is the more specialised term.

Unification

Terms unify if a most general unifier (MGU) exists. The found MGU is used for substitution in some algorithms.

3.1.2.3. Class LabelSettings

class mod.LabelSettings

A group label settings commonly used together in algorithms.

__init__(self, type, relation)
__init__(self, type, relation, stereoRelation)
__init__(self, type, relation, withStereo, stereoRelation)

Construct label settings that only uses at least the vertex and edge labels. If stereoRelation is given but withStereo is not, then withStereo defaults to True.

Parameters
  • type (LabelType) – How to interpret labels.

  • relation (LabelRelation) – The relation that should hold in morphisms between two labels.

  • withStereo (bool) – A flag to specify if stereo information should be included. Defaults to False, unless stereoRelation is gieven, then True.

  • stereoRelation (LabelRelation) – The relation that should hold in morphisms between stereo data. Defaults to LabelRelation.Isomorphism, but is only used when withStereo is True.

type
Type

LabelType

relation
Type

LabelRelation

withStereo
Type

bool

stereoRelation
Type

LabelRelation

3.1.2.4. Class IsomorphismPolicy

class mod.IsomorphismPolicy

For some functions there is a choice of how to handle given arguments where two different objects may be isomorphic. Most notably the case is with graphs (Graph).

Check

Objects are checked for isomorphism as needed and exceptions are thrown when different objects are isomorphic. If in doubt, use this.

TrustMe

No checks are performed and the function trusts the caller to have performed the equivalent isomorphism checks. Only use this when you are completely sure that no exceptions would have been thrown if using Check.

Warning

Generally the library has undefined behaviour if you use this option but an exception would have been thrown with Check.

3.1.2.5. Class SmilesClassPolicy

class mod.SmilesClassPolicy

When loading SMILES strings, the class labels can be recorded and mapped into the corresponding vertices of the loaded graph. This policy dictates what should happen when the same class label is written on multiple atoms.

AllOrNone

If a class label is duplicated, then no labels are mapped to vertices.

ThrowOnDuplicate

If a class label is duplicated, throw a InputError.

MapUnique

Map all class labels that are unique to vertices.

mod.getAvailableILPSolvers()
Returns

a list of solver names for which bindings are available in the current installation. See getAvailableILPSolvers() for details.

Return type

list[str]

3.1.2.6. Class Config

class mod.Config

This class contains a range of inner classes of config settings. See the libMØD documentation.

mod.config

This variable is initialised to the return value of getConfig(), i.e., just use this instead of the method.

mod.getConfig()
Returns

the singleton Config instance used by the library.