From 8de8311963e25128985a5e53d88d898f625127f6 Mon Sep 17 00:00:00 2001 From: David Wales Date: Wed, 6 Dec 2023 14:44:28 +1100 Subject: [PATCH] Reduce default extract size to last 30 days Change default start_date for download_pmhc_mds function to 30 days before the current date. --- src/pmhclib/pmhc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pmhclib/pmhc.py b/src/pmhclib/pmhc.py index bd7f364..4aec2a3 100644 --- a/src/pmhclib/pmhc.py +++ b/src/pmhclib/pmhc.py @@ -17,7 +17,7 @@ import shutil import time from dataclasses import dataclass -from datetime import datetime, date +from datetime import datetime, date, timedelta from enum import Enum, unique from getpass import getpass from pathlib import Path @@ -314,7 +314,7 @@ def is_upload_processing(self) -> bool: def download_pmhc_mds( self, output_directory: Path = Path("."), - start_date: date = date(2016, 1, 1), + start_date: date = date.today() - timedelta(days=30), end_date: date = date.today(), organisation_path: Optional[str] = None, specification: PMHCSpecification = PMHCSpecification.ALL, @@ -322,8 +322,8 @@ def download_pmhc_mds( matched_episodes: bool = True, ) -> Path: """Extract PMHC MDS Data within the date range. If no date range - is given, `start_date` defaults to `2016-01-01` and `end_date` - defaults to the current date. + is given, `start_date` defaults to 30 days before the current + date and `end_date` defaults to the current date. :param output_directory: directory to save download :param start_date: start date for extract