.. _py-Config: ********************************************************** Config ********************************************************** .. default-domain:: py .. py:currentmodule:: mod .. cpp:namespace:: mod Class ``LabelType`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: LabelType Selector for which type of label to use in algorithms. .. py:attribute:: 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. .. py:attribute:: 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 :py:class:`TermParsingError` if a string can not be parsed. Class ``LabelRelation`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: 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. .. py:attribute:: Isomorphism Terms are considered isomorphic when their most general unifier is a renaming. .. py:attribute:: Specialisation A term :math:`t_2` is more special than, or isomorphic to, a term :math:`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. .. py:attribute:: Unification Terms unify if a most general unifier (MGU) exists. The found MGU is used for substitution in some algorithms. Class ``LabelSettings`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: LabelSettings A group label settings commonly used together in algorithms. .. py:method:: __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``. :param LabelType type: How to interpret labels. :param LabelRelation relation: The relation that should hold in morphisms between two labels. :param bool withStereo: A flag to specify if stereo information should be included. Defaults to ``False``, unless ``stereoRelation`` is gieven, then ``True``. :param LabelRelation stereoRelation: The relation that should hold in morphisms between stereo data. Defaults to :py:class:`LabelRelation.Isomorphism`, but is only used when ``withStereo`` is ``True``. .. py:attribute:: type :type: LabelType .. py:attribute:: relation :type: LabelRelation .. py:attribute:: withStereo :type: bool .. py:attribute:: stereoRelation :type: LabelRelation Class ``IsomorphismPolicy`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: 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 (:class:`Graph`). .. py:attribute:: Check Objects are checked for isomorphism as needed and exceptions are thrown when different objects are isomorphic. If in doubt, use this. .. py:attribute:: 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 :attr:`Check`. .. warning:: Generally the library has undefined behaviour if you use this option but an exception would have been thrown with :attr:`Check`. Class ``SmilesClassPolicy`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: 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. .. py:attribute:: AllOrNone If a class label is duplicated, then no labels are mapped to vertices. .. py:attribute:: ThrowOnDuplicate If a class label is duplicated, throw a :class:`InputError`. .. py:attribute:: MapUnique Map all class labels that are unique to vertices. .. py:function:: getAvailableILPSolvers() :returns: a list of solver names for which bindings are available in the current installation. See :cpp:func:`getAvailableILPSolvers` for details. :rtype: list[str] Class ``Config`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: Config This class contains a range of inner classes of config settings. See :doc:`the libMØD documentation`. .. py:data:: config This variable is initialised to the return value of :py:func:`getConfig`, i.e., just use this instead of the method. .. py:method:: getConfig() :returns: the singleton :cpp:class:`Config` instance used by the library.