MetaInfoInterface#

class pyopenms.MetaInfoInterface#

Bases: object

Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).

MetaInfoInterface is a base class for all classes that use one MetaInfo object as member. If you want to add meta information to a class, let it publicly inherit the MetaInfoInterface. Meta information is an array of Type-Name-Value tuples.

Usage:

k = []
exp.getKeys(k) # explore available key-value pairs
exp.getMetaValue("someMetaName")
__init__() → None#
__init__(arg: pyopenms.MetaInfoInterface, /) → None

Methods

__init__()

clearMetaInfo()

Removes all meta values

getKeys(keys)

Fills the given list with all meta value keys

getMetaValue(name)

Returns the value corresponding to a string, or DataValue::EMPTY if not found

getMetaValues()

Returns all meta values as a dictionary of {name: value}

isMetaEmpty()

Returns if the MetaInfo is empty

metaRegistry()

Returns a reference to the MetaInfoRegistry

metaValueExists(name)

Returns whether an entry with the given name exists

removeMetaValue(name)

Removes the DataValue corresponding to name if it exists

setMetaValue(name, value)

Sets the DataValue corresponding to a name

setMetaValues(values)

Sets multiple meta values from a dictionary of {name: value}

clearMetaInfo() → None#

Removes all meta values

getKeys(keys: list) → None#

Fills the given list with all meta value keys

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

Returns the value corresponding to a string, or DataValue::EMPTY if not found

getMetaValues() → dict#

Returns all meta values as a dictionary of {name: value}

isMetaEmpty() → bool#

Returns if the MetaInfo is empty

static metaRegistry() → pyopenms.MetaInfoRegistry#

Returns a reference to the MetaInfoRegistry

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

Returns whether an entry with the given name exists

removeMetaValue(name: str) → None#
removeMetaValue(index: int) → None

Removes the DataValue corresponding to name if it exists

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

Sets the DataValue corresponding to a name

setMetaValues(values: dict) → None#

Sets multiple meta values from a dictionary of {name: value}