From e04c73a60bb499d2da5ac9539583309a03641164 Mon Sep 17 00:00:00 2001 From: Stas Khirman Date: Wed, 24 Sep 2025 12:30:52 -0400 Subject: [PATCH 1/3] feat: bump version to 0.4.2 and add pyarrow dependency - Bump version from 0.4.0 to 0.4.2 for latest improvements - Add pyarrow>=21.0.0 to main dependencies for enhanced data processing - Add empty time_diffs validation in CGMS2DayByDay to prevent errors - Update uv.lock with new dependency structure This version includes: - Full pandas 1.5.x compatibility for Databricks environments - Critical DST transition bug fixes - Enhanced test framework with rtol=0.001 precision - Modern dependency management with optional groups - Comprehensive timezone handling improvements Ready for production deployment with improved reliability and compatibility. --- iglu_python/utils.py | 2 ++ pyproject.toml | 3 ++- uv.lock | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/iglu_python/utils.py b/iglu_python/utils.py index fc304c6..8291bba 100644 --- a/iglu_python/utils.py +++ b/iglu_python/utils.py @@ -213,6 +213,8 @@ def CGMS2DayByDay( # noqa: C901 if dt0 is None: # Use most common time difference (for pandas 1.5.x backward compatibility) time_diffs = pd.Series(data.index).diff().dropna() + if time_diffs.empty: + raise ValueError("Not enough data to calculate time step") # Pandas TimedeltaIndex does not have a .mode() method directly. # We'll convert to seconds and use pd.Series.mode() # Use .dt accessor for pandas 1.5.x compatibility diff --git a/pyproject.toml b/pyproject.toml index 0c0ec4b..963a3ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "iglu_python" -version = "0.4.0" +version = "0.4.2" description = "Python implementation of the iglu package for continuous glucose monitoring data analysis" readme = "README.md" requires-python = ">=3.11" @@ -29,6 +29,7 @@ dependencies = [ "tzlocal", "openpyxl", "matplotlib", + "pyarrow>=21.0.0", ] [project.urls] diff --git a/uv.lock b/uv.lock index 53b5d89..0d1ff9d 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 2 requires-python = ">=3.11" resolution-markers = [ "python_full_version >= '3.12'", @@ -621,13 +621,14 @@ wheels = [ [[package]] name = "iglu-python" -version = "0.3.8" +version = "0.4.0" source = { editable = "." } dependencies = [ { name = "matplotlib" }, { name = "numpy" }, { name = "openpyxl" }, { name = "pandas" }, + { name = "pyarrow" }, { name = "tzlocal" }, ] @@ -676,6 +677,7 @@ requires-dist = [ { name = "pandas" }, { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=3.0.0" }, { name = "pre-commit", marker = "extra == 'lint'", specifier = ">=3.0.0" }, + { name = "pyarrow", specifier = ">=21.0.0" }, { name = "pyarrow", marker = "extra == 'dev'", specifier = ">=21.0.0" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.4.2" }, { name = "pytest", marker = "extra == 'test'", specifier = ">=8.4.2" }, From 05085abaa646db131b15bdb00cfe51de6ff87b58 Mon Sep 17 00:00:00 2001 From: Stas Khirman Date: Wed, 24 Sep 2025 12:43:13 -0400 Subject: [PATCH 2/3] refactor: remove pyarrow from main dependencies - Remove pyarrow>=21.0.0 from main project dependencies - Keep pyarrow in optional dev dependencies for development use - Reduces main package size and installation requirements - Users can still install pyarrow via dev dependencies if needed --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 963a3ef..9130214 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,8 +28,7 @@ dependencies = [ "pandas", "tzlocal", "openpyxl", - "matplotlib", - "pyarrow>=21.0.0", + "matplotlib" ] [project.urls] From 1c7a7307df39525e6d98fa766d1d005bbda6d648 Mon Sep 17 00:00:00 2001 From: Stas Khirman Date: Wed, 26 Nov 2025 12:13:20 +0200 Subject: [PATCH 3/3] chore: ignore test notebook and update dependencies - Add notebooks/test.ipynb to .gitignore - Update uv.lock with latest dependency versions --- .gitignore | 1 + uv.lock | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 76442a6..5603b61 100644 --- a/.gitignore +++ b/.gitignore @@ -184,3 +184,4 @@ tests/data/day5.csv # Other virtual environments .venv-* venv-* +notebooks/test.ipynb diff --git a/uv.lock b/uv.lock index 0d1ff9d..2ef6bf9 100644 --- a/uv.lock +++ b/uv.lock @@ -621,7 +621,7 @@ wheels = [ [[package]] name = "iglu-python" -version = "0.4.0" +version = "0.4.2" source = { editable = "." } dependencies = [ { name = "matplotlib" },