Skip to content

Commit

Permalink
Merge pull request #39 from JuliaActuary/get_SOA
Browse files Browse the repository at this point in the history
add warnings to http calls
  • Loading branch information
alecloudenback authored Apr 29, 2020
2 parents 18ca3c5 + 124334b commit 603b80c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ omega(table, issue_age)

Comes with some tables built in via [mort.SOA.org](https://mort.soa.org) and by using [you agree to their terms](https://mort.soa.org/TermsOfUse.aspx).

Not all tables have been tested that they work by default, though I have not encountered issues with any of the the VBT/CSO/other usual tables.
Not all tables have been tested that they work by default, though no issues have
been reported with any of the the VBT/CSO/other common tables.

Sample of some of the included table sets:
```
Expand All @@ -261,7 +262,9 @@ Sample of some of the included table sets:
### Getting tables from [mort.SOA.org](https://mort.soa.org)

Given a table id ([for example](https://mort.soa.org/ViewTable.aspx?&TableIdentity=60029) `60029`)
you can request the table directly from the SOA's mortality table service.
you can request the table directly from the SOA's mortality table service. Remember
that not all tables have been tested, though the standard source format should mean
compatibility with `MortalityTables.jl`.

```
aus_life_table_female = get_SOA_table(60029)
Expand Down
3 changes: 3 additions & 0 deletions src/get_SOA_table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ using HTTP
get_SOA_table(id)
Given the id of a `mort.SOA.org` table, grab it and return it as a `MortalityTable`.
!! Remember that not all tables have been tested to work.
"""
function get_SOA_table(id::Int)
path = "https://mort.soa.org/Export.aspx?Type=xml&TableIdentity=$id"
Expand Down Expand Up @@ -30,6 +32,7 @@ the table acting as the added key in the dictionary.
This modifies the given `dict` (as is indicated by the conventional `!` at the end
of the function name).
!! Remember that not all tables have been tested to work.
"""
function get_SOA_table!(dict,id::Int)
path = "https://mort.soa.org/Export.aspx?Type=xml&TableIdentity=$id"
Expand Down

0 comments on commit 603b80c

Please sign in to comment.