andes.core.service.FlagCondition#

class andes.core.service.FlagCondition(u, func, flag=1, name=None, tex_name=None, info=None, cache=True)[source]#

Class for flagging values based on a condition function.

By default, values whose condition function output equal that equal to True/1 will be flagged as 1. 0 otherwise.

Parameters:
u

Input parameter

func

A condition function that returns True or False.

flag1 by default, only 0 or 1 is accepted.

The flag for the inputs whose condition output is True.

Warning

This class is not ready.

FlagCondition can only be applied to BaseParam with cache=True. Applying to Service will fail unless cache is False (at a performance cost).

__init__(u, func, flag=1, name=None, tex_name=None, info=None, cache=True)[source]#

Methods

assign_memory(n)

Assign memory for self.v and set the array to zero.

get_names()

Return name in a list

Attributes

class_name

Return the class name

n

Return the count of values in self.v.

v