Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Updated paths from test_units.py in order to package

Signed-off-by: Sorin Birchi <[email protected]>
  • Loading branch information
Sorin Birchi committed Jun 11, 2024
1 parent b32eca8 commit cd5b0b1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import pytest
from numpy.testing import assert_equal

from brian2units.units.unitsafefunctions import arange, linspace
from brian2units.units.allunits import *
from brian2units.units.fundamentalunits import (
from units.unitsafefunctions import arange, linspace
from units.allunits import *
from units.fundamentalunits import (
DIMENSIONLESS,
UFUNCS_DIMENSIONLESS,
UFUNCS_DIMENSIONLESS_TWOARGS,
Expand All @@ -27,7 +27,7 @@
is_dimensionless,
is_scalar_type,
)
from brian2units.units.stdunits import Hz, cm, kHz, mM, ms, mV, nA, nS
from units.stdunits import Hz, cm, kHz, mM, ms, mV, nA, nS

# To work around an issue in matplotlib 1.3.1 (see
# https://github.com/matplotlib/matplotlib/pull/2591), we make `ravel`
Expand Down Expand Up @@ -799,7 +799,7 @@ def test_unit_discarding_functions():
"""
Test functions that discard units.
"""
from brian2units.units.unitsafefunctions import ones_like, zeros_like
from units.unitsafefunctions import ones_like, zeros_like

values = [3 * mV, np.array([1, 2]) * mV, np.arange(12).reshape(3, 4) * mV]
for value in values:
Expand All @@ -816,7 +816,7 @@ def test_unitsafe_functions():
"""
Test the unitsafe functions wrapping their numpy counterparts.
"""
from brian2units.units.unitsafefunctions import (
from units.unitsafefunctions import (
arccos,
arccosh,
arcsin,
Expand Down Expand Up @@ -883,7 +883,7 @@ def test_special_case_numpy_functions():
"""
Test a couple of functions/methods that need special treatment.
"""
from brian2units.units.unitsafefunctions import diagonal, dot, ravel, trace, where
from units.unitsafefunctions import diagonal, dot, ravel, trace, where

quadratic_matrix = np.reshape(np.arange(9), (3, 3)) * mV

Expand Down Expand Up @@ -1006,7 +1006,7 @@ def test_numpy_functions_same_dimensions():
values = [np.array([1, 2]), np.ones((3, 3))]
units = [volt, second, siemens, mV, kHz]

from brian2units.units.unitsafefunctions import ptp
from units.unitsafefunctions import ptp

# numpy functions
keep_dim_funcs = [
Expand Down Expand Up @@ -1394,7 +1394,7 @@ def test_switching_off_unit_checks():
"""
Check switching off unit checks (used for external functions).
"""
import brian2units.units.fundamentalunits as fundamentalunits
import units.fundamentalunits as fundamentalunits

x = 3 * second
y = 5 * volt
Expand Down Expand Up @@ -1501,7 +1501,7 @@ def test_units_vs_quantities():


def test_all_units_list():
from brian2units.units.allunits import all_units
from units.allunits import all_units

assert meter in all_units
assert volt in all_units
Expand All @@ -1512,7 +1512,7 @@ def test_all_units_list():


def test_constants():
import brian2units.units.constants as constants
import units.constants as constants

# Check that the expected names exist and have the correct dimensions
assert constants.avogadro_constant.dim == (1 / mole).dim
Expand Down

0 comments on commit cd5b0b1

Please sign in to comment.