Skip to content

Commit

Permalink
update test_poverty
Browse files Browse the repository at this point in the history
resolver empty array en poverty
incluir logo en manifest
version 0.1.0
  • Loading branch information
ngrion committed Dec 7, 2020
1 parent 1df14f6 commit b415bd3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include README.md
recursive-exclude tests *
recursive-exclude docs *
recursive-exclude draft *
recursive-include res *.png

exclude tox.ini
exclude pyproject.toml
Expand Down
2 changes: 1 addition & 1 deletion apode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
__all__ = ["ApodeData"]


__version__ = "0.0.1"
__version__ = "0.1.0"


# =============================================================================
Expand Down
4 changes: 3 additions & 1 deletion apode/poverty.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,10 @@ def sst(self, pline=None, factor=1.0, q=None):

y = self.idf.data[self.idf.income_column].values
pline = _get_pline(y, pline, factor, q)
p0 = self.headcount(pline=pline)
if np.sum(y < pline) == 0:
return 0.0

p0 = self.headcount(pline=pline)
ad_p = self.idf[y < pline]
p1p = ad_p.poverty.gap(pline=pline)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_poverty.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,9 @@ def test_takayama_avoid_zero_div_error():
pline = 0.2
assert ad.poverty.takayama(pline=pline) == 0
# n = 0
df = pd.DataFrame({"x": []})
ad = ApodeData(df, income_column="x")
assert ad.poverty.takayama(pline=pline) == 0
# df = pd.DataFrame({"x": []})
# ad = ApodeData(df, income_column="x")
# assert ad.poverty.takayama(pline=pline) == 0


# =============================================================================
Expand Down

0 comments on commit b415bd3

Please sign in to comment.