siibra.vocabularies

Abbreviations and aliases.

Package Contents

Classes

InstanceTable

Lookup table for instances of a given class by name/id.

Functions

runtime_path(fname)

Attributes

RECEPTOR_SYMBOLS

REGION_ALIASES

RT_DIR

class siibra.vocabularies.InstanceTable(matchfunc=lambda a, b: ..., elements=None)
Inheritance diagram of siibra.vocabularies.InstanceTable

Lookup table for instances of a given class by name/id. Provide attribute-access and iteration to a set of named elements, given by a dictionary with keys of ‘str’ type.

property dataframe
__contains__(key: str | T) bool

Test wether the given key or element is defined by the registry.

__dir__() Iterable[str]

List of all object keys in the registry

__getattr__(index) T

Access elements by using their keys as attributes. Keys are auto-generated from the provided names to be uppercase, with words delimited using underscores.

__getitem__(spec) T
__iter__() Iterator[T]

Iterate over all objects in the registry

__len__() int

Return the number of elements in the registry

__repr__()

Return repr(self).

__str__() str

Return str(self).

__sub__(obj) InstanceTable[T]

remove an object from the registry

add(key: str, value: T) None

Add a key/value pair to the registry.

Parameters:
  • (string) (key) –

  • (object) (value) –

find(spec) List[T]

Return a list of items matching the given specification, which could be either the name or a specification that works with the matchfunc of the Glossary.

get(spec) T

Give access to objects in the registry by sequential index, exact key, or keyword matching. If the keywords match multiple objects, the first in sorted order is returned. If the specification does not match, a RuntimeError is raised.

Parameters:

spec (int, str) – Index or string specification of an object

Return type:

Matched object

provides(spec) bool

Returns True if an element that matches the given specification can be found (using find(), thus going beyond the matching of names only as __contains__ does)

values()
siibra.vocabularies.runtime_path(fname: str)
siibra.vocabularies.RECEPTOR_SYMBOLS
siibra.vocabularies.REGION_ALIASES
siibra.vocabularies.RT_DIR