parse_mesh_params#
- parse_mesh_params(func)[source]#
Decorator that promotes positional coordinate arguments to 1-D arrays.
Wraps each positional argument of the decorated method with
atleast_1dnull(), converting scalar values to length-1 arrays while leavingNonesentinels intact.Apply this decorator to any mixin method whose first positional arguments are
r,t,pcoordinate arrays so that downstream parsing code can always assume array inputs.- Parameters:
- func
Callable The method to wrap. Its positional arguments (after
self) will be promoted.
- func
- Returns:
- out
Callable The wrapped method with the same signature as
func.
- out
Examples
>>> from pyvisual.core.parsers import parse_mesh_params >>> class Foo: ... @parse_mesh_params ... def bar(self, r, t, p): ... return r.ndim, t.ndim, p.ndim >>> Foo().bar(1.0, 2.0, 3.0) (1, 1, 1)