Skip to content

Commit

Permalink
removing tickers field from universe for now (unused)
Browse files Browse the repository at this point in the history
  • Loading branch information
dysonance committed Dec 12, 2017
1 parent 95c2866 commit 2961c15
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/universe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ Type and methods to simplify data sourcing and management of the universe of tra

const SEPARATORS = ['/', '_', '.']

function guess_tickers(assets::Vector{String})::Vector{Symbol}
tickers = Symbol.([Temporal.namefix(split(asset, SEPARATORS)[end]) for asset in assets])
@assert tickers == unique(tickers) "Non-unique ticker symbols found in universe"
return tickers
end
# function guess_tickers(assets::Vector{String})::Vector{Symbol}
# tickers = Symbol.([Temporal.namefix(split(asset, SEPARATORS)[end]) for asset in assets])
# @assert tickers == unique(tickers) "Non-unique ticker symbols found in universe"
# return tickers
# end

mutable struct Universe
assets::Vector{String}
tickers::Vector{Symbol}
# tickers::Vector{Symbol}
data::Dict{String,TS}
from::TimeType
thru::TimeType
function Universe(assets::Vector{String}, from::TimeType=Base.Dates.Date(0), thru::TimeType=Base.Dates.today())
@assert assets == unique(assets)
tickers = guess_tickers(assets)
# tickers = guess_tickers(assets)
data = Dict{String,TS}()
@inbounds for asset in assets
data[asset] = TS()
end
return new(assets, tickers, data, from, thru)
return new(assets, data, from, thru)
end
end

Expand Down

0 comments on commit 2961c15

Please sign in to comment.