Commit 27d8f385 authored by Michel Juillard's avatar Michel Juillard
Browse files

fixing infinite loop in constructor

parent b0cb0d1e
......@@ -19,9 +19,10 @@ TimeDataFrame() = TimeDataFrame(DataFrame(), Vector{Period}(), true,
TimeDataFrame(frequency::Frequency) = TimeDataFrame(DataFrame(),
Vector{Period}(), true, frequency)
function TimeDataFrame(dataframe::AbstractDataFrame, frequency::Frequency, firstperiod)
function TimeDataFrame(dataframe::AbstractDataFrame, frequency::Frequency, firstperiod;
copycol::Bool=true)
periods = [Period(firstperiod + i - 1, 0, frequency) for i in 1:DataFrames.nrow(dataframe)]
TimeDataFrame(dataframe, periods, true, frequency)
TimeDataFrame(DataFrame(dataframe; copycols), periods, true, frequency)
end
function TimeDataFrame(filename::String, frequency::Frequency, firstperiod)
......@@ -31,10 +32,6 @@ function TimeDataFrame(filename::String, frequency::Frequency, firstperiod)
TimeDataFrame(data, periods, true, frequency)
end
TimeDataFrame(df::DataFrame, frequency::Frequency, firstperiod;
copycols::Bool=true) =
TimeDataFrame(DataFrame(df; copycols),
frequency, firstperiod)
TimeDataFrame(frequency::Frequency, firstperiod, pairs::Pair{Symbol,<:Any}...;
makeunique::Bool=false, copycols::Bool=true) =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment