typingtools

This module implements some “types” to be used for static (and eventually dynamical) typing.

Module typingtools implements the following members:

  • ArrayFloat Type variable.

  • Float1 Type variable.

  • Float2 Type variable.

  • Float_co Type variable.

  • MatrixInput no description available

  • Name Type for strings that represent names.

  • T Type variable.

  • T1 Type variable.

  • T2 Type variable.

  • T3 Type variable.

  • VectorInput Protocol class for providing input to “mathematical”, 1-dimensional arrays.

  • Vector Protocol class for defining “mathematical”, 1-dimensional sequences.

  • Matrix Protocol class for providing input to “mathematical”, 2-dimensional arrays.

  • VariableProtocol Protocol to identify objects as “variables”.

  • CyParametersProtocol The protocol for the parameters attribute of Cython extension classes.

  • CySequencesProtocol The protocol for the sequences attribute of Cython extension classes.

  • CyModelProtocol The protocol of Cython extension classes for defining efficient model implementations.

  • ScriptFunction Callback protocol for functions to be executed from the command line (see the documentation on function execute_scriptfunction() and module hyd for further information).


class hydpy.core.typingtools.CyModelProtocol(*args, **kwargs)[source]

Bases: Protocol

The protocol of Cython extension classes for defining efficient model implementations.

Class Cythonizer generates the actual, model specific implementations automatically.

idx_sim: int
parameters: CyParametersProtocol
sequences: CySequencesProtocol
class hydpy.core.typingtools.Matrix(*args, **kwargs)[source]

Bases: VectorInput[VectorInput[Float1]]

Protocol class for providing input to “mathematical”, 2-dimensional arrays.

property shape: Tuple[int, int]

Length of both matrix axes.

class hydpy.core.typingtools.ScriptFunction(*args, **kwargs)[source]

Bases: Protocol

Callback protocol for functions to be executed from the command line (see the documentation on function execute_scriptfunction() and module hyd for further information).

class hydpy.core.typingtools.VariableProtocol(*args, **kwargs)[source]

Bases: Protocol

Protocol to identify objects as “variables”.

name: str
class hydpy.core.typingtools.VectorInput(*args, **kwargs)[source]

Bases: Protocol[Float_co]

Protocol class for providing input to “mathematical”, 1-dimensional arrays.

class hydpy.core.typingtools.Vector(*args, **kwargs)[source]

Bases: VectorInput[Float1]

Protocol class for defining “mathematical”, 1-dimensional sequences.

shape() Tuple[int][source]

Length of the vector.