From 85deee78430845ec3a7d6dc7af3484057001f5d3 Mon Sep 17 00:00:00 2001 From: Jake Pullen Date: Tue, 9 Dec 2025 18:23:17 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=9A=91=EF=B8=8F=20Updated=20docume?= =?UTF-8?q?ntation=20and=20small=20tweaks=20to=20tidy=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 5 ----- main.py | 20 ++++++++++---------- pyproject.toml | 2 +- uv.lock | 2 +- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/README.MD b/README.MD index c234d8e..85db07c 100644 --- a/README.MD +++ b/README.MD @@ -9,7 +9,6 @@ The project consists of a main pipeline workflow that processes multiple modules - `main.py`: Main pipeline orchestrator that calls on the modules as needed - `batch_nimrod.py`: Module for batch processing multiple NIMROD files with configurable bounding boxes - `generate_timeseries.py`: Module for extracting cropped rain data and creating rainfall timeseries -- `combine_timeseries.py`: Module for combining grouped timeseries CSVs into consolidated datasets ## Features @@ -31,10 +30,6 @@ The project consists of a main pipeline workflow that processes multiple modules - Extract cropped rain data based on specified locations - Create rainfall timeseries CSVs for each location - Parse datetime from filename and create proper datetime index - -### combine_timeseries.py - -- Combine multiple timeseries CSV files into grouped datasets - Group locations by specified output groups - Create consolidated CSV files for each group diff --git a/main.py b/main.py index d244034..b038ccc 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,16 @@ logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s" ) +def process_pipeline(dat_file): + # 1. Process DAT to ASC + asc_file = batch._process_single_file(dat_file) + if not asc_file: + return None + + # 2. Extract data from ASC + file_results = timeseries.process_asc_file(asc_file, locations) + return file_results + if __name__ == "__main__": os.makedirs(Path(Config.ASC_TOP_FOLDER), exist_ok=True) os.makedirs(Path(Config.COMBINED_FOLDER), exist_ok=True) @@ -45,16 +55,6 @@ if __name__ == "__main__": # Initialize results structure results = {loc[0]: {"dates": [], "values": []} for loc in locations} - def process_pipeline(dat_file): - # 1. Process DAT to ASC - asc_file = batch._process_single_file(dat_file) - if not asc_file: - return None - - # 2. Extract data from ASC - file_results = timeseries.process_asc_file(asc_file, locations) - return file_results - # Get list of DAT files dat_files = [ f for f in os.listdir(Path(Config.DAT_TOP_FOLDER)) if not f.startswith(".") diff --git a/pyproject.toml b/pyproject.toml index c3ecfef..1f10b49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "met-office" -version = "1.1.0" +version = "1.1.1" description = "Convert .dat nimrod files to .asc files" readme = "README.md" requires-python = ">=3.14" diff --git a/uv.lock b/uv.lock index a0b486f..127efef 100644 --- a/uv.lock +++ b/uv.lock @@ -4,7 +4,7 @@ requires-python = ">=3.14" [[package]] name = "met-office" -version = "1.1.0" +version = "1.1.1" source = { virtual = "." } dependencies = [ { name = "numpy" },