larch.Dataset.from_omx

larch.Dataset.from_omx

classmethod Dataset.from_omx(omx, index_names=('otaz', 'dtaz'), indexes='one-based', renames=None)[source]

Create a Dataset from an OMX file.

Parameters
  • omx (openmatrix.File or larch.OMX) – An OMX-format file, opened for reading.

  • index_names (tuple, default ("otaz", "dtaz", "time_period")) – Should be a tuple of length 3, giving the names of the three dimensions. The first two names are the native dimensions from the open matrix file, the last is the name of the implicit dimension that is created by parsing array names.

  • indexes (str, optional) – The name of a ‘lookup’ in the OMX file, which will be used to populate the coordinates for the two native dimensions. Or, specify “one-based” or “zero-based” to assume sequential and consecutive numbering starting with 1 or 0 respectively.

  • renames (Mapping or Collection, optional) – Limit the import only to these data elements. If given as a mapping, the keys will be the names of variables in the resulting dataset, and the values give the names of data matrix tables in the OMX file. If given as a list or other non-mapping collection, elements are not renamed but only elements in the collection are included.

Returns

Dataset