fgen.wrapping_strategies#

Wrapping strategies

Different Fortran types need different strategies for wrapping. We capture these here.

fgen.wrapping_strategies.array_deferred_size

Wrapping strategy for arrays of a deferred size

fgen.wrapping_strategies.array_derived_type

Wrapping strategy for arrays of derived types

fgen.wrapping_strategies.array_derived_type_deferred_size

Wrapping strategy for arrays of derived type of a deferred size

fgen.wrapping_strategies.character

Wrapping strategy for characters (strings in Python world)

fgen.wrapping_strategies.character_deferred_size

Wrapping strategy for characters with a deferred size (i.e.

fgen.wrapping_strategies.default

Wrapping strategy for everything that isn't covered elsewhere, i.e. the default.

fgen.wrapping_strategies.derived_type

Wrapping strategy for derived types

fgen.wrapping_strategies.enum

Wrapping strategy for enum types

fgen.wrapping_strategies.information_injection

Information injection functions

fgen.wrapping_strategies.interface

Interface definition for wrapping strategies

fgen.wrapping_strategies.logical

Wrapping strategy for logicals (booleans in Python world)

fgen.wrapping_strategies.passing_to_fortran_steps

Data model for how we pass data from Python to Fortran

fgen.wrapping_strategies.receiving_from_python_steps

Data model for how we receive data from Python in Fortran

fgen.wrapping_strategies.type_annotations

Helpers for type annotations

get_wrapping_strategy#

get_wrapping_strategy(fortran_data_type)[source]#

Get wrapping strategy for a given FortranDataType

Parameters:

fortran_data_type (fgen.fortran_parsing.FortranDataType) – FortranDataType for which to get the wrapping strategy

Returns:

fgen.wrapping_strategies.interface.WrappingStrategyLike – Wrapping strategy object

get_character_wrapping_strategy#

get_character_wrapping_strategy(fdt)[source]#

Get wrapping strategy, given we know the Fortran data type is a character

Parameters:

fdt (fgen.fortran_parsing.FortranDataType) – Fortran data type

Returns:

fgen.wrapping_strategies.interface.WrappingStrategyLike – Wrapping strategy

get_array_wrapping_strategy#

get_array_wrapping_strategy(fdt)[source]#

Get wrapping strategy, given we know the data type is an array

Parameters:

fdt (fgen.fortran_parsing.FortranDataType) – Fortran data type

Returns:

fgen.wrapping_strategies.interface.WrappingStrategyLike – Wrapping strategy