Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function to supersede Summarize function to summarise results -- with more flexibilitythan previous utility function #1457

Merged
merged 16 commits into from
Dec 13, 2024

Conversation

tbhallett
Copy link
Collaborator

Fixes #1420

… that function (without disturbing the original summarize function, upon which many analayis script rely.)
Copy link
Collaborator

@mnjowe mnjowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Tim. The PR looks great!
Find below my suggestions which I feel are all optional. Thanks

src/tlo/analysis/utils.py Outdated Show resolved Hide resolved
src/tlo/analysis/utils.py Outdated Show resolved Hide resolved
src/tlo/analysis/utils.py Show resolved Hide resolved
src/tlo/analysis/utils.py Show resolved Hide resolved
src/tlo/analysis/utils.py Show resolved Hide resolved
Comment on lines 321 to 325
:Param: results: The pd.DataFame of results.
:Param: central_measure: The name of the central measure to use - either 'mean' or 'median'.
:Param: width_of_range: The width of the range to compute the statistics (e.g. 0.95 for the 95% interval).
:Param: collapse_columns: Whether to simplify the columnar index if there is only one run (cannot be done otherwise)
:Param: only_central: Whether to only report the central value (dropping the range).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:Param: results: The pd.DataFame of results.
:Param: central_measure: The name of the central measure to use - either 'mean' or 'median'.
:Param: width_of_range: The width of the range to compute the statistics (e.g. 0.95 for the 95% interval).
:Param: collapse_columns: Whether to simplify the columnar index if there is only one run (cannot be done otherwise)
:Param: only_central: Whether to only report the central value (dropping the range).
:param results: The dataframe of results to compute summary statistics of.
:param central_measure: The name of the central measure to use - either 'mean' or 'median'.
:param width_of_range: The width of the range to compute the statistics (e.g. 0.95 for the 95% interval).
:param collapse_columns: Whether to simplify the columnar index if there is only one run (cannot be done otherwise).
:param only_central: Whether to only report the central value (dropping the range).
:return: A dataframe with computed summary statistics.

Small update to fix parameter directive syntax in docstring and adding return information.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs lowercase p in param

Copy link
Collaborator Author

@tbhallett tbhallett Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is now a lowercase piece (I believe). This view seems to be out-dated.

src/tlo/analysis/utils.py Outdated Show resolved Hide resolved
src/tlo/analysis/utils.py Outdated Show resolved Hide resolved
src/tlo/analysis/utils.py Show resolved Hide resolved
@tbhallett tbhallett changed the title Summarise function to summarise results -- with more flexibilitythan previous utility function New function to supersede Summarize function to summarise results -- with more flexibilitythan previous utility function Dec 13, 2024
Copy link
Collaborator

@matt-graham matt-graham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tbhallett for the updates, this looks all good to me now!

@tbhallett tbhallett merged commit 3ddc201 into master Dec 13, 2024
62 checks passed
@tbhallett tbhallett deleted the hallett/fix-1420 branch December 13, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

summarize to (optionally) use MEDIAN instead of MEAN as central summary
4 participants