Package schrodinger :: Package application :: Package bioluminate :: Module propfilter :: Class StringDatabaseCriterion
[hide private]
[frames] | no frames]

Class StringDatabaseCriterion

object --+
         |
        StringDatabaseCriterion
Known Subclasses:

Holds a criterion for a string property and determines whether a database object or structure meets that criterion

Instance Methods [hide private]
 
__init__(self, dataname, username, criteria, joiner='')
Create a StringDatabaseCriterion object
 
__str__(self)
str(x)
bool
checkForMatch(self, obj_val, operator, goal, isCaseSensitive=False)
Check to see if a value matches this criterion.
bool
matches(self, dbobj=None, struct=None, stem='bioluminate', isCaseSensitive=False)
Checks to see if a schrodinger.application.prime.packages.PrimeStructureDatabase.PrimeStructureDBEntry database object or a schrodinger.structure.Structure object matches this Criterion.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, dataname, username, criteria, joiner='')
(Constructor)

 

Create a StringDatabaseCriterion object

Parameters:
  • dataname (str) - The internal name of the property this criterion checks. The dataname is of the form x_y_z.
  • username (str) - The name the user sees for this property
  • criteria (list of tuple) - List of one or two criterion. Each criterion is a tuple consisting of (operator, value). operator is some relationship defined by the constants in this module, and value is the target value. For instance, in property > 5, '>' is the operator and 5 is the value. Operator constants are:
    • EQUALS
    • NOT_EQUALS
    • CONTAINS
    • STARTSWITH
    • ENDSWITH
    • NOT_CONTAINS
    • EXISTS
    • NOT_EXISTS
    • SELECT
    • GREATEREQUAL
    • LESSEREQUAL
    • GREATER
    • LESSER
    • IS_TRUE
    • IS_FALSE

    For the SELECT operator, value can be a list of values. A property that matches any one of those values exactly matches the criterion.

  • joiner (str) - If two criteria are provided, joiner is the boolean that connects them - either AND or OR. Default is the empty string, which means that only the first criterion in the criteria list will be examined.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

checkForMatch(self, obj_val, operator, goal, isCaseSensitive=False)

 

Check to see if a value matches this criterion. Returns True if:

   "obj_val operator goal"  ("Schrodinger contains odin" returns True)
Parameters:
  • obj_val (str) - The value being checked
  • operator (str) - An operator as defined in the __init__ method criteria paramater.
  • goal (str or list) - The value to compare against, or in the case of the SELECT operator, goal is a list of str
  • isCaseSensitive (bool)
Returns: bool
True if "obj_val operator goal" is True, False if not
Raises:
  • ValueError - if operator is not recognized

matches(self, dbobj=None, struct=None, stem='bioluminate', isCaseSensitive=False)

 

Checks to see if a schrodinger.application.prime.packages.PrimeStructureDatabase.PrimeStructureDBEntry database object or a schrodinger.structure.Structure object matches this Criterion.

Parameters:
  • dbobj (schrodinger.application.prime.package.PrimeStructureDatabase.PrimeStructureDBEntry) - The database object to check for a match. Only dbobj or struct should be provided, but not both. If both are provided, the struct object is checked and the dbobj is ignored.
  • struct (schrodinger.structure.Structure) - The Structure object to check for a match. Only dbobj or struct should be provided, but not both. If both are provided, the struct object is checked and the dbobj is ignored.
  • stem (str) - If given, this value will be inserted at the beginning of the second part of the Criterion property name when checking a struct object. Property x_y_z will become x_stemy_z. Default is 'bioluminate'. This is done because the database removes stem from property names when storing data.
  • isCaseSensitive (bool)
Returns: bool
True if the provided object passes this Criterion, False if not.