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

Open
wants to merge 4 commits into
base: master
Choose a base branch
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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.42%. Comparing base (69fb0de) to head (9e0954f).
Report is 74 commits behind head on master.

❗ 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%   67.42%   +8.08%     
==========================================
  Files          11       13       +2     
  Lines        1633     2207     +574     
  Branches      336      482     +146     
==========================================
+ Hits          969     1488     +519     
- Misses        610      645      +35     
- Partials       54       74      +20     

☔ 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
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,

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.

None yet

4 participants