generated from opensafely/research-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from opensafely/update-local-actions
Update local actions
- Loading branch information
Showing
9 changed files
with
305 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ model.log | |
__pycache__ | ||
.python-version | ||
/output/* | ||
released_outputs/* | ||
metadata/* | ||
venv/ | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import argparse | ||
import pandas as pd | ||
from pathlib import Path | ||
|
||
from top_5_report import plot_top_codes_over_time | ||
|
||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--input-file", | ||
required=True, | ||
help="Path to single joined measures file", | ||
) | ||
parser.add_argument( | ||
"--output-dir", | ||
required=True, | ||
type=Path, | ||
help="Path to the output directory", | ||
) | ||
parser.add_argument( | ||
"--frequency", | ||
default="month", | ||
choices=["month", "week"], | ||
help="The frequency of the data", | ||
) | ||
parser.add_argument( | ||
"--xtick-frequency", | ||
help="Display every nth xtick", | ||
type=int, | ||
default=1, | ||
) | ||
return parser.parse_args() | ||
|
||
|
||
def main(): | ||
args = parse_args() | ||
df = pd.read_csv(args.input_file) | ||
plot_top_codes_over_time(df, "sore_throat_tonsillitis_rate", args.output_dir, args.frequency, args.xtick_frequency) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.