Skip to content

Commit

Permalink
merge develop: version fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
tcgoetz committed Feb 20, 2024
2 parents 096151f + 3f9e2cc commit 79d0087
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 25 deletions.
14 changes: 9 additions & 5 deletions Jupyter/activities.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,17 @@
" if activity:\n",
" if activity.is_steps_activity():\n",
" steps_activity = StepsActivities.get(garmin_act_db, activity.activity_id)\n",
" return [activity.activity_id, activity.name, activity.type, activity.sport, format_number(activity.distance, 1), activity.elapsed_time, format_number(activity.avg_speed, 1), steps_activity.avg_pace, format_number(activity.calories)]\n",
" return [activity.activity_id, activity.name, activity.type, activity.sport, format_number(activity.distance, 1), activity.elapsed_time, format_number(activity.avg_speed, 1), '', format_number(activity.calories)]\n",
" return [activity.activity_id, activity.name, activity.type, activity.sport, format_number(activity.distance, 1), activity.elapsed_time, format_number(activity.avg_speed, 1),\n",
" steps_activity.avg_pace, format_number(activity.calories), format_number(activity.training_load, 1), activity.self_eval_feel, activity.self_eval_effort]\n",
" return [activity.activity_id, activity.name, activity.type, activity.sport, format_number(activity.distance, 1), activity.elapsed_time, format_number(activity.avg_speed, 1), '',\n",
" format_number(activity.calories), format_number(activity.training_load, 1), activity.self_eval_feel, activity.self_eval_effort]\n",
" return ['', '', '', '', '', '', '', '', '']\n",
"\n",
"activities = Activities.get_latest(garmin_act_db, 10)\n",
"rows = [__format_activity(activity) for activity in activities]\n",
"doc.add_heading(\"Last Ten Activities\", 3)\n",
"doc.add_table(['Id', 'Name', 'Type', 'Sport', f'Distance ({distance_units})', 'Elapsed Time', f'Speed ({unit_strings[fitfile.units.UnitTypes.speed]})', f'Pace ({unit_strings[fitfile.units.UnitTypes.pace]})', 'Calories'], rows)\n",
"doc.add_table(['Id', 'Name', 'Type', 'Sport', f'Distance ({distance_units})', 'Elapsed Time', f'Speed ({unit_strings[fitfile.units.UnitTypes.speed]})',\n",
" f'Pace ({unit_strings[fitfile.units.UnitTypes.pace]})', 'Calories', 'Training Load', 'Feel', 'Effort'], rows)\n",
"\n",
"rows = []\n",
"for display_activity in gc_config.display_activities():\n",
Expand All @@ -98,7 +101,8 @@
" rows.append([f'Longest {name}'] + __format_activity(Activities.get_longest_by_sport(garmin_act_db, display_activity)))\n",
"\n",
"doc.add_heading(\"Interesting Activities\", 3)\n",
"doc.add_table(['What', 'Id', 'Name', 'Type', 'Sport', f'Distance ({distance_units})', 'Elapsed Time', f'Speed ({unit_strings[fitfile.units.UnitTypes.speed]})', f'Pace ({unit_strings[fitfile.units.UnitTypes.pace]})', 'Calories'], rows)\n",
"doc.add_table(['What', 'Id', 'Name', 'Type', 'Sport', f'Distance ({distance_units})', 'Elapsed Time', f'Speed ({unit_strings[fitfile.units.UnitTypes.speed]})',\n",
" f'Pace ({unit_strings[fitfile.units.UnitTypes.pace]})', 'Calories', 'Training Load', 'Feel', 'Effort'], rows)\n",
"\n",
"doc.add_heading(\"Courses\", 3)\n",
"courses = Activities.get_col_distinct(garmin_act_db, Activities.course_id)\n",
Expand Down Expand Up @@ -126,7 +130,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.7"
},
"orig_nbformat": 4
},
Expand Down
8 changes: 4 additions & 4 deletions Jupyter/activity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@
"doc.add_table(\n",
" [\n",
" 'Start', 'Id', 'Sport', 'Type', f'Distance ({distance_units})', \"Ellapsed Time\", \"Moving Time\", 'Avg HR', 'Max HR', 'Avg RR', 'Max RR', f'Gained ({altitude_units})', f'Lost ({altitude_units})',\n",
" \"Calories\", f\"Avg Temp (deg {temp_units})\", 'Start Location', 'End Location'\n",
" \"Calories\", 'Training Load', f\"Avg Temp (deg {temp_units})\", 'Start Location', 'End Location', \"Feel\", \"Effort\"\n",
" ],\n",
" [\n",
" [\n",
" activity.start_time, activity_id, activity.sport, activity.type, format_distance(activity.distance), activity.elapsed_time, activity.moving_time, activity.avg_hr, activity.max_hr,\n",
" format_number(activity.avg_rr), format_number(activity.max_rr), format_number(activity.ascent), format_number(activity.descent),\n",
" activity.calories, format_temp(activity.avg_temperature), linked_location(start_loc), linked_location(end_loc)\n",
" format_number(activity.avg_rr), format_number(activity.max_rr), format_number(activity.ascent), format_number(activity.descent), activity.calories,\n",
" format_number(activity.training_load, 1), format_temp(activity.avg_temperature), linked_location(start_loc), linked_location(end_loc), activity.self_eval_feel, activity.self_eval_effort\n",
" ]\n",
" ]\n",
")\n",
Expand Down Expand Up @@ -141,7 +141,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.7"
},
"orig_nbformat": 4
},
Expand Down
2 changes: 1 addition & 1 deletion Jupyter/jupyter_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def format_weight(distance, digits=1):

