urclib.fuzzylogic.nodata_handling

Logic for handling no data values during various steps of the simulation.

Module Contents

Classes

NoDataSentinel

Value used to represent No Data in equations.

class urclib.fuzzylogic.nodata_handling.NoDataSentinel(ignore=True, subval=None)

Bases: object

Value used to represent No Data in equations.

The sentinel will return different values when used in arithmetic operations, depending on its attributes:

  • If ignore is True, the sentinel will return the other operand in binary operations.

  • If ignore is False and subVal is None, the sentinel will return itself.

  • If ignore is False and subVal is not None, subVal is used in the binary operation and the result is returned.

ignore

Flag indicating if the sentinel should be ignored in arithmetic operations.

Type:

bool

subVal

Only referenced if ignore is False. The value to substitute in place of the sentinel value, if any.

Type:

float

Parameters:
  • ignore (bool,optional) – The default state of the ignore attribute. Defaults to True.

  • subVal (float,optional) – The default value for the subVal attribute. Defaults to None.

__repr__()

Return repr(self).

__str__()

Return str(self).

__float__()
__add__(other)
__sub__(other)
__mul__(other)
__truediv__(other)
__floordiv__(other)
__mod__(other)
__divmod__(other)
__pow__(other, modulo=None)
__radd__(other)
__rsub__(other)
__rmul__(other)
__rdiv__(other)
__rfloordiv__(other)
__rmod__(other)
__rdivmod__(other)
__rpow__(other, mod=None)
__neg__()
__pos__()
__abs__()
__round__(n=0)
static get_key_for_max(inval)

Method for handling Sentinel in special fashion when generating key to use with max.

Parameters:

inval (object) – The value to generate a key for.

Returns:

The appropriate key to force selection of sentinel if present; otherwise the inVal itself.

Return type:

object

static get_key_for_min(inval)

Method for handling Sentinel in special fashion when generating key to use with min.

Parameters:

inval (object) – The value to generate a key for.

Returns:

The appropriate key to force selection of sentinel if present; otherwise the inVal itself.

Return type:

object