glandfried / TrueSkillThroughTime.jl

The TrueSkill Through Time Julia Package
https://glandfried.github.io/TrueSkillThroughTime.jl/
Other
11 stars 2 forks source link

Amend method/struct defs for v1.10 to precompile #3

Closed dzonimn closed 1 year ago

dzonimn commented 1 year ago

Hi, in Julia v1.10, the package would not be able to precompile due to struct constructors and add_event method definitions being redefined in multiple lines. Previously in v1.9, Julia would just flag an error and allow you to still use the package, in v1.10, Julia would just not let you use the package.

This PR allows the package to precompile properly while being able to pass all the tests that have been defined. At the expense of some extra lines of code, I tried to keep to clarity in the different method/struct argument combinations that are possible. This often involved removing default arguments in positional argument functions and defining separate functions that took fewer arguments. Keyword argument functions were mostly untouched I think.

I think it's likely that there are less method definitions that exist after this change, so it would be good to inspect if there is a method combination that you think is missing.