MetaInfo#

class pyopenms.MetaInfo#

Bases: object

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__() → None#
__init__(arg: pyopenms.MetaInfo, /) → None

Methods

__init__()

clear()

Removes all meta values

empty()

Returns if the MetaInfo is empty

exists(name)

Returns if this MetaInfo is set

getKeys(keys)

Overloaded function.

getKeysAsIntegers()

Returns a list of all integer keys for which a value is set

getValue(name[, default_value])

Overloaded function.

registry()

removeValue(name)

Overloaded function.

setValue(name, value)

Overloaded function.

clear() → None#

Removes all meta values

empty() → bool#

Returns if the MetaInfo is empty

exists(name: str) → bool#
exists(index: int) → bool

Returns if this MetaInfo is set

getKeys(keys: list) → None#
getKeys() → list
getKeys(keys: list) → None
getKeys() → list

Overloaded function.

  1. getKeys(keys: list) -> None

Fills the given list with all meta value keys

  1. getKeys() -> list

Returns all meta value keys as a list

  1. getKeys(keys: list) -> None

Fills the given list with all meta value keys

  1. getKeys() -> list

Returns all meta value keys as a list

getKeysAsIntegers() → list[int]#

Returns a list of all integer keys for which a value is set

getValue(name: str, default_value: None | int | float | str | bytes | list[str] | list[int] | list[float] | None = None) → None | int | float | str | bytes | list[str] | list[int] | list[float]#
getValue(index: int, default_value: None | int | float | str | bytes | list[str] | list[int] | list[float] | None = None) → None | int | float | str | bytes | list[str] | list[int] | list[float]

Overloaded function.

  1. getValue(name: str, default_value: None | int | float | str | bytes | list[str] | list[int] | list[float] | None = None) -> None | int | float | str | bytes | list[str] | list[int] | list[float]

Returns the value corresponding to a string

  1. getValue(index: int, default_value: None | int | float | str | bytes | list[str] | list[int] | list[float] | None = None) -> None | int | float | str | bytes | list[str] | list[int] | list[float]

Returns the value corresponding to an index

static registry() → pyopenms.MetaInfoRegistry#
removeValue(name: str) → None#
removeValue(index: int) → None

Overloaded function.

  1. removeValue(name: str) -> None

Removes the DataValue corresponding to name if it exists

  1. removeValue(index: int) -> None

Removes the DataValue corresponding to index if it exists

setValue(name: str, value: None | int | float | str | bytes | list[str] | list[int] | list[float]) → None#
setValue(index: int, value: None | int | float | str | bytes | list[str] | list[int] | list[float]) → None

Overloaded function.

  1. setValue(name: str, value: None | int | float | str | bytes | list[str] | list[int] | list[float]) -> None

Sets the DataValue corresponding to a name

  1. setValue(index: int, value: None | int | float | str | bytes | list[str] | list[int] | list[float]) -> None

Sets the DataValue corresponding to an index