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.

Note

This class is managed by footprint.

  • info: Not documented

  • priority: PriorityLevel::DEFAULT (rank=1)

Automatic parameters from the footprint:

  • filename (builtins.str) - rxx - File name (absolute or relative) of the resource.

  • fmtdelayedopen (builtins.bool) - rxx - Opening of the resource delayed (not at time of construction).

    • Optional. Default is False.

  • format (builtins.str) - rxx - Format of the resource.

    • Optional. Default is ‘LFA’.

    • Values: set([‘LFA’])

  • openmode (builtins.str) - rxx - Opening mode.

    • Values: set([‘append’, ‘r’, ‘read’, ‘w’, ‘a’, ‘write’])

    • Remap: dict(append = ‘a’, read = ‘r’, write = ‘w’,)

Constructor. See its footprint for arguments.

close()[source]

Closes a LFA properly.

filename

File name (absolute or relative) of the resource (see the documentation above for more details).

find_fields_in_resource(seed=None)[source]

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.

fmtdelayedopen

Opening of the resource delayed (not at time of construction) (see the documentation above for more details).

format

Format of the resource (see the documentation above for more details).

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.

Parameters

openmode – optional, to open with a specific openmode, eventually different from the one specified at initialization.

openmode

Opening mode (see the documentation above for more details).

readfield(*args, **kwargs)

Reads a field in resource.

Parameters
  • 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.

Parameters
  • 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.