OpenQuizz
Une application de gestion des contenus pédagogiques
Resolver Class Reference
Inheritance diagram for Resolver:
Collaboration diagram for Resolver:

Public Member Functions

def resolve (self, requirements, max_rounds=100)
 
- Public Member Functions inherited from AbstractResolver
def __init__ (self, provider, reporter)
 
def resolve (self, requirements, **kwargs)
 

Static Public Attributes

 base_exception
 
- Static Public Attributes inherited from AbstractResolver
 base_exception
 

Additional Inherited Members

- Data Fields inherited from AbstractResolver
 provider
 
 reporter
 

Detailed Description

The thing that performs the actual resolution work.

Member Function Documentation

◆ resolve()

def resolve (   self,
  requirements,
  max_rounds = 100 
)
Take a collection of constraints, spit out the resolution result.

The return value is a representation to the final resolution result. It
is a tuple subclass with three public members:

* `mapping`: A dict of resolved candidates. Each key is an identifier
    of a requirement (as returned by the provider's `identify` method),
    and the value is the resolved candidate.
* `graph`: A `DirectedGraph` instance representing the dependency tree.
    The vertices are keys of `mapping`, and each edge represents *why*
    a particular package is included. A special vertex `None` is
    included to represent parents of user-supplied requirements.
* `criteria`: A dict of "criteria" that hold detailed information on
    how edges in the graph are derived. Each key is an identifier of a
    requirement, and the value is a `Criterion` instance.

The following exceptions may be raised if a resolution cannot be found:

* `ResolutionImpossible`: A resolution cannot be found for the given
    combination of requirements. The `causes` attribute of the
    exception is a list of (requirement, parent), giving the
    requirements that could not be satisfied.
* `ResolutionTooDeep`: The dependency tree is too deeply nested and
    the resolver gave up. This is usually caused by a circular
    dependency, but you can try to resolve this by increasing the
    `max_rounds` argument.

Field Documentation

◆ base_exception

base_exception
static

The documentation for this class was generated from the following file: