second pass. low
This commit is contained in:
@@ -76,6 +76,8 @@ def _apply_extensions(pt: gpxpy.gpx.GPXTrackPoint, dp: DataPoint) -> None:
|
||||
dp.temperature_c = float(val)
|
||||
elif tag == "speed":
|
||||
dp.speed_kmh = float(val) * 3.6 # m/s → km/h
|
||||
elif tag in ("pwr", "power", "watts"):
|
||||
dp.power_w = int(float(val))
|
||||
|
||||
|
||||
def _strip_ns(tag: str) -> str:
|
||||
|
||||
@@ -97,8 +97,8 @@ def _parse_ts(s: str) -> datetime:
|
||||
return datetime.strptime(s, fmt).replace(tzinfo=timezone.utc)
|
||||
except ValueError:
|
||||
continue
|
||||
# Numeric offset like +02:00 or -05:30 — parse with %z then convert to UTC
|
||||
m = _re.match(r"^(.+)([+-]\d{2}:\d{2})$", s)
|
||||
# Numeric offset like +02:00, -05:30, or +0200 — parse with %z then convert to UTC
|
||||
m = _re.match(r"^(.+)([+-]\d{2}:?\d{2})$", s)
|
||||
if m:
|
||||
body, off = m.group(1), m.group(2).replace(":", "")
|
||||
for fmt in ("%Y-%m-%dT%H:%M:%S.%f", "%Y-%m-%dT%H:%M:%S"):
|
||||
|
||||
Reference in New Issue
Block a user