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

Modify season codes to account for seasons within single calendar year #523

Closed
wants to merge 8 commits into from

Conversation

marcjbaron
Copy link
Contributor

@marcjbaron marcjbaron commented Mar 29, 2024

This PR addresses a problem of gathering data from certain unsupported leagues, referenced in #246, #218, and a comment in #354; specifically, custom leagues whose seasons take place within a single calendar year. Previously, the way the season codes were interpreted for single-year seasons would mean some seasons were skipped over or the same season was downloaded twice.

There is a change to the behaviour of currently supported leagues: Using a season code like "2015" would now be interpreted as "1415", as opposed to the previous interpretation of "1516". The original interpretation seems to make more logical sense, but at the expense of the non-supported leagues.

If this behaviour for supported leagues is not desired, I can comment on previous issues for visibility instead, but hopefully this is a minimally invasive change.

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 63.79310% with 21 lines in your changes missing coverage. Please review.

Project coverage is 65.47%. Comparing base (69fb0de) to head (fa2b79c).
Report is 163 commits behind head on master.

Files Patch % Lines
soccerdata/_common.py 60.78% 18 Missing and 2 partials ⚠️
soccerdata/whoscored.py 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #523      +/-   ##
==========================================
+ Coverage   59.33%   65.47%   +6.13%     
==========================================
  Files          11       13       +2     
  Lines        1633     2007     +374     
  Branches      336      414      +78     
==========================================
+ Hits          969     1314     +345     
- Misses        610      624      +14     
- Partials       54       69      +15     

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

@probberechts
Copy link
Owner

I do not think this solution is appropriate. Ideally, what you would want as a season code for the current season is "2324" for the EPL and "2024" for the MLS. To be able to implement this, I would add to the config file which calendar a league / tournament uses.

@probberechts probberechts added common Issue or pull request related to all scrapers enhancement New feature or request labels Apr 4, 2024
@marcjbaron marcjbaron force-pushed the season-code-amend branch from f1d63af to 9e0954f Compare May 5, 2024 17:34
@marcjbaron marcjbaron force-pushed the season-code-amend branch from 9e0954f to ff0bc9f Compare May 5, 2024 18:07
@marcjbaron
Copy link
Contributor Author

I have made a change to the season_code function to account for single calendar-year leagues; this change uses the start/end month in the league config files to modify the season codes as needed. However, this required adding a league parameter to the season code function, and changing subsequent calls to that function.

I have not written any tests for this change, since none of the default leagues use this type of calendar. However, I can do this shortly if the changes are appropriate.

@hugo-mrc
Copy link

hugo-mrc commented Jun 1, 2024

@probberechts @marcjbaron
Very interested into this PR ; any chance we could have that merge before the beginning of the Euro ?
Many thanks,

@probberechts
Copy link
Owner

Superseded by #611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Issue or pull request related to all scrapers enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants