Skip to content

Commit

Permalink
Remove EOL whitespace. (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdav authored Aug 26, 2024
1 parent 43647b3 commit a0ea9dd
Show file tree
Hide file tree
Showing 6 changed files with 282 additions and 282 deletions.
6 changes: 3 additions & 3 deletions PythonKit/NumpyConversion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,18 @@ where Element : NumpyScalarCompatible {
guard Element.numpyScalarTypes.contains(numpyArray.dtype) else {
return nil
}

// Only 1-D `ndarray` instances can be converted to `Array`.
let pyShape = numpyArray.__array_interface__["shape"]
guard let shape = Array<Int>(pyShape) else { return nil }
guard shape.count == 1 else {
return nil
}

// Make sure that the array is contiguous in memory. This does a copy if
// the array is not already contiguous in memory.
let contiguousNumpyArray = np.ascontiguousarray(numpyArray)

guard let ptrVal =
UInt(contiguousNumpyArray.__array_interface__["data"].tuple2.0) else {
return nil
Expand Down
Loading

0 comments on commit a0ea9dd

Please sign in to comment.