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

refactor stuff to get hhs file paths into its own function #14

Open
elray1 opened this issue Apr 17, 2024 · 0 comments
Open

refactor stuff to get hhs file paths into its own function #14

elray1 opened this issue Apr 17, 2024 · 0 comments

Comments

@elray1
Copy link
Contributor

elray1 commented Apr 17, 2024

e.g., pull these lines out into a separate function such as get_hhs_file_path:

if drop_pandemic_seasons:
if as_of is None:
file_path = 'influenza-hhs/hhs.csv'
else:
# find the largest stored file dated on or before the as_of date
as_of_file_path = f'influenza-hhs/hhs-{str(as_of)}.csv'
all_file_paths = sorted(glob.glob('influenza-hhs/hhs-????-??-??.csv', root_dir = self.data_raw))
all_file_paths = [f for f in all_file_paths if f <= as_of_file_path]
file_path = all_file_paths[-1]
else:
file_path = 'influenza-hhs/hhs_complete.csv'

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

No branches or pull requests

1 participant