Skip to content

Commit

Permalink
Merge pull request #15 from ihmeuw-msca/improve-docstrings
Browse files Browse the repository at this point in the history
Improve docstrings, apply linting, and perform some refactoring on variable names to be more consistent with new terminology
  • Loading branch information
AHsu98 authored Feb 6, 2023
2 parents 91e99c8 + 4ba2157 commit b456126
Show file tree
Hide file tree
Showing 7 changed files with 725 additions and 445 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.typeCheckingMode": "off"
}
22 changes: 11 additions & 11 deletions examples/Basic Splitting Examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"source": [
"populations=np.array([20,10,5])\n",
"rate_pattern=np.array([0.1,0.5,0.7])\n",
"measured_count=31\n",
"measured_count_SE=2.5"
"observed_total=31\n",
"observed_total_SE=2.5"
]
},
{
Expand All @@ -55,10 +55,10 @@
],
"source": [
"estimate,SE,CI=split_datapoint(\n",
" measured_count,\n",
" observed_total,\n",
" populations,\n",
" rate_pattern,\n",
" measured_count_SE,\n",
" observed_total_SE,\n",
" model=RateMultiplicativeModel()\n",
")\n",
"print(\"Estimated incidence in each group\")\n",
Expand Down Expand Up @@ -95,10 +95,10 @@
],
"source": [
"estimate,SE,CI=split_datapoint(\n",
" measured_count,\n",
" observed_total,\n",
" populations,\n",
" rate_pattern,\n",
" measured_count_SE,\n",
" observed_total_SE,\n",
" model=LogOdds_model()\n",
")\n",
"print(\"Estimated incidence in each group\")\n",
Expand Down Expand Up @@ -140,15 +140,15 @@
"source": [
"populations=np.array([20,10])\n",
"pattern=np.array([0.1,0.5])\n",
"measured_count=20\n",
"observed_total=20\n",
"print(split_datapoint(\n",
" measured_count,\n",
" observed_total,\n",
" populations,\n",
" pattern,\n",
" model=RateMultiplicativeModel()\n",
"))\n",
"print(split_datapoint(\n",
" measured_count,\n",
" observed_total,\n",
" populations,\n",
" pattern,\n",
" model=LogOdds_model()\n",
Expand Down Expand Up @@ -205,8 +205,8 @@
"#Fit with study_props, the study population proportions\n",
"sex_splitting_model.fit_beta(\n",
" bucket_populations=study_props,\n",
" measured_count=observed_study_rate,\n",
" measured_count_se=study_se\n",
" observed_total=observed_study_rate,\n",
" observed_total_se=study_se\n",
")\n",
"\n",
"#Predict with population proportions\n",
Expand Down
Loading

0 comments on commit b456126

Please sign in to comment.