Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
troubleshoot version 14 and stubbing solution for v0.3 tests
- Loading branch information
milktrader
committed
Mar 13, 2015
1 parent
9195864
commit fe9e462
Showing
8 changed files
with
83 additions
and
14 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@require TimeSeries begin | ||
|
||
""" | ||
Convert a TimeArray into an Array{Timestamp} | ||
```julia | ||
Array{Timestamp}(a::TimeArray) | ||
``` | ||
### Arguments | ||
* `a::TimeArray` | ||
### Returns | ||
* `::Array{Timestamp}` : an array of Timestamp from a TimeArray | ||
### Examples | ||
```julia | ||
using MarketData | ||
Apple = Array{Timestamp}(AAPL) | ||
``` | ||
""" | ||
|
||
function convert(::Type{Array{Timestamps.Timestamp}}, A::TimeSeries.TimeArray) | ||
#stamps = Array(Timestamp, length(A)) | ||
stamps = Timestamp[] | ||
for i in 1:length(A) | ||
push!(stamps, Timestamp(A.timestamp[i], A.values[i])) | ||
# stamps[i] = Timestamp(A.timestamp[i], A.values[i]) | ||
end | ||
stamps | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
abstract AbstractTimestamp | ||
|
||
immutable Timestamp{T} <: AbstractTimestamp | ||
timestamp::Union(Date,Day,DateTime) | ||
value::T | ||
end | ||
|
||
function Base.show{T}(io::IO, ts::Timestamp{T}) | ||
print(io, ts.timestamp, " | ", ts.value) | ||
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 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 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 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 |
---|---|---|
@@ -1,8 +1,15 @@ | ||
using Timestamps, MarketData, FactCheck | ||
|
||
include("timestamp.jl") | ||
include("operators.jl") | ||
include("conversion.jl") | ||
include("arraymethods.jl") | ||
if VERSION < v"0.4-" | ||
include("timestamp.jl") | ||
# include("operators.jl") | ||
# include("conversion.jl") | ||
# include("arraymethods.jl") | ||
else | ||
include("timestamp.jl") | ||
include("operators.jl") | ||
include("conversion.jl") | ||
include("arraymethods.jl") | ||
end | ||
|
||
exitstatus() |
This file was deleted.
Oops, something went wrong.