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.


This class is managed by footprint.

  • info: Not documented
  • priority: PriorityLevel::DEFAULT (rank=1)

Automatic parameters from the footprint:

  • filename (str) - rxx - File name (absolute or relative) of the resource.
  • fmtdelayedopen (bool) - rxx - Opening of the resource delayed (not at time of construction).
    • Optional. Default is False.
  • format (str) - rxx - Format of the resource.
    • Optional. Default is ‘LFA’.
    • Values: set([‘LFA’])
  • openmode (str) - rxx - Opening mode.
    • Values: set([‘a’, ‘write’, ‘r’, ‘w’, ‘read’, ‘append’])
    • Remap: dict(append = ‘a’, read = ‘r’, write = ‘w’,)

Closes a LFA properly.


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

Parameters:seed – might be a regular expression, a list of regular expressions or None. If None (default), returns the list of all fields in resource.

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


Opens the LFA in Fortran sense.

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

Reads a field in resource.

  • fieldname – name of the field to be read
  • getdata – if False, do not read the field data, only metadata.
what(*args, **kwargs)

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

  • out – the output open file-like object
  • sortfieldsTrue if the fields have to be sorted by type.
writefield(*args, **kwargs)

Writes a Field in resource.