Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basketball add expected return date to player #630

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

JohnDiebold
Copy link
Contributor

Small commit to add expected return date (from injury) to the player class. It returns a datetime date.

Example:
league.player_info(name="Jalen Johnson").expectedReturnDate)

Return:
2025-01-30

Alternatively if you prefer to keep it simple we could do it in one line:
self.expectedReturnDate = json_parsing(data, 'expectedReturnDate')

And then the same code returns:
[2025, 1, 30]

Just thought it might be nice to return in datetime format but I'm good with it either way.

Copy link

codecov bot commented Jan 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.73%. Comparing base (805ba67) to head (68a72fe).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #630      +/-   ##
==========================================
+ Coverage   82.71%   82.73%   +0.01%     
==========================================
  Files          61       61              
  Lines        2326     2328       +2     
==========================================
+ Hits         1924     1926       +2     
  Misses        402      402              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@cwendt94 cwendt94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit, but looks good!

@@ -18,6 +18,8 @@ def __init__(self, data, year, pro_team_schedule = None):
self.posRank = json_parsing(data, 'positionalRanking')
self.stats = {}
self.schedule = {}
expected_return_date = json_parsing(data, 'expectedReturnDate')
self.expectedReturnDate = datetime(*expected_return_date).date() if expected_return_date else None
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can set this var name to expected_return_date, to follow better python standard. It was my bad habit of following the API name vars in the beginning of creating this package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed, thanks for the review!

@cwendt94
Copy link
Owner

cwendt94 commented Feb 6, 2025

Just need to resolve conflict and I can merge it in!

@JohnDiebold
Copy link
Contributor Author

Resolved, thanks!

@cwendt94 cwendt94 merged commit 2235d80 into cwendt94:master Feb 7, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants