Skip to content

Commit 3f6be93

Browse files
bump readme, bump version
1 parent 727d14a commit 3f6be93

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ If you want the full details of **any** SOA table, you can use the lower level `
1515
```py
1616
from pymort import MortXML
1717
# load the 2017 Loaded CSO Composite Gender-Blended 20% Male ALB table (tableId = 3282)
18-
xml = MortXML(3282)
18+
xml = MortXML.from_id(3282)
19+
# you can load from a file path on your computer
20+
xml_from_path = MortXML.from_path("t3282.xml")
21+
# you can load from raw xml text
22+
xml_str = Path("t3282.xml").read_text()
23+
xml_from_str = MortXML(xml_str)
1924
```
2025

2126
This `MortXML` class is a wrapper around the [underlying XML](https://mort.soa.org/About.aspx). The autocompletions you get on attributes improve the developer experience over using the underlying XML directly.
@@ -34,7 +39,7 @@ For a select and ultimate table we can retrieve rates as follows.
3439
```py
3540
from pymort import MortXML
3641
# Table 3265 is 2015 VBT Smoker Distinct Male Non-Smoker ANB, see https://mort.soa.org/
37-
xml = MortXML(3265)
42+
xml = MortXML.from_id(3265)
3843
# This is the select table as a MultiIndex (age/duration) DataFrame.
3944
xml.Tables[0].Values
4045
# This is the minimum value of the issue age axis on the select table
@@ -48,8 +53,8 @@ xml.Tables[1].Values
4853
We can get the data from Pandas to NumPy.
4954

5055
```py
51-
select = MortXML(3265).Tables[0].Values.unstack().values
52-
ultimate = MortXML(3265).Tables[1].Values.unstack().values
56+
select = MortXML.from_id(3265).Tables[0].Values.unstack().values
57+
ultimate = MortXML.from_id(3265).Tables[1].Values.unstack().values
5358

5459
select.shape # (78, 25) ages from 18 to 95, duration from 1 to 25
5560
ultimate.shape # (103,) is age 18 to 120

pymort/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = "1.0.0"
1+
__version__ = "2.0.0"
22

33
from .XML import MortXML as MortXML

tests/test_pymort.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
def test_version():
5-
assert __version__ == "1.0.0"
5+
assert __version__ == "2.0.0"

0 commit comments

Comments
 (0)