From 50964eb3cb25420616ffbdd7a21931dbbe83f6c2 Mon Sep 17 00:00:00 2001 From: Chaoming Wang Date: Sat, 28 Dec 2024 10:55:33 +0800 Subject: [PATCH] fix test --- brainunit/_base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/brainunit/_base.py b/brainunit/_base.py index 476b8e3..566b963 100644 --- a/brainunit/_base.py +++ b/brainunit/_base.py @@ -4922,6 +4922,13 @@ def _remove_unit(fname, n, unit, v): f"object for argument '{n}' but got '{v}'" ) + elif unit == 1: + if isinstance(v, Quantity): + raise TypeError( + f"Function '{fname}' expected a Number object for argument '{n}' but got '{v}'" + ) + return v + else: raise TypeError( f"Function '{fname}' expected a target unit object or"