Open ebjaime opened 3 years ago
That's strange its only erroring for private leagues. What is the scoring settings for the private league? I will add a check that home
is present so it doesn't error
My bad. It's a points league. I was confusing the team
variables for NBA teams instead of fantasy teams. I had it all wrong.
I tried adding a check statement for the home
parameter in line 36 at league.py
but a different error occured regarding that same parameter. It might also be related to the fact that it is a points-league.
Still, isn't there an option to use the API for points-based leagues? If not, I may be able to extend the API (or assist in the process) for it to work for points leagues.
(I'm sorry for my ignorance of the API, I haven't had time to dig deep into the code.)
Is it a total season points league?
The majority of the API the scoring settings will not effect it. The only interface that it gets tricky is the box_scores
and the corresponding box_player
object.
Fantasy basketball is still relatively new for me and I have only played in H2H Points league. Its interesting how much the scoring settings vary in basketball.
It is a total season points league indeed.
A workaround to solve the home
issue is commenting out the call to the self._map_matchup_ids()
in self._fetch_league()
.
As you said the box_scores
and box_players
methods throw errors when calling them (because of not initialized h2h parameters). But the rest of the API seems to work just fine...
An extension for the API to get in the future could include similar functionalities for points leagues (get previous scoring period data). As I said, I am available and would be happy to assist in the process.
This PR #192 should hopefully fix the error when initializing the League.
Yeah that sounds like a great idea and would be very useful for some of the other basketball scoring settings as well. Your help would be greatly appreciated, I can always use more contributors!
Great! Just saw it.
I'll add a pull request with support for points-leagues as soon as I can.
I'll leave the issue open until then. Cheers!
Sounds good! Thanks again for looking into this issue and helping out!
While fetching the league (in
_fetch_league
) a_map_matchup_ids
method is called where a key error is encountered:For public leagues, this error does not show up. I can't seem to figure out why this happens...