Module Expr Str Import alias Import alias identifier Import alias identifier ClassDef bases NameLoad body Expr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr orelse If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num NameLoad If CompareEq Call NameLoad NameLoad Num body Return NameLoad Assign NameStore UnaryOpInvert BinOpBitOr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore CompareLt SubscriptLoad NameLoad Index NameLoad AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore CompareLtE SubscriptLoad NameLoad Index NameLoad AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore CompareGt SubscriptLoad NameLoad Index NameLoad AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore CompareGtE SubscriptLoad NameLoad Index NameLoad AttributeLoad NameLoad attr orelse Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr Assign SubscriptStore NameLoad ExtSlice Index NameLoad Slice SubscriptLoad AttributeLoad NameLoad attr ExtSlice Index BinOpSub Num Call AttributeLoad NameLoad attr NameLoad Slice Assign SubscriptStore NameLoad ExtSlice Index UnaryOpInvert NameLoad Slice SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad AttributeLoad NameLoad attr Num Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Str If BoolOpOr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Str Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore NameLoad TryFinally body For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListComp ListComp Call NameLoad Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Str comprehension NameStore TupleLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Call NameLoad SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad BinOpMod Str Call NameLoad NameLoad finalbody If NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr NameLoad For NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareGt SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num AugAssignAdd SubscriptStore NameLoad ExtSlice Slice NameLoad Slice SubscriptLoad NameLoad ExtSlice Slice NameLoad Slice If CompareGt SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign SubscriptStore NameLoad ExtSlice Slice NameLoad Slice AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list
N/A N/A rules - code for parsing and applying rules from CPA
 N/A re N/A numpy np N/A cellprofiler.measurements cpmeas Rules N/A object N/A N/A Represents a set of CPA rules Rule N/A object N/A N/A Represents a single rule __init__ N/A N/A self object_name feature comparitor threshold weights N/A N/A N/A Create a rule

            object_name - the name of the object in the measurements
            feature - the name of the measurement (for instance,
                      "AreaShape_Area")
            comparitor - the comparison to be performed (for instance, ">")
            threshold - the positive / negative threshold for the comparison
            weights - a 2xN matrix of weights where weights[0,:] are the
                      scores for the rule being true and
                      weights[1,:] are the scores for the rule being false
                      and there are N categories.
             N/A N/A self object_name object_name N/A N/A self comparitor comparitor N/A N/A self threshold threshold N/A N/A self feature feature N/A N/A self weights weights N/A score N/A N/A self measurements N/A N/A N/A Score a rule

            measurements - a measurements structure
                           (cellprofiler.measurements.Measurements). Look
                           up this rule's measurement in the structure to
                           get the testing value.
            Returns a MxN matrix where M is the number of measurements taken
            for the given feature in the current image set and N is the
            number of categories as indicated by the weights.
             N/A values N/A N/A measurements get_current_measurement N/A self object_name N/A self feature N/A N/A values None N/A N/A values N/A N/A np array N/A N/A np NaN N/A N/A N/A N/A np isscalar values N/A N/A values N/A N/A np array N/A values N/A score N/A N/A np zeros N/A N/A len values N/A N/A N/A self weights shape N/A 1 float N/A N/A N/A len values 0 N/A N/A score N/A mask N/A N/A N/A N/A np isnan values N/A N/A np isinf values N/A N/A N/A self comparitor < N/A N/A hits N/A N/A values N/A mask N/A self threshold N/A N/A N/A N/A self comparitor <= N/A N/A hits N/A N/A values N/A mask N/A self threshold N/A N/A N/A N/A self comparitor > N/A N/A hits N/A N/A values N/A mask N/A self threshold N/A N/A N/A N/A self comparitor >= N/A N/A hits N/A N/A values N/A mask N/A self threshold N/A N/A N/A NotImplementedError N/A Unknown comparitor, "%s". N/A self comparitor N/A N/A score N/A N/A mask N/A N/A N/A self weights N/A N/A N/A 1 N/A N/A hits astype int N/A N/A N/A score N/A N/A N/A mask N/A N/A N/A self weights N/A N/A N/A np newaxis 1 N/A score N/A N/A __init__ N/A N/A self N/A N/A N/A Create an empty set of rules.

        Use "parse" to read in the rules file or add rules programatically
        to self.rules.
         N/A N/A self rules N/A N/A parse N/A N/A self fd_or_file N/A N/A N/A Parse a rules file

        fd_or_file - either a filename or a file descriptor. Parse assumes
                     that fd_or_file is a file name if it's a string or
                     unicode, otherwise it assumes that it's a file descriptor.
         N/A line_pattern ^IF\s+\((?P<object_name>[^_]+)_(?P<feature>\S+)\s*(?P<comparitor>[><]=?)\s*(?P<threshold>[^,]+),\s*\[\s*(?P<true>[^\]]+)\s*\],\s*\[\s*(?P<false>[^\]]+)\s*\]\s*\)$ N/A N/A N/A isinstance fd_or_file str N/A isinstance fd_or_file unicode N/A N/A fd N/A open fd_or_file r N/A needs_close True N/A N/A fd fd_or_file N/A needs_close False N/A N/A N/A line fd N/A N/A line N/A N/A line strip N/A match N/A N/A re match line_pattern line N/A N/A match None N/A N/A d N/A N/A match groupdict N/A weights N/A N/A np array N/A N/A N/A float N/A N/A w strip N/A w N/A N/A N/A d N/A key split , N/A key N/A true false N/A rule N/A N/A self Rule N/A d N/A object_name N/A d N/A feature N/A d N/A comparitor N/A float N/A d N/A threshold weights N/A N/A N/A N/A self rules append rule N/A N/A N/A len N/A self rules 0 N/A N/A N/A ValueError N/A No rules found in %s N/A str fd_or_file N/A N/A needs_close N/A N/A N/A N/A fd close N/A score N/A N/A self measurements N/A N/A N/A Score the measurements according to the rules list N/A N/A N/A len N/A self rules 0 N/A N/A N/A ValueError No rules to apply N/A score N/A N/A N/A N/A self rules N/A 0 score measurements N/A rule N/A N/A self rules N/A 1 N/A N/A partial_score N/A N/A rule score measurements N/A N/A N/A N/A partial_score shape N/A 0 N/A N/A score shape N/A 0 N/A N/A temp score N/A score partial_score N/A partial_score temp N/A score_len N/A N/A partial_score shape N/A 0 N/A N/A score N/A N/A score_len N/A N/A partial_score N/A N/A score_len N/A N/A N/A N/A N/A score shape N/A 0 N/A N/A partial_score shape N/A 0 N/A N/A N/A score N/A N/A score_len N/A N/A np NAN N/A score N/A N/A