Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add copy function to TimeArray #352

Merged
merged 2 commits into from Dec 20, 2017
Merged

Add copy function to TimeArray #352

merged 2 commits into from Dec 20, 2017

Conversation

iht
Copy link
Contributor

@iht iht commented Dec 19, 2017

The copy base function is necessary to use the Bootstrap package.

The Bootstrap package will also need some changes, but this paves the way to being able to use both packages together.

@iblislin iblislin added this to the 0.12.0 milestone Dec 20, 2017
src/timearray.jl Outdated
###### copy ###############

copy(ta::TimeArray)::TimeArray =
TimeArray(ta.timestamp, ta.values, ta.colnames, ta.meta)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make it 4-space indented?

@@ -56,6 +56,11 @@ convert(::Type{TimeArray{Float64, 2}}, x::TimeArray{Bool, 2}) =
convert(x::TimeArray{Bool, 1}) = convert(TimeArray{Float64, 1}, x::TimeArray{Bool, 1})
convert(x::TimeArray{Bool, 2}) = convert(TimeArray{Float64, 2}, x::TimeArray{Bool, 2})

###### copy ###############

copy(ta::TimeArray)::TimeArray =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think our compiler is smart enough, and we do not need return type annotation here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if it is redundant, I prefer to annotate types as much as possible. But I will adapt to the style you prefer. Would you prefer to remove the output type?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'm fine with current.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 85.987% when pulling d836e2e on iht:copy_func into 761d19a on JuliaStats:master.

@iblislin iblislin merged commit c09aa52 into JuliaStats:master Dec 20, 2017
@iht
Copy link
Contributor Author

iht commented Dec 20, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants