diff --git a/brainunit/__init__.py b/brainunit/__init__.py index fce3ee9..9880dd9 100644 --- a/brainunit/__init__.py +++ b/brainunit/__init__.py @@ -57,7 +57,6 @@ def set_default_magnitude( >>> set_default_magnitude(-9) # Alternatively, use an integer to represent the exponent of 10 >>> set_default_magnitude({'m': -3, 'kg': -9}) # Set the default magnitude for 'metre' to 'milli' and 'kilogram' to 'nano' >>> set_default_magnitude({'m': 'm', 'kg': 'n'}) # Alternatively, use a string to represent the magnitude - >>> set_default_magnitude(-3, unit=volt) # Set the default magnitude for the 'volt' unit to 'milli' """ global _default_magnitude if isinstance(magnitude, int): @@ -102,4 +101,4 @@ def set_default_magnitude( global __all__ __all__ = ['math'] + _common_all + _std_units_all + _constants_all + _base_all - del _common_all, _std_units_all, _constants_all, _base_all \ No newline at end of file + del _common_all, _std_units_all, _constants_all, _base_all diff --git a/brainunit/_unit_test.py b/brainunit/_unit_test.py index 152b9f2..249f76a 100644 --- a/brainunit/_unit_test.py +++ b/brainunit/_unit_test.py @@ -1497,6 +1497,7 @@ def test_set_default_magnitude_1(): assert q1.to_value() == 3e-3 assert q2.to_value() == 3e-6 + def test_set_default_magnitude_2(): bu.set_default_magnitude(-3) # from brainunit import second, ms, meter, kmeter @@ -1522,6 +1523,7 @@ def test_set_default_magnitude_2(): assert q1.to_value() == 3e-6 assert q2.to_value() == 3e-6 + def test_set_default_magnitude_3(): bu.set_default_magnitude({'s': 'm'}) from brainunit import second, ms, meter, kmeter @@ -1545,6 +1547,7 @@ def test_set_default_magnitude_3(): assert q1.to_value() == 3e-3 assert q2.to_value() == 3e-3 + def test_set_default_magnitude_4(): # volt: m=2, kg=1, s=-3, A=-1 bu.set_default_magnitude(-3) @@ -1591,4 +1594,4 @@ def test_set_default_magnitude_4(): # q1 = 3 * volt # q2 = 3 * mV # assert q1.to_value() == 3e-3 -# assert q2.to_value() == 3e-6 \ No newline at end of file +# assert q2.to_value() == 3e-6