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/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..9130214 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" @@ -28,7 +28,7 @@ dependencies = [ "pandas", "tzlocal", "openpyxl", - "matplotlib", + "matplotlib" ] [project.urls] diff --git a/uv.lock b/uv.lock index 53b5d89..2ef6bf9 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.2" 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" },