epygram

class epygram.epygramError[source]

Bases: Exception

Errors class for the package.


epygram.init_env(omp_num_threads=1, no_mpi=True, lfi_C=True, mute_FA4py=None, unlimited_stack=True, ensure_consistent_GRIB_paths=True, ignore_gribenv_paths=False)[source]

A function to modify execution environment (to be called early in execution).

Parameters
  • omp_num_threads – sets OMP_NUM_THREADS

  • no_mpi – environment variable DR_HOOK_NOT_MPI set to 1

  • lfi_C – if True, LFI_HNDL_SPEC set to ‘:1’, to use the C version of LFI

  • mute_FA4py – mute messages from FAIPAR in FA4py library

  • unlimited_stack – equivalent to ‘ulimit -s unlimited’

  • ensure_consistent_GRIB_paths (bool) – complete GRIB samples/definition paths to be consistent with inner library

  • ignore_gribenv_paths – ignore predefined values of the variables GRIB_SAMPLES_PATH and GRIB_DEFINITION_PATH (or equivalent ECCODES variables)


epygram.showconfig()[source]

Print current config.


epygram.open(filename, openmode, fmt=None, **kwargs)

Returns an instance of Resource of the requested fmt format, located at the given filename, open with the given openmode.

Parameters
  • filename – name (path) of the file to open

  • openmode – opening mode (‘r’, ‘a’, ‘w’)

  • fmt – format of the resource; with openmode ‘r’ or ‘a’, fmt is optional and can be guessed from the existing resource

Other kwargs are passed to the resource constructor.