schrodinger.ui.qt.filter_dialog_dir.filter_core module¶
A simple, JSON-serializable property-based filter used by the filter_dialog module and compatible backends.
-
class
schrodinger.ui.qt.filter_dialog_dir.filter_core.
Criterion
(prop, limiter, checked=True)[source]¶ Bases:
object
Object representing a single criteria of a filter. It consists of a property name and a “limiter”, which is a filter string for str types, a range of values for int/real types and True or False value for boolean types.
-
__init__
(prop, limiter, checked=True)[source]¶ Initialize criterion.
- Parameters
prop (str) – name of property used in this criterion
limiter (str or bool or Tuple) – criterion limiting values: True or False if property is boolen, str if property is string and tuple that contains min and max values if property is numerical.
checked (bool) – indicates whether this criterion is ‘checked’. True by default
-
-
class
schrodinger.ui.qt.filter_dialog_dir.filter_core.
Filter
(name, criteria=None)[source]¶ Bases:
object
A filter objects is made up of a name and a list of criteria.
-
__init__
(name, criteria=None)[source]¶ - Parameters
name (str) – Filter name
criteria (list of
Criterion
) – List of criteria to filter by
-
doPropsMatch
(lig_props)[source]¶ Returns True if the given dict of property names/values matches all criteria; returns False if at least one criteria doesn’t match.
-
classmethod
fromJSON
(json_str)[source]¶ Create a Filter instance from the given JSON string.
- Parameters
json_str (str or None) – JSON string specifying the filtering criteria. If None an empty filter is returned.
-
classmethod
fromFile
(filename)[source]¶ Create a Filter instance from a file (may be None).
- Parameters
filename (str or NoneType) – name of JSON file specifying the filtering criteria. If None, an empty filter is returned.
- Return type
-