Skip to content

Commit

Permalink
Merge pull request #16 from tbeason/for-df21
Browse files Browse the repository at this point in the history
Update runtests.jl
  • Loading branch information
tbeason authored Aug 14, 2020
2 parents ef37e2c + 0f8599f commit b775f35
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ os:
- osx
julia:
- 1.0
- 1.1
- 1.2
- 1.3
- 1.4
- 1.5
- nightly
notifications:
email: false
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DailyTreasuryYieldCurve"
uuid = "9f24bdcd-220e-43b5-8e6d-85812fd68fcf"
authors = ["Tyler Beason <[email protected]>"]
version = "0.2.0"
version = "0.2.1"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand All @@ -13,7 +13,7 @@ Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
DataFrames = "^0.20"
DataFrames = "0.20,0.21"
EzXML = "^1"
HTTP = "^0.8"
Interpolations = "^0.12"
Expand Down
4 changes: 2 additions & 2 deletions src/DailyTreasuryYieldCurve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const COLNAMESREAL = [:id,:date,:y5,:y7,:y10,:y20,:y30]


"""
`getyieldcurves(;real::Bool=false,begdt::Date=Date(1990,1,2),enddt::Date=today())`
getyieldcurves(;real::Bool=false,begdt::Date=Date(1990,1,2),enddt::Date=today())
Download the whole published history of daily US Treasury yield curves from the official data feed.
Expand Down Expand Up @@ -68,7 +68,7 @@ end


"""
`_parseyieldcurves(thexml,realrates)`
_parseyieldcurves(thexml,realrates)
Parser function for Treasury yield curve data. (unexported)
"""
Expand Down
8 changes: 4 additions & 4 deletions src/interp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const TTMREAL = (;Iterators.zip(DailyTreasuryYieldCurve.COLNAMESREAL[3:end],DAYS


"""
`RateInterpolator`
RateInterpolator
A container for the series of daily yield curve interpolators.
Expand Down Expand Up @@ -42,7 +42,7 @@ end


"""
`createRateInterpolator(df;realrates::Bool=false)`
createRateInterpolator(df;realrates::Bool=false)
Preferred method to construct a [`RateInterpolator`](@ref), just pass the `df` that you get from [`getyieldcurves`](@ref).
"""
Expand All @@ -51,7 +51,7 @@ function createRateInterpolator(df0;realrates::Bool=false)
df = df0[loc,:]
dates = unique(df.date)

dfs = DataFrames.stack(df,Not(:date))
dfs = DataFrames.stack(df,Not(:date); variable_eltype=Symbol)
if realrates
dfs.DTM = [TTMREAL[k] for k in dfs.variable]
else
Expand All @@ -68,7 +68,7 @@ end


"""
`buildsingleinterpolator(df::AbstractDataFrame)`
buildsingleinterpolator(df::AbstractDataFrame)
Builds a single (one day) interpolation of the yield curve. Used in `createRateInterpolator`.
"""
Expand Down
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ testdf = getyieldcurves()

@testset "Nominal" begin

@test names(testdf) == DailyTreasuryYieldCurve.COLNAMES[2:end-1]
@test Symbol.(names(testdf)) == DailyTreasuryYieldCurve.COLNAMES[2:end-1]

@test testdf[1,:date] == Date(1990,1,2)

Expand All @@ -16,7 +16,7 @@ end
@testset "Real" begin
testdfr = getyieldcurves(;realrates=true)

@test names(testdfr) == DailyTreasuryYieldCurve.COLNAMESREAL[2:end]
@test Symbol.(names(testdfr)) == DailyTreasuryYieldCurve.COLNAMESREAL[2:end]

@test testdfr[1,:date] == Date(2003,1,2)

Expand All @@ -40,4 +40,4 @@ end
filter!(row->Date(2019,1,1) <= row.date <= Date(2019,12,31),testdf)

@test testdf == smalltestdf
end
end

2 comments on commit b775f35

@tbeason
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/19527

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" b775f352700289295fe5309d9a31f90e2b089c73
git push origin v0.2.1

Please sign in to comment.