Repository navigation
Fix distance-step read path and validate duration_meters (#52 follow-up) - #54
Merged
Merged
Conversation
…ow-up) Addresses the remaining warnings from the Hermes Agent review on PR #52: - _parse_workout now decodes targetType=5 exercises as distance_meters (meters x100 unscaled) and unscales x1000 intensity values, instead of misreporting a 1km step as duration_seconds=100000 with intensity 235000 in list_workout_templates. - duration_meters is coerced via float() and must be positive: negative and zero values raise ValueError, a non-numeric string no longer hits Python string-repeat, a numeric string now builds correctly. - Docs caught up: coros_api.save_workout_template docstring, module comment (targetType=5), list_workout_templates return shape, README distance example and updated return keys. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #52, addressing the remaining warnings from the Hermes Agent (Grok Build) review there.
Fixes
_parse_workoutnow decodestargetType=5exercises asdistance_meters(÷100) and unscales ×1000 intensity values whenintensityMultiplier=1000. Previouslylist_workout_templatesreported a 1 km step asduration_seconds: 100000(≈28 h) with intensity235000.duration_metersis coerced viafloat()and must be positive — negative/zero raiseValueError, a non-numeric string no longer triggers Python string-repeat ("1000" * 100), a numeric string now builds correctly.coros_api.save_workout_templatedocstring, module comment (targetType=5encoding),list_workout_templatesreturn shape, README distance example + updated return keys.Not addressed here: review⚠️ 4 (pure-distance repeat groups emit a time-typed group header with
targetValue=0) — needs live verification against the Coros API before changing the header encoding.Testing
duration_meters) and_parse_workoutround-trips for distance and time steps.🤖 Generated with Claude Code