Reference Guide
2.5.0
|
Public Member Functions | |
def | create_from_fortran_string (cls, fortran_string) |
Static Public Member Functions | |
def | check_fparser2 (fparser2_tree, encoding) |
def | validate_scalar_value (value, valid_values, name) |
def | create_fparser2 (fortran_string, encoding) |
def | create_from_fparser2 (fparser2_tree) |
Static Public Attributes | |
fparser2_class = None | |
Abstract class to capture common LFRic kernel metadata.
Definition at line 49 of file common_metadata.py.
|
static |
Checks that the fparser2 tree is valid. :param fparser2_tree: fparser2 tree capturing a metadata argument. :type fparser2_tree: :py:class:`fparser.two.Fortran2003.Base` :param encoding: class in which the fparser2 tree should \ be encoded. :type encoding: :py:class:`fparser.two.Fortran2003.Base` :raises TypeError: if the fparser2_tree argument is not of the \ type specified by the encoding argument.
Definition at line 56 of file common_metadata.py.
|
static |
Creates an fparser2 tree from a Fortran string. The resultant parent node of the tree will be the same type as the encoding argument if the string conforms to the encoding, otherwise an exception will be raised. TODO: issue #1965: relocate this method as it is not specific to metadata processing. :param str fortran_string: a string containing the metadata in \ Fortran. :param encoding: the parent class with which we will encode the \ Fortran string. :type encoding: subclass of :py:class:`fparser.two.Fortran2003.Base` :returns: an fparser2 tree containing a metadata \ argument. :rtype: subclass of :py:class:`fparser.two.Fortran2003.Base` :raises ValueError: if the Fortran string is not in the \ expected form.
Definition at line 100 of file common_metadata.py.
def psyclone.domain.lfric.kernel.common_metadata.CommonMetadata.create_from_fortran_string | ( | cls, | |
fortran_string | |||
) |
Create an instance of this class from Fortran. :param str fortran_string: a string containing the metadata in \ Fortran. :returns: an instance of this class. :rtype: subclass of \ :py:class:`python.domain.lfric.kernel.CommonMetadata`
Definition at line 137 of file common_metadata.py.
References psyclone.domain.lfric.kernel.common_metadata.CommonMetadata.create_fparser2(), psyclone.domain.lfric.kernel.common_meta_arg_metadata.CommonMetaArgMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.common_metadata.CommonMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.evaluator_targets_metadata.EvaluatorTargetsMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.meta_args_metadata.MetaArgsMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.meta_funcs_arg_metadata.MetaFuncsArgMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.meta_funcs_metadata.MetaFuncsMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.meta_mesh_arg_metadata.MetaMeshArgMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.meta_ref_element_arg_metadata.MetaRefElementArgMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.meta_ref_element_metadata.MetaRefElementMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.operates_on_metadata.OperatesOnMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.shapes_metadata.ShapesMetadata.create_from_fparser2(), psyclone.domain.lfric.kernel.common_arg_metadata.CommonArgMetadata.fparser2_class, psyclone.domain.lfric.kernel.common_declaration_metadata.CommonDeclarationMetadata.fparser2_class, psyclone.domain.lfric.kernel.common_metadata.CommonMetadata.fparser2_class, psyclone.domain.lfric.kernel.inter_grid_arg_metadata.InterGridArgMetadata.fparser2_class, and psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata.fparser2_class.
|
static |
Create an instance of this class from an fparser2 tree.
Reimplemented in psyclone.domain.lfric.kernel.shapes_metadata.ShapesMetadata, psyclone.domain.lfric.kernel.operates_on_metadata.OperatesOnMetadata, psyclone.domain.lfric.kernel.meta_ref_element_metadata.MetaRefElementMetadata, psyclone.domain.lfric.kernel.meta_ref_element_arg_metadata.MetaRefElementArgMetadata, psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata, psyclone.domain.lfric.kernel.meta_mesh_arg_metadata.MetaMeshArgMetadata, psyclone.domain.lfric.kernel.meta_funcs_metadata.MetaFuncsMetadata, psyclone.domain.lfric.kernel.meta_funcs_arg_metadata.MetaFuncsArgMetadata, psyclone.domain.lfric.kernel.meta_args_metadata.MetaArgsMetadata, psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata, and psyclone.domain.lfric.kernel.evaluator_targets_metadata.EvaluatorTargetsMetadata.
Definition at line 153 of file common_metadata.py.
|
static |
Check that the value argument is one of the values supplied in the valid_values list. :param str value: the value being checked. :param List[str] valid_values: a list of valid values. :param str name: the name of the metadata being checked :raises TypeError: if the value is not a string. :raises ValueError: if the supplied value is not one of the \ values in the valid_values list.
Definition at line 77 of file common_metadata.py.