Suzhou-Tongyuan / jnumpy

Writing Python C extensions in Julia within 5 minutes.
MIT License
234 stars 8 forks source link

Check f-contiguous when ndarray have shape like (1, k, 1, 1) #37

Closed songjhaha closed 2 years ago

songjhaha commented 2 years ago

If ndarray is f-contiguous, it should be converted to Array. So, check it when it's both f-contiguous and c-contiguous

  julia> a = np.random.random(py_cast(Py, (1,3,1,1)))
  julia> py_coerce(AbstractArray, a)
  1×3×1×1 Array{Float64, 4}:
  ...
codecov-commenter commented 2 years ago

Codecov Report

Merging #37 (83ffc04) into main (6ced228) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #37   +/-   ##
=======================================
  Coverage   61.92%   61.92%           
=======================================
  Files          11       11           
  Lines         885      885           
=======================================
  Hits          548      548           
  Misses        337      337           
Impacted Files Coverage Δ
TyPython/src/CPython.NumPy.jl 92.77% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.