I changed some tests to account for the new syntax of S7 objects--eg. changing $ to @. Additionally, the new constructor for rate objects is called just rate() instead of new_rate() so I also changed some variable names in the tests to not conflict with that.
I don't like line 71 in rate.R. There, I have a subclass with a different default value of a property than the parent class. I want to override the super's default value for max_times, but when I just include max_times as a property of the subclass with a different default, the constructed object's value goes to that of the parent. (3 instead of Infinity for rate_delay).
I got around it by checking if max_times was supplied as an argument and providing the correct default value if it wasn't.
I didn't write change any documentation, so if that needs to be changed I will fix that. The changes are mainly internal, but it may be good to document what certain things are doing so that if S7 changes the purpose of the code can still be understood.
Mentioning @kbodwin since this PR is part of the awesome Independent Study: Advanced R with Dr Bodwin this quarter!
Fixes #1129
Notes/caveats:
I changed some tests to account for the new syntax of S7 objects--eg. changing
$
to@
. Additionally, the new constructor forrate
objects is called justrate()
instead ofnew_rate()
so I also changed some variable names in the tests to not conflict with that.I don't like line 71 in rate.R. There, I have a subclass with a different default value of a property than the parent class. I want to override the super's default value for
max_times
, but when I just includemax_times
as a property of the subclass with a different default, the constructed object's value goes to that of the parent. (3 instead of Infinity forrate_delay
).I got around it by checking if
max_times
was supplied as an argument and providing the correct default value if it wasn't.I didn't write change any documentation, so if that needs to be changed I will fix that. The changes are mainly internal, but it may be good to document what certain things are doing so that if S7 changes the purpose of the code can still be understood.
Mentioning @kbodwin since this PR is part of the awesome Independent Study: Advanced R with Dr Bodwin this quarter!