MCPcopy
hub / github.com/mne-tools/mne-python / _to_const

Function _to_const

mne/transforms.py:81–92  ·  view source on GitHub ↗

Convert string or int coord frame into int.

(cf)

Source from the content-addressed store, hash-verified

79
80
81def _to_const(cf):
82 """Convert string or int coord frame into int."""
83 if isinstance(cf, str):
84 if cf not in _str_to_frame:
85 raise ValueError(
86 f"Unknown coordinate frame {cf}, "
87 'expected "' + '", "'.join(_str_to_frame.keys()) + '"'
88 )
89 cf = _str_to_frame[cf]
90 else:
91 cf = _ensure_int(cf, "coordinate frame", "a str or int")
92 return int(cf)
93
94
95class Transform(dict):

Callers 3

__init__Method · 0.85
combine_transformsFunction · 0.85
write_digFunction · 0.85

Calls 1

_ensure_intFunction · 0.85

Tested by

no test coverage detected