8000 fix #234 : implemented support for np.__array_ufunc__ by alixdamman · Pull Request #762 · larray-project/larray · GitHub
[go: up one dir, main page]

Skip to content

fix #234 : implemented support for np.__array_ufunc__ #762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
8000 wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
moved imports into functions instead of on top of the module tests/co…
…mmon.py to avoid import loop problems
  • Loading branch information
alixdamman committed Aug 19, 2019
commit 2590c1ccb37edc4b39751f740f9343f6d7b09afc
6 changes: 4 additions & 2 deletions larray/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
except ImportError:
xw = None

from larray import LArray, isnan, aslarray, Metadata


TESTDATADIR = os.path.dirname(__file__)

Expand All @@ -38,6 +36,7 @@ def inputpath(relpath):

def assert_equal_factory(test_func):
def assert_equal(a, b):
from larray.core.array import LArray
if isinstance(a, LArray) and isinstance(b, LArray) and a.axes != b.axes:
raise AssertionError("axes differ:\n%s\n\nvs\n\n%s" % (a.axes.info, b.axes.info))
if not isinstance(a, (np.ndarray, LArray)):
Expand All @@ -57,6 +56,7 @@ def assert_equal(a, b):

def assert_larray_equal_factory(test_func, convert=True, check_axes=False):
def assert_equal(a, b):
from larray.core.array import aslarray
if convert:
a = aslarray(a)
b = aslarray(b)
Expand Down Expand Up @@ -88,6 +88,7 @@ def equal(a, b):


def nan_equal(a, b):
from larray.core.ufuncs import isnan
return (a == b) | (isnan(a) & isnan(b))


Expand Down Expand Up @@ -121,6 +122,7 @@ def tmp_path(tmpdir, fname):

@pytest.fixture
def meta():
from larray.core.metadata import Metadata
title = 'test array'
description = 'Array used for testing'
author = 'John Cleese'
Expand Down
0