Skip to content

Commit

Permalink
Merge pull request #79 from AartGoossens/feature/ag_fix_summaries_no_…
Browse files Browse the repository at this point in the history
…data

Fixes summary data when there are no records
  • Loading branch information
AartGoossens authored Apr 16, 2021
2 parents be36147 + 65481b9 commit b93124c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Types of changes:
- `Security` in case of vulnerabilities.

## [Unreleased] - {ISO8601 date}
### Fixed
- `read_fit()` now handles summary data correctly when there is no data

## [0.20.1] - 2021-04-16
### Fixed
Expand Down
6 changes: 3 additions & 3 deletions sweat/io/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ def read_fit(

fit_df = pd.DataFrame(records)

session_summaries = process_summaries(session_summaries)
lap_summaries = process_summaries(lap_summaries)

if fit_df.empty:
fit_df = create_empty_dataframe()
else:
Expand Down Expand Up @@ -202,9 +205,6 @@ def read_fit(

fit_df = process_location_columns(fit_df, columns=["latitude", "longitude"])

session_summaries = process_summaries(session_summaries)
lap_summaries = process_summaries(lap_summaries)

fit_df["session"] = 0
fit_df["lap"] = 0
session_end = pd.Timestamp.max.tz_localize("UTC")
Expand Down

0 comments on commit b93124c

Please sign in to comment.