Skip to content

Commit

Permalink
Dev 441 hdforce v1.1.2 w/ update of test types (#6)
Browse files Browse the repository at this point in the history
* update actions workflow for PyPI publishing

* hdforce v1.1.2 w/ updated test types to include TS test names and IDs

* DEV-441 hdforce v1.1.2 w/ update to github actions yml files

* DEV 441 hdforce v1.1.2 fix to poetry.lock file out of date
  • Loading branch information
laureng-hd authored Aug 1, 2024
1 parent 6596f68 commit 7a99f5e
Show file tree
Hide file tree
Showing 40 changed files with 161 additions and 119 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Test Package and TestPyPI
on:
push:
branches:
- dev_env
- '*'

jobs:
test-package:
Expand Down Expand Up @@ -73,4 +73,4 @@ jobs:
with:
pypi_token: ${{ secrets.TEST_PYPI_TOKEN }}
repository_name: "testpypi"
repository_url: "https://test.pypi.org/legacy/"
repository_url: "https://test.pypi.org/legacy/"
2 changes: 1 addition & 1 deletion .github/workflows/python-docpage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
pip install mkdocs-material
- name: Deploy page
run: mkdocs gh-deploy --force
run: mkdocs gh-deploy --force
2 changes: 1 addition & 1 deletion .github/workflows/tag-release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
plugins: "poetry-dynamic-versioning[plugin]"
plugins: "poetry-dynamic-versioning[plugin]"
30 changes: 30 additions & 0 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Update README Badges

on:
pull_request:
branches:
- main
types: [closed]

jobs:
update-readme:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Update README badges
run: |
sed -i "s|branch=.*)](https://github.com/HawkinDynamics/hawkinPy/actions/workflows/push-test.yml)|branch=${GITHUB_REF#refs/heads/})](https://github.com/HawkinDynamics/hawkinPy/actions/workflows/push-test.yml)|" README.md
sed -i "s|hawkinPy/.*)](https://img.shields.io/github/last-commit/HawkinDynamics/hawkinPy/)|hawkinPy/${GITHUB_REF#refs/heads/})](https://img.shields.io/github/last-commit/HawkinDynamics/hawkinPy/)|" README.md
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "Update README badges with branch ${GITHUB_REF#refs/heads/}"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# HDFORCE v1.1.1 <img src="docs/img/hdlogo_sm.png" align="right" alt="" width="120" />
# HDFORCE v1.1.2 <img src="docs/img/hdlogo_sm.png" align="right" alt="" width="120" />


**Get your data from the Hawkin Dynamics API**

<!-- badges: start -->
![Static Badge](https://img.shields.io/badge/release-v1.1.0-blue)
![Static Badge](https://img.shields.io/badge/OS_and_Py_Version_Tests-pass-success)
![Static Badge](https://img.shields.io/badge/last_commit-2024--07--30-blue)
![GitHub Release](https://img.shields.io/github/v/release/HawkinDynamics/hawkinPy)
[![Test Py Versions and OS](https://github.com/HawkinDynamics/hawkinPy/actions/workflows/push-test.yml/badge.svg?branch=main)](https://github.com/HawkinDynamics/hawkinPy/actions/workflows/push-test.yml)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/HawkinDynamics/hawkinPy/main)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://www.tidyverse.org/lifecycle/#stable)
[![license](https://img.shields.io/badge/license-MIT%20+%20file%20LICENSE-lightgrey.svg)](https://choosealicense.com/)
Expand Down
4 changes: 4 additions & 0 deletions docs/About/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelogs

## hdforce v1.1.2

* Bug fix: addition of new TruStrength test names and IDs to testTypeId validation method

## hdforce v1.1.1

* Corrected versioning and documentation
Expand Down
2 changes: 0 additions & 2 deletions docs/Functions/CreateAthletes.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,3 @@ _output_
"successful": ["New Guy", "Old Guy"],
"failures": []
}


1 change: 0 additions & 1 deletion docs/Functions/GetAthletes.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ _output_
|----------------------|--------------|--------------------------------------------------|----------------------|--------|-------------------|-------------------|--------------------|--------------------|
| OLbsebtmf81eiwg1AeE5 | Lauren Green | ['DPMb6ek2mgUNVcg8siSqpnIvE2i2', 'vW9iEKafhs2PamfWQpFZ'] | ['yh8RnOvg56dQNrZGBKWZ'] | True | 2004 | Whittier | 83keo9wjei939ekd9 | SA0042643 |


2 changes: 1 addition & 1 deletion docs/Functions/GetForceTime.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ _output_
| 2001 | 2.002 | 46 | 122 | 168 | -1.128090 | -0.078543 | -189.519185 | [] |
| 2002 | 2.003 | 49 | 126 | 175 | -1.136487 | -0.079675 | -198.885184 | [] |
| 2003 | 2.004 | 53 | 130 | 183 | -1.144821 | -0.080816 | -209.502302 | [] |
| 2004 | 2.005 | 56 | 135 | 191 | -1.153090 | -0.081965 | -220.240178 | [] |
| 2004 | 2.005 | 56 | 135 | 191 | -1.153090 | -0.081965 | -220.240178 | [] |
2 changes: 1 addition & 1 deletion docs/Functions/GetMetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ _output_
| 7nNduHeM5zETPjHxvm7s | Countermovement Jump | peakRelativeBrakingForce | Peak Relative Braking Force | % | The peak instantaneous vertical ground reaction force applied to the system center of mass during the braking phase as a percentage of system weight. |
| 7nNduHeM5zETPjHxvm7s | Countermovement Jump | avgPropulsiveForce | Avg. Propulsive Force | N | The average vertical ground reaction force applied to the system center of mass during the propulsion phase. |
| 7nNduHeM5zETPjHxvm7s | Countermovement Jump | avgRelativePropulsiveForce| Avg. Relative Propulsive Force | % | The average vertical ground reaction force applied to the system center of mass during the propulsion phase as a percentage of system weight. |
| 7nNduHeM5zETPjHxvm7s | Countermovement Jump | peakPropulsiveForce | Peak Propulsive Force | N | The peak instantaneous vertical ground reaction force applied to the system center of mass during the propulsion phase. |
| 7nNduHeM5zETPjHxvm7s | Countermovement Jump | peakPropulsiveForce | Peak Propulsive Force | N | The peak instantaneous vertical ground reaction force applied to the system center of mass during the propulsion phase. |
2 changes: 1 addition & 1 deletion docs/Functions/GetTags.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ _output_
| Afcw45lIkeHFnlUyDeSn | 10/5 | 10/5 Multi-Rebound test protocol |
| KmZmhxUqrbOhLLvRLAbG | 5/3 | 5/3 Multi-Rebound test protocol |
| Lgc8uJh80NacB8eaqjOg | 20kg | addition of 20kg load to system mass |
| hVgWJkwHZ9Mm8XDymP3W | Hands On Hips | Akimbo style jump |
| hVgWJkwHZ9Mm8XDymP3W | Hands On Hips | Akimbo style jump |
2 changes: 2 additions & 0 deletions docs/Functions/GetTestsType.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The typeId has been created to be more user friendly, as it accepts any of canon
| r4fhrkPdYlLxYQxEeM78 | Multi Rebound | MR |
| ubeWMPN1lJFbuQbAM97s | Weigh In | WI |
| rKgI4y3ItTAzUekTUpvR | Drop Landing | DL |
| 4KlQgKmBxbOY6uKTLDFL | TS Free Run | TSFR |
| umnEZPgi6zaxuw0KhUpM | TS Isometric Test | TSISO |

### Parameters
__`typeId`__: _(str)_ The canonical test ID, test type name, or test name abbreviation. Must correspond to known test types.
Expand Down
25 changes: 12 additions & 13 deletions docs/Functions/GetTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ print(testTypes)

_output_

| id | name |
|----------------------|--------------------|
| id | name |
|----------------------|----------------------|
| 7nNduHeM5zETPjHxvm7s | Countermovement Jump |
| QEG7m7DhYsD6BrcQ8pic | Squat Jump |
| 2uS5XD5kXmWgIZ5HhQ3A | Isometric Test |
| gyBETpRXpdr63Ab2E0V8 | Drop Jump |
| 5pRSUQVSJVnxijpPMck3 | Free Run |
| pqgf2TPUOQOQs6r0HQWb | CMJ Rebound |
| r4fhrkPdYlLxYQxEeM78 | Multi Rebound |
| ubeWMPN1lJFbuQbAM97s | Weigh In |
| rKgI4y3ItTAzUekTUpvR | Drop Landing |



| QEG7m7DhYsD6BrcQ8pic | Squat Jump |
| 2uS5XD5kXmWgIZ5HhQ3A | Isometric Test |
| gyBETpRXpdr63Ab2E0V8 | Drop Jump |
| 5pRSUQVSJVnxijpPMck3 | Free Run |
| pqgf2TPUOQOQs6r0HQWb | CMJ Rebound |
| r4fhrkPdYlLxYQxEeM78 | Multi Rebound |
| ubeWMPN1lJFbuQbAM97s | Weigh In |
| rKgI4y3ItTAzUekTUpvR | Drop Landing |
| 4KlQgKmBxbOY6uKTLDFL | TS Free Run |
| umnEZPgi6zaxuw0KhUpM | TS Isometric Test |
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
**Get your data from the Hawkin Dynamics API**

<!-- badges: start -->
![Static Badge](https://img.shields.io/badge/release-v1.1.1-blue)
![Static Badge](https://img.shields.io/badge/OS_and_Py_Version_Tests-pass-success)
![Static Badge](https://img.shields.io/badge/last_commit-2024--07--30-blue)
![GitHub Release](https://img.shields.io/github/v/release/HawkinDynamics/hawkinPy)
[![Test Py Versions and OS](https://github.com/HawkinDynamics/hawkinPy/actions/workflows/push-test.yml/badge.svg?branch=main)](https://github.com/HawkinDynamics/hawkinPy/actions/workflows/push-test.yml)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/HawkinDynamics/hawkinPy/main)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://www.tidyverse.org/lifecycle/#stable)
[![license](https://img.shields.io/badge/license-MIT%20+%20file%20LICENSE-lightgrey.svg)](https://choosealicense.com/)
Expand Down
2 changes: 1 addition & 1 deletion hdforce/AuthManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ def AuthManager(authMethod: str = "env", refreshToken_name: str = "HD_REFRESH_TO
# Join the names of the empty variables into a comma-separated string
empty_vars_str = ", ".join(empty_variables)
logger.error(f"Missing variables: {empty_vars_str}.")
raise ValueError(f"The following variables are empty: {empty_vars_str}.")
raise ValueError(f"The following variables are empty: {empty_vars_str}.")
1 change: 1 addition & 0 deletions hdforce/Classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ class AthleteResult(BaseModel):
successful: bool
id: str
reason: List[str] = []

1 change: 1 addition & 0 deletions hdforce/CreateAthletes.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,4 @@ def CreateAthletes(athletes: List[NewAthlete]) -> List[AthleteResult]:
except ValueError:
logger.error("Failed to parse response JSON")
raise Exception("Failed to parse response JSON")

2 changes: 1 addition & 1 deletion hdforce/GetAthletes.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ def GetAthletes(includeInactive: bool = False) -> pd.DataFrame:
# Bad parse or none returned
except ValueError:
logger.error("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
2 changes: 1 addition & 1 deletion hdforce/GetForceTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ def GetForceTime(testId: str) -> pd.DataFrame:

except ValueError:
logger.error("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
2 changes: 1 addition & 1 deletion hdforce/GetGroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ def GetGroups() -> pd.DataFrame:

except ValueError:
logger.error("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
2 changes: 1 addition & 1 deletion hdforce/GetMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ def GetMetrics() -> pd.DataFrame:

except ValueError:
logger.error("Failed to parse JSON response or no data returned")
raise Exception("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
2 changes: 1 addition & 1 deletion hdforce/GetTags.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ def GetTags() -> pd.DataFrame:
# Bad parse or none returned
except ValueError:
logger.error("Failed to parse JSON response or no data returned")
raise Exception("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
2 changes: 1 addition & 1 deletion hdforce/GetTeams.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ def GetTeams() -> pd.DataFrame:
# Bad parse or none returned
except ValueError:
logger.error("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
6 changes: 4 additions & 2 deletions hdforce/GetTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def GetTests(from_=None, to_=None, sync=False, athleteId=None, typeId=None, team
"pqgf2TPUOQOQs6r0HQWb": ["pqgf2TPUOQOQs6r0HQWb", "CMJ Rebound", "CMJR"],
"r4fhrkPdYlLxYQxEeM78": ["r4fhrkPdYlLxYQxEeM78", "Multi Rebound", "MR"],
"ubeWMPN1lJFbuQbAM97s": ["ubeWMPN1lJFbuQbAM97s", "Weigh In", "WI"],
"rKgI4y3ItTAzUekTUpvR": ["rKgI4y3ItTAzUekTUpvR", "Drop Landing", "DL"]
"rKgI4y3ItTAzUekTUpvR": ["rKgI4y3ItTAzUekTUpvR", "Drop Landing", "DL"],
"4KlQgKmBxbOY6uKTLDFL": ["4KlQgKmBxbOY6uKTLDFL", "TS Free Run", "TSFR"],
"umnEZPgi6zaxuw0KhUpM": ["umnEZPgi6zaxuw0KhUpM", "TS Isometric Test", "TSISO"]
}
# Sort test type Id
for key, values in type_ids.items():
Expand Down Expand Up @@ -240,4 +242,4 @@ def GetTests(from_=None, to_=None, sync=False, athleteId=None, typeId=None, team
return f"JSON Error: {e}"

except Exception as e:
return f"An error occurred: {e}"
return f"An error occurred: {e}"
2 changes: 1 addition & 1 deletion hdforce/GetTestsAth.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ def GetTestsAth(athleteId: str, from_: int = None, to_: int = None, sync: bool =
return f"JSON Error: {e}"

except Exception as e:
return f"An error occurred: {e}"
return f"An error occurred: {e}"
2 changes: 1 addition & 1 deletion hdforce/GetTestsGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ def GetTestsGroup(groupId: str, from_: int = None, to_: int = None, sync: bool =
return f"JSON Error: {e}"

except Exception as e:
return f"An error occurred: {e}"
return f"An error occurred: {e}"
2 changes: 1 addition & 1 deletion hdforce/GetTestsTeam.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ def GetTestsTeam(teamId: str, from_: int = None, to_: int = None, sync: bool = F
return f"JSON Error: {e}"

except Exception as e:
return f"An error occurred: {e}"
return f"An error occurred: {e}"
24 changes: 13 additions & 11 deletions hdforce/GetTestsType.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,18 @@ def GetTestsType(typeId: str, from_: int = None, to_: int = None, sync: bool = F

# Check typeId
type_ids = {
"7nNduHeM5zETPjHxvm7s": ["7nNduHeM5zETPjHxvm7s", "Countermovement Jump", "CMJ"],
"QEG7m7DhYsD6BrcQ8pic": ["QEG7m7DhYsD6BrcQ8pic", "Squat Jump", "SJ"],
"2uS5XD5kXmWgIZ5HhQ3A": ["2uS5XD5kXmWgIZ5HhQ3A", "Isometric Test", "ISO"],
"gyBETpRXpdr63Ab2E0V8": ["gyBETpRXpdr63Ab2E0V8", "Drop Jump", "DJ"],
"5pRSUQVSJVnxijpPMck3": ["5pRSUQVSJVnxijpPMck3", "Free Run", "FREE"],
"pqgf2TPUOQOQs6r0HQWb": ["pqgf2TPUOQOQs6r0HQWb", "CMJ Rebound", "CMJR"],
"r4fhrkPdYlLxYQxEeM78": ["r4fhrkPdYlLxYQxEeM78", "Multi Rebound", "MR"],
"ubeWMPN1lJFbuQbAM97s": ["ubeWMPN1lJFbuQbAM97s", "Weigh In", "WI"],
"rKgI4y3ItTAzUekTUpvR": ["rKgI4y3ItTAzUekTUpvR", "Drop Landing", "DL"]
}
"7nNduHeM5zETPjHxvm7s": ["7nNduHeM5zETPjHxvm7s", "Countermovement Jump", "CMJ"],
"QEG7m7DhYsD6BrcQ8pic": ["QEG7m7DhYsD6BrcQ8pic", "Squat Jump", "SJ"],
"2uS5XD5kXmWgIZ5HhQ3A": ["2uS5XD5kXmWgIZ5HhQ3A", "Isometric Test", "ISO"],
"gyBETpRXpdr63Ab2E0V8": ["gyBETpRXpdr63Ab2E0V8", "Drop Jump", "DJ"],
"5pRSUQVSJVnxijpPMck3": ["5pRSUQVSJVnxijpPMck3", "Free Run", "FREE"],
"pqgf2TPUOQOQs6r0HQWb": ["pqgf2TPUOQOQs6r0HQWb", "CMJ Rebound", "CMJR"],
"r4fhrkPdYlLxYQxEeM78": ["r4fhrkPdYlLxYQxEeM78", "Multi Rebound", "MR"],
"ubeWMPN1lJFbuQbAM97s": ["ubeWMPN1lJFbuQbAM97s", "Weigh In", "WI"],
"rKgI4y3ItTAzUekTUpvR": ["rKgI4y3ItTAzUekTUpvR", "Drop Landing", "DL"],
"4KlQgKmBxbOY6uKTLDFL": ["4KlQgKmBxbOY6uKTLDFL", "TS Free Run", "TSFR"],
"umnEZPgi6zaxuw0KhUpM": ["umnEZPgi6zaxuw0KhUpM", "TS Isometric Test", "TSISO"]
}

for key, values in type_ids.items():
if typeId in values:
Expand Down Expand Up @@ -191,4 +193,4 @@ def GetTestsType(typeId: str, from_: int = None, to_: int = None, sync: bool = F
return f"JSON Error: {e}"

except Exception as e:
return f"An error occurred: {e}"
return f"An error occurred: {e}"
2 changes: 1 addition & 1 deletion hdforce/GetTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ def GetTypes() -> pd.DataFrame:

except ValueError:
logger.error("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
raise Exception("Failed to parse JSON response or no data returned.")
2 changes: 1 addition & 1 deletion hdforce/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
from .GetAthletes import GetAthletes
from .GetGroups import GetGroups
from .GetTeams import GetTeams
from .GetTags import GetTags
from .GetTags import GetTags
1 change: 1 addition & 0 deletions hdforce/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,4 @@ def wrapper(*args, **kwargs):
return func(*args, **kwargs)
return wrapper
return decorator

2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: hdforce by Hawkin Dynamics
site_name: hdforce v1.1.2 by Hawkin Dynamics
nav:
- Home: index.md
- User Guide:
Expand Down
Loading

0 comments on commit 7a99f5e

Please sign in to comment.