This repository has been archived by the owner on May 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add back check to differentiate scalars from AbstractArrays
- Loading branch information
Showing
2 changed files
with
6 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,11 @@ type DataTable <: AbstractDataTable | |
if isa(c, Range) | ||
columns[i] = collect(c) | ||
elseif !isa(c, AbstractVector) | ||
throw(DimensionMismatch("columns must be 1-dimensional")) | ||
if isa(c, AbstractArray) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cjprybol
Author
Contributor
|
||
throw(DimensionMismatch("columns must be 1-dimensional")) | ||
else | ||
columns[i] = [c] | ||
end | ||
else | ||
columns[i] = c | ||
end | ||
|
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
This double branch with twice the same instruction isn't pretty. How about just having a
isa(c, AbstractArray) && !isa(c, AbstractVector)
check?