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

Paper figures #77

Merged
merged 12 commits into from
Aug 4, 2023
Merged

Paper figures #77

merged 12 commits into from
Aug 4, 2023

Conversation

ccunningham101
Copy link
Contributor

Given feedback on figures from team meeting, the main goals were

  1. Remove dark background
  2. Remove log scale, and replace with multi-panel figure
  3. Make the figures "look better"

This was achieved by switching from using plot_measures_report to using panel_plots for paper figures 1 and 2, which meant a chunk of code that was in panel plots (grouping the medication measures, generating the season tables and annotating seasonal max/min) had to move from plot_measures report into the shared utilities.

Panel plots were also modified to make a 1 column panel plot look better, as the width makes the panels more legible.

The project yaml has been updated to ensure that all papers/figures (including supplemental) are captured in an action.

This allows fontsizes to change when chaging the 'basefontsize'
configurable parameter.
For the paper, we want a panel plot, with one panel for each medication
group.

Ideally we would make new measures to count patients with each
medication type, but this has been done after-the-fact.

Panel plots subsetting requires a measures file and measures pattern.
But because the grouped medications measures do not exist in the
measures file we cannot do this.

Make a new action to make a measures file. This way it can be fed
directly into a panel plot action.
These time series are easier to read when they are a bit wider. First
actually allow the user to control how many columns are in the plot.

And now that we are using a panel plot for multiple population
level measures, allow the user to hide the legend (and resize
accordingly) if the legend is redundant.
Depending on what type of plot we want to generate (a panel plot, or a
single plot with plot measures report), we want to be able to make a
season table and annotate the seasons in either case.

Move this code into utils so it can be used by both scripts.
Annotating the plot with max/min arrows and counts was a bit cluttered
and confusing, and less necessary since we are not plotting on the log
scale. Instead just plot a marker for the max, and refer to the season
table.
Measure tables can have ["REDACTED"] in them, which causes the column to
be mixed type string and float. Use read_csv to specify null type, and
that numerator, denominator, and value are floats at load time, rather
than having to do it after the fact.

Make sure all actions use this function rather than their own read_csv.

And some other minor cleanup
Utilizing the new settings
Dummy data tends to have more redactions, and hits the case where there
is no data for the season table, or only data for 2022/23. Return None
in these cases.
Table1 code was copied from another project. Use local utility functions
where possible.
Copy link
Contributor

@LFISHER7 LFISHER7 left a comment

Choose a reason for hiding this comment

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

Looks good! One thing to note, is that our docs currently say all tables should be .csv or .tsv. I don't think you need to change them - we should think about how to support your workflow

@ccunningham101
Copy link
Contributor Author

The current workflow is to use pandoc with a template docx to make a formatted docx table
i.e. pandoc -f html -t docx -s table1.html -o table1.docx
But I should commit that template doc and maybe a bash script to run the conversions
Will do that in a separate PR

@ccunningham101 ccunningham101 merged commit e47fc94 into main Aug 4, 2023
1 check passed
@ccunningham101 ccunningham101 deleted the paper-figures branch August 4, 2023 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants