sweatstack 0.48.0__py3-none-any.whl → 0.49.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sweatstack/client.py +7 -1
- {sweatstack-0.48.0.dist-info → sweatstack-0.49.0.dist-info}/METADATA +1 -1
- {sweatstack-0.48.0.dist-info → sweatstack-0.49.0.dist-info}/RECORD +5 -5
- {sweatstack-0.48.0.dist-info → sweatstack-0.49.0.dist-info}/WHEEL +0 -0
- {sweatstack-0.48.0.dist-info → sweatstack-0.49.0.dist-info}/entry_points.txt +0 -0
sweatstack/client.py
CHANGED
|
@@ -829,6 +829,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
|
|
|
829
829
|
self,
|
|
830
830
|
activity_id: str,
|
|
831
831
|
adaptive_sampling_on: Literal["power", "speed"] | None = None,
|
|
832
|
+
metrics: list[Metric | str] | None = None,
|
|
832
833
|
) -> pd.DataFrame:
|
|
833
834
|
"""Gets the raw data for a specific activity.
|
|
834
835
|
|
|
@@ -839,6 +840,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
|
|
|
839
840
|
activity_id: The unique identifier of the activity.
|
|
840
841
|
adaptive_sampling_on: Optional parameter to apply adaptive sampling on
|
|
841
842
|
either "power" or "speed" data. If None, no adaptive sampling is applied.
|
|
843
|
+
metrics: Optional list of metrics to include in the results. Can be a list of Metric enums or strings.
|
|
842
844
|
|
|
843
845
|
Returns:
|
|
844
846
|
pd.DataFrame: A pandas DataFrame containing the activity's time-series data.
|
|
@@ -849,6 +851,8 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
|
|
|
849
851
|
params = {}
|
|
850
852
|
if adaptive_sampling_on is not None:
|
|
851
853
|
params["adaptive_sampling_on"] = adaptive_sampling_on
|
|
854
|
+
if metrics is not None:
|
|
855
|
+
params["metrics"] = self._enums_to_strings(metrics)
|
|
852
856
|
|
|
853
857
|
with self._http_client() as client:
|
|
854
858
|
response = client.get(
|
|
@@ -900,6 +904,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
|
|
|
900
904
|
self,
|
|
901
905
|
sport: Sport | str | None = None,
|
|
902
906
|
adaptive_sampling_on: Literal["power", "speed"] | None = None,
|
|
907
|
+
metrics: list[Metric | str] | None = None,
|
|
903
908
|
) -> pd.DataFrame:
|
|
904
909
|
"""Gets the data for the latest activity of a specific sport.
|
|
905
910
|
|
|
@@ -910,6 +915,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
|
|
|
910
915
|
sport: Optional sport to filter by. Can be a Sport enum or string.
|
|
911
916
|
adaptive_sampling_on: Optional metric to apply adaptive sampling for visualization.
|
|
912
917
|
Can be either "power" or "speed". Defaults to None.
|
|
918
|
+
metrics: Optional list of metrics to include in the results. Can be a list of Metric enums or strings.
|
|
913
919
|
|
|
914
920
|
Returns:
|
|
915
921
|
pd.DataFrame: A pandas DataFrame containing the activity data.
|
|
@@ -918,7 +924,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
|
|
|
918
924
|
HTTPStatusError: If the API request fails.
|
|
919
925
|
"""
|
|
920
926
|
activity = self.get_latest_activity(sport=sport)
|
|
921
|
-
return self.get_activity_data(activity.id, adaptive_sampling_on)
|
|
927
|
+
return self.get_activity_data(activity.id, adaptive_sampling_on, metrics=metrics)
|
|
922
928
|
|
|
923
929
|
def get_latest_activity_mean_max(
|
|
924
930
|
self,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
sweatstack/__init__.py,sha256=tiVfgKlswRPaDMEy0gA7u8rveqEYZTA_kyB9lJ3J6Sc,21
|
|
2
2
|
sweatstack/cli.py,sha256=N1NWOgEZR2yaJvIXxo9qvp_jFlypZYb0nujpbVNYQ6A,720
|
|
3
|
-
sweatstack/client.py,sha256=
|
|
3
|
+
sweatstack/client.py,sha256=m2caYKmtzhpKlxb5p3mIZM6PE0fDzVkwNbQBC7MMQ3c,54395
|
|
4
4
|
sweatstack/constants.py,sha256=fGO6ksOv5HeISv9lHRoYm4besW1GTveXS8YD3K0ljg0,41
|
|
5
5
|
sweatstack/ipython_init.py,sha256=OtBB9dQvyLXklD4kA2x1swaVtU9u73fG4V4-zz4YRAg,139
|
|
6
6
|
sweatstack/jupyterlab_oauth2_startup.py,sha256=YcjXvzeZ459vL_dCkFi1IxX_RNAu80ZX9rwa0OXJfTM,1023
|
|
@@ -11,7 +11,7 @@ sweatstack/streamlit.py,sha256=_PER03s0dYu5eF1MZdewPDqSvYHqMr0lZLu_EnGit3Y,13257
|
|
|
11
11
|
sweatstack/sweatshell.py,sha256=MYLNcWbOdceqKJ3S0Pe8dwHXEeYsGJNjQoYUXpMTftA,333
|
|
12
12
|
sweatstack/utils.py,sha256=AwHRdC1ziOZ5o9RBIB21Uxm-DoClVRAJSVvgsmSmvps,1801
|
|
13
13
|
sweatstack/Sweat Stack examples/Getting started.ipynb,sha256=k2hiSffWecoQ0VxjdpDcgFzBXDQiYEebhnAYlu8cgX8,6335204
|
|
14
|
-
sweatstack-0.
|
|
15
|
-
sweatstack-0.
|
|
16
|
-
sweatstack-0.
|
|
17
|
-
sweatstack-0.
|
|
14
|
+
sweatstack-0.49.0.dist-info/METADATA,sha256=Wcakp5WSWs0lnFjbWovJDWZ08nt8qAcExPVXSVYs3vw,852
|
|
15
|
+
sweatstack-0.49.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
16
|
+
sweatstack-0.49.0.dist-info/entry_points.txt,sha256=kCzOUQI3dqbTpEYqtgYDeiKFaqaA7BMlV6D24BMzCFU,208
|
|
17
|
+
sweatstack-0.49.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|