compas.plugins.pluggable(pluggable_method=None, category=None, selector='first_match', domain='')[source]

Decorator to mark a method as a pluggable extension point.

A pluggable interface is uniquely identifiable/locatable via a URL derived from the parameters domain, category and name pluggable_method. In the example below, the URL of the pluggable definition is:
  • pluggable_method (callable) – The method to decorate as pluggable.

  • category (str, optional) – An optional string to group or categorize extension points.

  • selector (str, optional) – String that determines the selection mode of extension points.

    • "first_match": (str) Execute the first matching implementation.

    • "collect_all": (str) Executes all matching implementations and return list of its return values.

  • domain (str, optional) – Domain name that “owns” the pluggable extension point. This is useful to avoid name collisions between extension points of different packages.


>>> @pluggable(category='triangulation')
... def triangulate_mesh(mesh):
...    pass