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

Function _validate_zooms

mne/transforms.py:1692–1706  ·  view source on GitHub ↗
(zooms)

Source from the content-addressed store, hash-verified

1690
1691
1692def _validate_zooms(zooms):
1693 _validate_type(zooms, (dict, list, tuple, "numeric", None), "zooms")
1694 zooms = _handle_default("transform_zooms", zooms)
1695 for key, val in zooms.items():
1696 _check_option("zooms key", key, _ORDERED_STEPS)
1697 if val is not None:
1698 val = tuple(float(x) for x in np.array(val, dtype=float).ravel())
1699 _check_option(f"len(zooms[{repr(key)})", len(val), (1, 3))
1700 if len(val) == 1:
1701 val = val * 3
1702 for this_zoom in val:
1703 if this_zoom <= 1:
1704 raise ValueError(f"Zooms must be > 1, got {this_zoom}")
1705 zooms[key] = val
1706 return zooms
1707
1708
1709def _validate_niter(niter):

Callers 1

Calls 3

_validate_typeFunction · 0.85
_handle_defaultFunction · 0.85
_check_optionFunction · 0.85

Tested by

no test coverage detected