Closed songjhaha closed 2 years ago
Merging #36 (a4df9f3) into main (7e1b5c6) will increase coverage by
0.58%
. The diff coverage is97.05%
.
@@ Coverage Diff @@
## main #36 +/- ##
==========================================
+ Coverage 61.33% 61.92% +0.58%
==========================================
Files 11 11
Lines 869 885 +16
==========================================
+ Hits 533 548 +15
- Misses 336 337 +1
Impacted Files | Coverage Δ | |
---|---|---|
TyPython/src/CPython.jl | 67.74% <ø> (ø) |
|
TyPython/src/CPython.Julia.jl | 95.06% <95.23%> (-0.26%) |
:arrow_down: |
TyPython/src/CPython.NumPy.jl | 92.77% <100.00%> (+0.87%) |
:arrow_up: |
TyPython/src/CPython.ORM.jl | 97.92% <100.00%> (-0.11%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Fix https://github.com/Suzhou-Tongyuan/jnumpy/issues/35 by the way
Is it fine to merge now? @songjhaha
Is it fine to merge now? @songjhaha
fine
Here is the rule of conversion of ndarray:
x is a
numpy.ndarray
from_ndarray(x)
returns anArray
in julia with same shape.from_ndarray(x)
returns aTranspose
orPermutedDimsArray
in julia with same shape.py_coerce(T, x)
will first convert x withconver(T, from_ndarray(x))
, ifT
isArray
butfrom_ndarray(x)
returns aTranspose
orPermutedDimsArray
, we still need to copy data into a new Array.y is a julia's
StridedArray
(orTranspose
\PermutedDimsArray
)StridedArray
,py_cast(Py, y)
returns a col-majorndarray
.Transpose
,py_cast(Py, y)
returns a row-majorndarray
.PermutedDimsArray
,py_cast(Py, y)
first convertsy.parent
tondarray
then transposes it with same permutation.