MetaInfo#

class pyopenms.MetaInfo#

Bases: object

Cython implementation of _MetaInfo

Original C++ documentation is available here

A Type-Name-Value tuple class

MetaInfo maps an index (an integer corresponding to a string) to DataValue objects. The mapping of strings to the index is performed by the MetaInfoRegistry, which can be accessed by the method registry()

There are two versions of nearly all members. One which operates with a string name and another one which operates on an index. The index version is always faster, as it does not need to look up the index corresponding to the string in the MetaInfoRegistry

If you wish to add a MetaInfo member to a class, consider deriving that class from MetaInfoInterface, instead of simply adding MetaInfo as member. MetaInfoInterface implements a full interface to a MetaInfo member and is more memory efficient if no meta info gets added

__init__()#

Overload:

__init__(self) None

Overload:

__init__(self, in_0: MetaInfo) None

Methods

__init__

Overload:

clear(self)

Removes all meta values

empty(self)

Returns if the MetaInfo is empty

exists

Overload:

getKeys(self, keys)

Fills the given vector with a list of all keys for which a value is set

getKeysAsIntegers(self, keys)

getValue

Overload:

registry(self)

removeValue

Overload:

setValue

Overload:

clear(self) None#

Removes all meta values

empty(self) bool#

Returns if the MetaInfo is empty

exists()#

Overload:

exists(self, name: bytes | str | String) bool

Returns if this MetaInfo is set

Overload:

exists(self, index: int) bool

Returns if this MetaInfo is set

getKeys(self, keys: List[bytes]) None#

Fills the given vector with a list of all keys for which a value is set

getKeysAsIntegers(self, keys: List[int]) None#
getValue()#

Overload:

getValue(self, name: bytes | str | String) int | float | bytes | str | List[int] | List[float] | List[bytes]

Returns the value corresponding to a string

Overload:

getValue(self, index: int) int | float | bytes | str | List[int] | List[float] | List[bytes]

Returns the value corresponding to an index

Overload:

getValue(self, name: bytes | str | String, default_value: int | float | bytes | str | List[int] | List[float] | List[bytes]) int | float | bytes | str | List[int] | List[float] | List[bytes]

Returns the value corresponding to a string

Overload:

getValue(self, index: int, default_value: int | float | bytes | str | List[int] | List[float] | List[bytes]) int | float | bytes | str | List[int] | List[float] | List[bytes]

Returns the value corresponding to an index

registry(self) MetaInfoRegistry#
removeValue()#

Overload:

removeValue(self, name: bytes | str | String) None

Removes the DataValue corresponding to name if it exists

Overload:

removeValue(self, index: int) None

Removes the DataValue corresponding to index if it exists

setValue()#

Overload:

setValue(self, name: bytes | str | String, value: int | float | bytes | str | List[int] | List[float] | List[bytes]) None

Sets the DataValue corresponding to a name

Overload:

setValue(self, index: int, value: int | float | bytes | str | List[int] | List[float] | List[bytes]) None

Sets the DataValue corresponding to an index