hydro.flags

A Collection of Flag Schemes.

Classes

FlagDefProtocol

Base class for protocol classes.

ExchangeFlag

Enum where members are also (and must be) ints

ExchangeBottleFlag

Enum representing a WHP Bottle flag.

ExchangeSampleFlag

Enum where members are also (and must be) ints

ExchangeCTDFlag

Enum where members are also (and must be) ints

Module Contents

class hydro.flags.FlagDefProtocol[source]

Bases: Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...
flag: int[source]
property _flag_definitions: dict[int, str][source]
Abstractmethod:

Return type:

dict[int, str]

property _no_data_flags: tuple[int][source]
Abstractmethod:

Return type:

tuple[int]

class hydro.flags.ExchangeFlag(flag)[source]

Bases: enum.IntEnum

Enum where members are also (and must be) ints

Parameters:

flag (int)

flag[source]
property definition[source]
property cf_def[source]
property has_value[source]
class hydro.flags.ExchangeBottleFlag(flag)[source]

Bases: ExchangeFlag

Enum representing a WHP Bottle flag.

This flag represents information about the sampling device itself (i.e. the niskin bottle). It should only be used for “BTLNBR_FLAG_W” values and should never be used with CTD files.

Parameters:

flag (int)

NOFLAG = 0[source]
NO_INFO = 1[source]
GOOD = 2[source]
LEAKING = 3[source]
BAD_TRIP = 4[source]
NOT_REPORTED = 5[source]
DISCREPANCY = 6[source]
UNKNOWN = 7[source]
PAIR = 8[source]
NOT_SAMPLED = 9[source]
property _no_data_flags[source]
property _flag_definitions[source]
class hydro.flags.ExchangeSampleFlag(flag)[source]

Bases: ExchangeFlag

Enum where members are also (and must be) ints

Parameters:

flag (int)

NOFLAG = 0[source]
MISSING = 1[source]
GOOD = 2[source]
QUESTIONABLE = 3[source]
BAD = 4[source]
NOT_REPORTED = 5[source]
MEAN = 6[source]
CHROMA_MANUAL = 7[source]
CHROMA_IRREGULAR = 8[source]
NOT_SAMPLED = 9[source]
property _no_data_flags[source]
property _flag_definitions[source]
class hydro.flags.ExchangeCTDFlag(flag)[source]

Bases: ExchangeFlag

Enum where members are also (and must be) ints

Parameters:

flag (int)

NOFLAG = 0[source]
UNCALIBRATED = 1[source]
GOOD = 2[source]
QUESTIONABLE = 3[source]
BAD = 4[source]
NOT_REPORTED = 5[source]
INTERPOLATED = 6[source]
DESPIKED = 7[source]
NOT_SAMPLED = 9[source]
property _no_data_flags[source]
property _flag_definitions[source]