AFLOW Database Keywords

The AFLOW database supports a fixed number of keywords related to the calculated physical properties. The generators create a sub-classed Keyword object that supports logical operations supported by the AFLUX standard.

Note

Because of the way the operators are overloaded, each comparison needs to be placed in its own set of parenthesis to ensure that the order of operators is respected correctly. See Example Queries with aflow.

The Keyword class provides the following operators:

  1. > and < behave as expected. However, these are overloaded for string comparisons in the spirit of the AFLUX endpoint. For example author < “curtarolo” will match *curtarolo and author > “curtarolo” will match `curtarolo*.
  2. == behaves as expected for all keywords.
  3. % allows for string searches. author % “curtarolo” matches *curtarolo*.
  4. ~ inverts the filter (equivalent to a boolean not).
  5. & is the logical and between two conditions.
  6. | is the logical or between two conditions.

API Documentation

Implements classes to represent each keyword with overloaded operators to make querying with AFLUX intuitive.

class aflow.keywords.Keyword(state=None)[source]

Represents an abstract keyword that can be sub-classed for a specific material attribute. This class also represents logical operators that define search queries. The combination of two keywords with a logical operator produces one more keyword, but which has its state altered.

Parameters:state (str) – current query state of this keyword (combination).
state

list – of str composite queries for this keyword (combination).

ptype

type – python type that values for this keyword will have.

name

str – keyword name to use in the AFLUX request.

cache

list – of str simple operator comparisons.

classes

set – of str keyword names that have been combined into the current keyword.

aflow.keywords.load(target)[source]

Loads all keywords into the specified target dictionary.

aflow.keywords.reset()[source]

Resets all the keyword instances internal states so that they can be re-used for a new query.