def linked_location(location):
"""Return a location as markdown formatted linked text."""
return snakemd.Inline(location.display(), location.to_google_maps_url())
return snakemd.Inline(location.display(), link=location.to_google_maps_url())
2 changes: 1 addition & 1 deletion Jupyter/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
garmindb>=3.2.8
snakemd==2.1.0
snakemd==2.2.0
ipykernel==6.25.1
ipywidgets==7.7.2
ipyleaflet==0.17.3
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ all: update_dbs
# install all needed code
setup_repo: $(CONF_DIR)/GarminConnectConfig.json $(PROJECT_BASE)/.venv submodules_update

setup_install: deps devdeps install_all
setup_install: version_check deps devdeps install_all

setup: setup_repo setup_install

Expand Down Expand Up @@ -68,6 +68,9 @@ $(PROJECT_BASE)/.venv:
clean_venv:
rm -rf $(PROJECT_BASE)/.venv

version_check:
python -c 'import sys; import garmindb.version; garmindb.version.python_dev_version_check(sys.argv[0])'

update: submodules_update
git pull

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ Jupyter notebooks for analzing data from the database can be found in the 'Jupyt

Plugins allow the user to expand the types of data that are processed and stored in the database. GarminDb already has a number of plugins for handling data from third-party Connect IQ apps and data fields. Read more about plugins [here](https://github.com/tcgoetz/GarminDbPlugins).

# Support This Project

Do you find this project useful? <a href="https://www.buymeacoffee.com/tcgoetz" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>

# Success Stories

Find out who's using GarminDb on what platforms, OSes, and python versions [here](https://github.com/tcgoetz/GarminDB/wiki/Success-Stories). If you're using GarminDB and your scenario isn't listed send me a message or file an issue with your success case.
Expand Down
8 changes: 4 additions & 4 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flake8==6.1.0
build==0.10.0
wheel==0.41.1
twine==4.0.2
flake8==7.0.0
build==1.0.3
wheel==0.42.0
twine==5.0.0
2 changes: 0 additions & 2 deletions garmindb/garmin_json_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ def get_self_eval_feel(cls, value):
"""Return the Garmin Connect self evaluation 'How did you feel' label for the activity."""
levels = [(100, "Very Strong"), (75, "Strong"), (50, "Normal"), (25, "Weak"), (0, "Very Weak")]
for threshold, label in levels:
print(f"Threshold {threshold} label {label}")
if value >= threshold:
return label

Expand All @@ -303,7 +302,6 @@ def get_self_eval_effort(cls, value):
levels = [(100, "Maximum"), (90, "Extremely Hard"), (70, "Very Hard"), (50, "Hard"),
(40, "Somewhat Hard"), (30, "Moderate"), (20, "Light"), (10, "Very Light"), (0, "None")]
for threshold, label in levels:
print(f"Threshold {threshold} label {label}")
if value >= threshold:
return label

Expand Down
9 changes: 7 additions & 2 deletions garmindb/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import idbutils.version as uv

from .version_info import python_required, python_tested, version_info, prerelease
from .version_info import dev_python_required, python_required, python_tested, version_info, prerelease


version_string = uv.to_string(version_info, prerelease)
Expand All @@ -23,5 +23,10 @@ def log_version(program):


def python_version_check(program):
"""Validate the Python version requirements."""
"""Validate the Python version requirements for a pip installed package."""
uv.python_version_check(program, python_required, python_tested)


def python_dev_version_check(program):
"""Validate the Python version requirements for development."""
uv.python_version_check(program, dev_python_required, python_tested, verbose=True)
1 change: 1 addition & 0 deletions garmindb/version_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


python_required = (3, 0, 0)
dev_python_required = (3, 9, 0)
python_tested = (3, 11, 4)
version_info = (3, 5, 3)
prerelease = False
Expand Down
3 changes: 1 addition & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
sqlalchemy~=2.0.25
requests
sqlalchemy~=2.0.27
python-dateutil
cached-property
tqdm
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
SQLAlchemy==2.0.25
requests==2.31.0
SQLAlchemy==2.0.27
python-dateutil==2.8.2
cached-property==1.5.2
tqdm==4.65.1
tqdm==4.66.2
garth>=0.4.44
fitfile>=1.1.7
tcxfile>=1.0.4
Expand Down

0 comments on commit 79d0087

Please sign in to comment.