-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Supply ff_scoring() as an argument to ff_scoringhistory() to allow for customization #375
Comments
PR welcome if you like, unsure when I'll get to this - probably not in the next release |
I suck at PR's (doing it "right" is like 9 steps I don't remember how to do, haha). I can try, but I'm having trouble finding the code for ff_playerscores(). Any tips on how to navigate this repository to find it? |
you only need to update https://github.com/ffverse/ffscrapr/blob/main/data-raw/stat_mapping.csv |
That needs no updates. Fumbles lost are already in there. They just aren't showing up in the df output of ff_scoringhistory(). That's what I meant when I said there was already stat mapping for this. So it's just the function itself that needs an update, right? |
No, you'll need to add fumbles_lost for MFL. edit: I lied, it just needs the mapping. |
I’m still confused because the mapping here includes all 3 types of fumbles lost for MFL. |
Okay, I was interpreting based on your question but auditing an actual test case - fumbles lost is already on here: ffscrapr::ff_scoringhistory(ffscrapr::mfl_connect(2022,54040)) |> names()
So what bug are you looking at? |
Here's what I'm getting:
|
OH WAIT! Is ff_scoringhistory() written so that it only includes variables that are used in your particular league's scoring system? That explains to me what's going on here. What do you think about updating the function so that it imports all variables available on the platform, but only computes fantasy points based on the relevant ones? I think this would be extremely helpful for commissioners who want to play around with seeing how using new stats would affect player scores in their leagues. I guess this is my new/official feature request if I'm right about what's happening. |
Better would be adding an optional argument that would provide an ff_scoring dataframe to use instead of the original. Busy, but can stick onto the backlog |
Ooo yeah, good point. So the argument would be something like "customize = TRUE" if we want to get just the variables currently present/counted in our scoring system? And currently this is set to TRUE by default, but in the update it would be set to FALSE? |
it would be something like
by default, and you can supply it a different dataframe if you want different scoring, I think. Not sure yet but I feel that would be the best implementation |
Would that argument affect the points variable and how it’s calculated, the variables passed to the output df, or both? And if it’s left blank, what happens? I guess I’m still wanting to make sure that there’s a way I can pass an MFL conn object that uses, say, only 10 of MFL’s available stats in my scoring, but still see the output of all available MFL stats whether I use it or not (ideally by default). |
It's a performance consideration and slows down an already slow query, so no - it would only return scoring history for the scoring variables that are passed into the function. The right thing to do would be to have a different function or parameter in
|
I think this should be pretty straightforward, as there's already stat mapping for this. I like keeping fumbles in there, but most fantasy scoring systems track fumbles lost instead. Could you add rushing_fumbles_lost, receiving_fumbles_lost, and sack_fumbles_lost to this function? Thanks!
The text was updated successfully, but these errors were encountered: