Ejemplo n.º 1
0
def test_atleast2d_with_units():
    """Test that atleast_2d wrapper can handle plain array with units."""
    assert_array_equal(atleast_2d(1 * units.degC),
                       np.array([[1]]) * units.degC)
Ejemplo n.º 2
0
def test_atleast2d_without_units():
    """Test that atleast_2d wrapper can handle plain arrays."""
    assert_array_equal(atleast_2d(1), np.array([[1]]))
Ejemplo n.º 3
0
def test_atleast2d_with_units():
    """Test that atleast_2d wrapper can handle plain array with units."""
    assert_array_equal(
        atleast_2d(1 * units.degC), np.array([[1]]) * units.degC)