Skip to content

Commit

Permalink
NpyArray.CheckFromAny wasn't converting arrays to native byte order.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason McCampbell (Enthought, Inc) committed Mar 2, 2011
1 parent fdf6346 commit b671e9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numpy/NumpyDotNet/NpyArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public static ndarray CheckFromAny(Object src, dtype descr, int minDepth,
int maxDepth, int requires, Object context) {

if ((requires & NpyDefs.NPY_NOTSWAPPED) != 0) {
if (descr != null && src is ndarray &&
((ndarray)src).Dtype.IsNativeByteOrder) {
if (descr == null && src is ndarray &&
!((ndarray)src).Dtype.IsNativeByteOrder) {
descr = new dtype(((ndarray)src).Dtype);
} else if (descr != null && !descr.IsNativeByteOrder) {
// Descr replace
Expand Down

0 comments on commit b671e9a

Please sign in to comment.