-
Notifications
You must be signed in to change notification settings - Fork 88
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
WIP: Enable PyPy #409
Closed
Closed
WIP: Enable PyPy #409
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are a couple test failures, but surprisingly not that many =================================== FAILURES ===================================
______________________________ test_encode_decode ______________________________
def test_encode_decode():
for arr, codec in itertools.product(arrays, codecs):
> check_encode_decode(arr, codec)
numcodecs/tests/test_lzma.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
numcodecs/tests/common.py:59: in check_encode_decode
compare_arrays(arr, dec, precision=precision)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
arr = array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20,...1, 982, 983, 984, 985, 986, 987,
988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999],
dtype=int32)
res = array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20,..., 232, 233,
234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,
247, 248, 249], dtype=int32)
precision = None
def compare_arrays(arr, res, precision=None):
# ensure numpy array with matching dtype
res = ensure_ndarray(res).view(arr.dtype)
# convert to correct shape
if arr.flags.f_contiguous:
order = 'F'
else:
order = 'C'
> res = res.reshape(arr.shape, order=order)
E ValueError: cannot reshape array of size 250 into shape (1000,)
numcodecs/tests/common.py:34: ValueError
_______________________________ test_encode_none _______________________________
def test_encode_none():
a = np.array([b'foo', None, b'bar'], dtype=object)
codec = VLenBytes()
> enc = codec.encode(a)
numcodecs/tests/test_vlen_bytes.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> store_le32(<uint8_t*>data, l)
E TypeError: expected bytes, NoneType found
numcodecs/vlen.pyx:250: TypeError
---------- coverage: platform linux, python 3.9.18-final-0 -----------
Coverage XML written to file coverage.xml
=========================== short test summary info ============================
FAILED numcodecs/tests/test_lzma.py::test_encode_decode - ValueError: cannot reshape array of size 250 into shape (1000,)
FAILED numcodecs/tests/test_vlen_bytes.py::test_encode_none - TypeError: expected bytes, NoneType found
======= 2 failed, 582 passed, 35 skipped, 36 xfailed in 75.66s (0:01:15) ======= |
These may not have been part of Cython in the past. Now that they are, `cimport` them instead of using `extern`.
Needed for `PyUnicode_FromStringAndSize`, which wasn't added until Cython 3.0.0. Other `unicode` and `bytearray` operations have been around longer, but this one is relatively new.
Closed
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 57 57
Lines 2261 2261
=========================================
Hits 2261 2261
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add PyPy 3.9 to CI.
TODO: