fab.tools.category#

This simple module defines an Enum for all allowed categories.

Classes

Category(name[, value])

This class defines the allowed tool categories.

CategoryMeta

A meta class for a simple, enum-like Category class, that provides an API to allow to iterate over all categories.

class fab.tools.category.CategoryMeta#

A meta class for a simple, enum-like Category class, that provides an API to allow to iterate over all categories.

class fab.tools.category.Category(name, value=None)#

This class defines the allowed tool categories. It presents an interface similar to a Python enum, but it allows to extend an enum.

A enum is created by just creating an instance, e.g.: Category(“PSYCLONE”) (and it is checked that all names are unique). This will create Category.PSYCLONE. It also allows iterating over all categories, e.g. for cat in Categories.

Creates the instance, and also sets it as class attribute of the Category class. The value parameter is only required for pickling (which is used when starting sub-processes)/

Parameters:
  • name (str) – The name of the category to create, which will also become an attribute of Category.

  • value (int | None) – the integer value (which will be set in __new__, and is otherwise required for pickling only). (default: None)

static add(name)#

Adds a new category.

Return type:

None

property name: str#

Compatibility to enum feature:

Returns:

the name of this Category as string.

property is_compiler: bool#
Returns:

if this Category is a Fortran or C compiler.