When writing a test for the Data class update_rescaling method, I noticed a few improvement opportunities.
Here is the code now:
def update_rescaling(self, corplist, ncorplist):
"""
Updates the rescaling factors associated with the DataFrame
"""
assert len(corplist) == 14
assert len(ncorplist) == 14
self.rescale_corp = corplist
self.rescale_noncorp = ncorplist
As far as I can see the two arguments passed in and both the Data class attributes rescale_?corp are all numpy arrays. Given that, wouldn't it be less confusing to replace corplist with something like corparray and replace ncorplist with something like ncorparray?
Also, I don't understand the docstring. What is meant by the phrase "factors associated with the DataFrame"?
The factors are associated with the Data class, right? So, maybe it would be clearer to say something like this:
Updates the rescaling factors in the Data class object
When writing a test for the Data class
update_rescaling
method, I noticed a few improvement opportunities. Here is the code now:As far as I can see the two arguments passed in and both the Data class attributes
rescale_?corp
are all numpy arrays. Given that, wouldn't it be less confusing to replacecorplist
with something likecorparray
and replacencorplist
with something likencorparray
?Also, I don't understand the docstring. What is meant by the phrase "factors associated with the DataFrame"? The factors are associated with the Data class, right? So, maybe it would be clearer to say something like this:
Updates the rescaling factors in the Data class object