Skip to content

Commit c8afbc5

Browse files
committed
I hate timezones
1 parent 94e6f15 commit c8afbc5

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "wristpy"
3-
version = "0.2.5"
3+
version = "0.2.6"
44
description = "wristpy is a Python package designed for processing and analyzing wrist-worn accelerometer data."
55
authors = [
66
"Adam Santorelli <adam.santorelli@childmind.org>",

src/wristpy/io/readers/readers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ def read_watch_data(
6868
start_timestamp_ns + np.arange(n_samples) * sampling_interval_ns
6969
).astype(np.int64)
7070

71-
time_series = pl.from_epoch(pl.Series(timestamps_ns), time_unit="ns")
71+
time_series = (
72+
pl.from_epoch(pl.Series(timestamps_ns), time_unit="ns")
73+
.dt.replace_time_zone("UTC")
74+
.dt.convert_time_zone("America/New_York")
75+
)
7276

7377
acceleration_measurement = models.Measurement(
7478
measurements=acceleration_data, time=time_series
@@ -212,6 +216,7 @@ def _read_actigraph_csv(
212216

213217
start_time = lines[2].strip().split()[-1]
214218
start_date = lines[3].strip().split()[-1]
219+
215220
start_datetime = datetime.datetime.strptime(
216221
f"{start_date} {start_time}", "%d/%m/%Y %H:%M:%S"
217222
)

0 commit comments

Comments
 (0)