PDHdata / SmallFormats

Deck-stats server for less-common Magic: the Gathering formats
MIT License
6 stars 0 forks source link

Bulk synergy gets wrong answer sometimes #59

Closed vtbassmatt closed 1 year ago

vtbassmatt commented 1 year ago

For example, https://pdhdata.com/cmdr/239fa26f-94f7-5403-8e6b-8b4c65b69cbd/synergy says that Seagraf Skaab has NaN synergy with Mulldrifter. But Seagraf Skaab appears in only one deck (Mulldrifter, which itself has only one deck) so its synergy should be $\frac{1}{1} - \frac{1}{3710}$, which is 0.9997 and rounds to 1.

vtbassmatt commented 1 year ago

Fixed in next deploy. I believe the problem was that an earlier bug had written NaNs to the database. Then, when we tried to see whether we should update or not, the NaN was propagating into the calculation, so it "didn't need to be updated".