From 077a4491da2bfbe4a1d93f02a87e9b4f144b2e09 Mon Sep 17 00:00:00 2001 From: Daniel Heinesen Date: Fri, 26 Jul 2024 16:39:41 +0200 Subject: [PATCH] Small changes --- src/pyaro_readers/eeareader/EEATimeseriesReader.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pyaro_readers/eeareader/EEATimeseriesReader.py b/src/pyaro_readers/eeareader/EEATimeseriesReader.py index 3ac1ae0..8118f14 100644 --- a/src/pyaro_readers/eeareader/EEATimeseriesReader.py +++ b/src/pyaro_readers/eeareader/EEATimeseriesReader.py @@ -52,8 +52,12 @@ def __init__( ) files = self._create_file_list(filename, species) lf = polars.scan_parquet(files) + df = lf.collect() + df = df.with_columns( + (polars.col("Samplingpoint").str.extract(r"(.*)/.*")).alias("Country Code") + ) - return lf + return df # folder_list = self._create_file_list(filename, species_ids) def _create_file_list(self, root: Path, species: list[str]): @@ -106,7 +110,7 @@ def is_valid_url(self, url): if __name__ == "__main__": - filters = {"variables": {"include": ["SO2", "PM10"]}} + filters = {"variables": {"include": ["SO2", "PM10", "PM2.5"]}} reader = EEATimeseriesReader( "/home/danielh/Documents/pyaerocom/pyaro-readers/src/pyaro_readers/eeareader/data", filters=filters,