epygram.formats.LFA — Interface-Class to the LFA format

Contains the class to handle LFA format.

class epygram.formats.LFA.LFA(*args, **kwargs)[source]

Bases: epygram.resources.FileResource.FileResource

Class implementing all specificities for LFA resource format.

Footprint:

dict(
    attr = dict(
        filename = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'File name (absolute or relative) of the resource.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set([]),
        ), 
        fmtdelayedopen = dict(
            access = 'rxx', 
            alias = set([]), 
            default = False, 
            info = 'Opening of the resource delayed (not at time of construction).', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = bool, 
            values = set([]),
        ), 
        format = dict(
            access = 'rxx', 
            alias = set([]), 
            default = 'LFA', 
            info = 'Format of the resource.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['LFA']),
        ), 
        openmode = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Opening mode.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(
                append = 'a', 
                read = 'r', 
                write = 'w',
            ), 
            values = set(['a', 'write', 'r', 'w', 'read', 'append']),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
close()[source]

Closes a LFA properly.

find_fields_in_resource(seed=None)[source]

Returns a list of the fields from resource whose name match the given seed.

  • seed: might be a regular expression, a list of regular expressions or None. If None (default), returns the list of all fields in resource.
listfields()[source]

Returns a list containing the LFA identifiers of all the fields of the resource.

open(openmode=None)[source]

Opens the LFA in Fortran sense.

  • openmode: optional, to open with a specific openmode, eventually different from the one specified at initialization.
readfield(*args, **kwargs)[source]

Reads a field in resource.

what(*args, **kwargs)

Writes in file a summary of the contents of the LFA.

Args:

  • out: the output open file-like object (duck-typing: out.write() only is needed).
  • sortfields: True if the fields have to be sorted by type.
writefield(*args, **kwargs)[source]

Writes a Field in resource.

Previous topic

epygram.formats.FA — Interface-Class to the FA format

Next topic

epygram.formats.DDHLFA — Interface-Class to the DDHLFA format

This Page