Skip to content

Commit

Permalink
added exceptions to kfre_person(), included acknowledgements
Browse files Browse the repository at this point in the history
  • Loading branch information
lshpaner committed Jun 10, 2024
1 parent f720d5c commit 95204ef
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
5 changes: 4 additions & 1 deletion min_readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If you use `kfre` in your research or projects, please consider citing it.
month = may,
year = 2024,
publisher = {Zenodo},
version = {0.1.6},
version = {0.1.7},
doi = {10.5281/zenodo.11100222},
url = {https://doi.org/10.5281/zenodo.11100222}
}
Expand All @@ -66,6 +66,9 @@ The KFRE model developed by Tangri et al. has made significant contributions to

The `kfre` library is based on the risk prediction models developed in the studies referenced below. Please refer to these studies for an in-depth understanding of the kidney failure risk prediction models used within this library.

Special thanks to Panayiotis Petousis, PhD, Obidiugwu Duru, MD, MS, Kenn B. Daratha, PhD, Keith C. Norris, MD, PhD, Katherine R. Tuttle MD, FASN, FACP, FNKF, Susanne B. Nicholas, MD, MPH, PhD, and Alex Bui, PhD. Their exceptional work on end-stage kidney disease has greatly inspired the creation of this library.


## References
Sumida, K., Nadkarni, G. N., Grams, M. E., Sang, Y., Ballew, S. H., Coresh, J., Matsushita, K., Surapaneni, A., Brunskill, N., Chadban, S. J., Chang, A. R., Cirillo, M., Daratha, K. B., Gansevoort, R. T., Garg, A. X., Iacoviello, L., Kayama, T., Konta, T., Kovesdy, C. P., Lash, J., Lee, B. J., Major, R. W., Metzger, M., Miura, K., Naimark, D. M. J., Nelson, R. G., Sawhney, S., Stempniewicz, N., Tang, M., Townsend, R. R., Traynor, J. P., Valdivielso, J. M., Wetzels, J., Polkinghorne, K. R., & Heerspink, H. J. L. (2020). Conversion of urine protein-creatinine ratio or urine dipstick protein to urine albumin-creatinine ratio for use in chronic kidney disease screening and prognosis. *Annals of Internal Medicine*, *173*(6), 426-435. https://doi.org/10.7326/M20-0529

Expand Down
24 changes: 24 additions & 0 deletions src/kfre/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,30 @@ def kfre_person(
Returns:
- float: The computed risk of developing CKD.
"""
if age is None:
raise ValueError("Must supply a value for age.")

if is_male is None:
raise ValueError("Must specify sex using True or False for is_male.")

if eGFR is None:
raise ValueError("Must supply a value for eGFR.")

if uACR is None:
raise ValueError("Must supply a value for uACR.")

if years not in [2, 5]:
raise ValueError("Value must be 2 or 5 for 2-year risk or 5-year risk.")

if dm is not None and dm not in [0, 1, True, False]:
raise ValueError("The dm parameter must be either 0, 1, True, or False.")

if htn is not None and htn not in [0, 1, True, False]:
raise ValueError("The htn parameter must be either 0, 1, True, or False.")

if is_north_american is None:
raise ValueError("Must specify True or False for is_north_american.")

# Use is_male directly, since it's already a boolean
# Call the risk prediction function with the parameters
risk_prediction = risk_pred(
Expand Down

0 comments on commit 95204ef

Please sign in to comment.