From f238d4f2c69778b624055a82bb26387279aa6f76 Mon Sep 17 00:00:00 2001 From: Nikita Makarov Date: Wed, 1 Apr 2026 14:32:12 +0000 Subject: [PATCH] Fixing for pandas v3 --- pyproject.toml | 6 +++--- twinweaver/instruction/data_splitter_forecasting.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3f929f9..a059c54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ build-backend = "setuptools.build_meta" # Standard entry point for setuptools bu [project] name = "twinweaver" -version = "0.3.3" +version = "0.3.4" description = "Converting longitudinal patient data into text for LLM-based event prediction and forecasting." # --- NEW/UPDATED FIELDS --- @@ -46,7 +46,7 @@ classifiers = [ # dependencies dependencies = [ "numpy", - "pandas<3.0.0", + "pandas", "transformers", "scikit-learn", "jupyter", @@ -58,7 +58,7 @@ dependencies = [ dev = [ "pytest", "numpy", - "pandas<3.0.0", + "pandas", "transformers", "scikit-learn", "ruff", diff --git a/twinweaver/instruction/data_splitter_forecasting.py b/twinweaver/instruction/data_splitter_forecasting.py index 6fbc279..0f95dbf 100644 --- a/twinweaver/instruction/data_splitter_forecasting.py +++ b/twinweaver/instruction/data_splitter_forecasting.py @@ -274,6 +274,8 @@ def setup_statistics(self, train_patientids: list = None): del temp_patient_data all_possible_split_dates = pd.concat(all_possible_split_dates, axis=0, ignore_index=True) + # In case pandas 3.0.0 causes issues + all_possible_split_dates[self.config.date_col] = pd.to_datetime(all_possible_split_dates[self.config.date_col]) all_possible_split_dates = all_possible_split_dates.drop_duplicates() #: filter to only train patients